Entity Framework/Database modeling a chores list - sql-server

I'm developing an Asp.net mvc application with entity framework so that I can more easily create dish lists and chore lists for me and my roommates from month to month. I'm trying to model our chore list but I'm having a hard time figuring out how to model it clear and effective way that will make development smooth.
Here is a sample screen shot of the chores list
Chores are done on Mondays and Thursdays. Each chore has a person assigned to it and each chore has anywhere from 4 to 6 different tasks that must be complete.
I'm hoping to make an app that can generate this kind of chart. It doesn't need to hold information about whether a specific box is checked or not, it will be printed off.
But the way the system works is this. It allows the user to create a list of jobs and tasks such as kitchen, living room, and bathroom. And then the user can generate a monthly chore list where the chores are brought up and the person can be selected for each chore. Once this is complete and the user clicks a generate button, the list for the month is generated.
However, I want the system to be able to retain what house jobs were on which month and which users were on which job. I want the system to able to bring back this information even if the current jobs are edited and changed. This is where I'm confused. How would I be able to do this??? Should I make some sort of historical table that copies all of the rows from a chorestable when a chore list is generated? Any input or ideas where to start would be appreciated.

Create next tables:
Chores (Id, Date, RoommateId(link to Roommates), ChoreName, ChoreDescription, RoomId, WorkDate, ...)
ChoreTypes (Id, Name, Description)
Rooms (Id, Name, Descirption)
Roommates (Id, FirstName, LastName, ....)
If you will keep text from ChoreTypes dictionary in Chores table, then it will not change if you update ChoreTypes.

Related

is there a way to have 2 dates under a customer's name in Microsoft access

I'm an intern student at a company that does both wiring and aircon services. The job that they gave me was to make a database for them. I don't have any experience in anything related to databases.
So, I started to look up videos and stuff to at least learn a bit about databases and made something that works and I made it after 1.5 months of learning.
in the database that I created,
I have 1 table (CustomerDetailsT):
CustomerID (pk)
CustomerName
PhoneNumber
Address
Aircond (type and model of ac,ex: WM daikin 1.0HP)
AcDetails (what has been done for the ac.)
Others (yes/no) (Wiring, installing a fan and so on)
WhatHasBeenDone (shows what has been done for others)
Then 3 queries (CustomerOthersDetailsQ, CustomerAcDetailsQ, CustomerDetailsQ).CustomerAcDetailsQ has CustomerName, PhoneNumber, Address, Aircond and AcDetails. CustomerOthersDetailsQ has CustomerName, PhoneNumber, Address, Others, and WhatHasBeenDone.CustomerDetailsQ has CustomerID, CustomerName, PhoneNumber and Address
And 1 form with 3 subforms.
it's a search form, which would search for customers as we're typing in their name/phone number and it will show what has been done for the customer.
With this, I have created what the company wants, but now they want to add dates. Dates which would show when we have done something for a customer. Dates for Aircond and the Others stuff.
I've tried with what I know and it didn't work. tried searching it on youtube and google, but still couldn't find it.
how can I go about doing this?. I have tried having separate tables for each service, but it became a hassle when I wanted to create a new customer. . I hope I could some help, I could send pictures if someone needs them.
[1]: https://i.stack.imgur.com/mtrmC.png [The Customer search form] [1]: https://i.stack.imgur.com/A3Y9d.png [example of a customer that has ac installation] [1]: https://i.stack.imgur.com/dsGL5.png [example of a customer that has both ac and wiring done]
Acknowledging the question is too broad, here is some guidance. One of the nice things about Access is that each database is a single file. First protect your work by finding that file and make two copies. Make a backup and a play around version. Only mess with the play around version.
Your question indicates you are still learning Table Normalization and 1 to many relationships. Both of these topics are general to all databases, so you don't have to restrict yourself to just Access when looking for guides and Youtube videos.
Part of normalization is putting separate entities into their own tables. Also, in Access there is a big payoff for using the Relationship Tool, so here is a rather lame example of normalization:
Make sure to select the checkboxes when setting up relationships.
WhatHasbeenDone should also have WhatHasbeenDoneDate. I've wrapped AC and Other as Unit because later it will be easier than having two WhatHasBeenDone tables(AC)(Other).
Now imagine someone taking the customer request call. They just want to see a form to enter the customer details, request, unit-type, etc. They don't want to see those tables. Even with training entering data in the tables is error prone. The person fulfilling the request just wants to enter what they did and when. That's how you start to figure out what your final Data entry forms will look like.
Since we normalized the tables and used the relationships tool, the payoff is Access can give us an assortment of working starter forms. Select Each Table and then hit Create and then hit Form. Choose your Favorites and start playing around from there. While playing, keep in mind that Access will not let you add an item on the many side of a relationship unless there is an item on the 1 side.
For example I selected the customers table and hit create form:
Access uses a concept of form and subform based on separate but related tables. So, to get a form that shows what has been done for each customer I created a form for the What has been done table, and dragged it onto the customers form:
Unless an ID is also being used as a part number or something there is probably no reason for the person entering data to see it. So I removed the texboxes bound to ID's. Except for UnitTypeID, where I replaced the textbox with a combobox that displays the userfriendly UnitDescription. The ID's are still part of the form recordsources, Access is still adding new IDs and using those IDs to put the appropriate data in the right tables.
Oh, didn't we need dates (went back and added a date to the table, and adjusted the subform accordingly). Also changed the subform format from single record to continuous records to show multiple dates:
In conclusion and in my opinion your final forms will use VBA behind the scenes to insert data from the forms into the tables. This is because either you will want to rapidly insert multiple records or How the end users think about the data will not match the default forms and subforms approach Access depends upon to figure out how to insert the data. However, the default approach is fast and I always use it for version 1 of my Access Databases.
P.S. For simplicity I avoided including any Many to Many relationships

How To Summarize A Rollup Relationship That Cross References A Custom Object?

We are trying to implement a University system for students, faculty, and staff to be able to better manage course registrations as well as other enrollment activities.
Consider the following problem: When a student registers for a course, the course needs to get added to the students bill as a billing line item. The bill needs to have a total price of all the courses that have been registered for that particular student. Note: We've tried to keep the process manual in order to simplify the requirements.
We have identified 4 custom objects and some important fields:
Courses - Course Name:(Primary Key), Course Size:(Number), Course Price:(Currency), Start Date:(Date), End Date:(Date), Students Enrolled:(Rollup Count)
Course Registrations - Course Registration Number:(Primary Key), Course List:(Master-Detail), Student:(Lookup), Course Price:(Formula), Course Credits:(Formula)
Billing Line Item - Billing Line Item Number:(Primary Key), Course Registration:(Master-Detail), Bill:(Master-Detail), Course Price:(Formula)
Bill - Bill Name:(Primary Key), Student:(Lookup)
We know in order to summarize the total of all course prices, we need to make the Billing Line Item the detail object and the Bill the master object. We want to perform a Rollup Summary on all the Billing Line Item prices.
We've also made the Billing Line Item the detail object and the Course Registration a master object. This is because without a Course Registration, there is no need for a Billing Line Item to exist. Also the Course Registration has the Course Price via a formula which needs to be used in order to summarize the total cost of all courses.
I've seen online that you are unable to summarize a cross-reference object. We are getting confused as to how we should summarize all the prices associated with each course. Any help would be greatly appreciated. We can provide screenshots if requested!
I don't think the reference to course price should be a formula. Next year you'll change prices and it'll retroactively screw your past invoices up? (and you wouldn't even have field history tracking on the formula field, only on the Course. So if you don't know where to look it'll be as if it always was this price)
Make it a normal editable Number field (although Currency type would be better) and use workflow / "early" flow / process builder or code to populate the list price on save. You don't lose anything (as you create new line item now you also don't see the price until you save, formula field doesn't show up on "new", right?). This normal field will already be rollup-able but you can spice things up by adding discount % or differentiate between list price, sales price... Look how much stuff is on built-in OpportunityLineItem
If you feel really fancy - you can include something that on change of Course's list price would cascade down to all registrations and billing items where status = Open(?) and update the list price...

Form with Subform - find record by updating one of two fields

step by step i am advancing with my Gasoline inventory database and it is actually about to start becoming fun to try out different new things on the database.
However i got stuck on one little issue.
I have a form with a Subform.
May main form has two fields. One is the Gas Station and one is the date of the report that comes in.
Each report of any station contains one or more products with gallons sold, delivered and physical inventory (has to be applied manually as gas expands when warm)
I tried to add a macro to each of the two fields which requeries after update, but that didn't do anything.
Anyways, im looking for a solution that lets me look for past records by just updating one of the two fields in the main form.
I guess you have a table containing the Station details - Station ID, Station Name, etc. Something like the image below.
You'll also have a table or query that shows sales, delivery, etc for each station based on the Station ID (it'll also have a report date - forgot to add that to my example table).
When you place the subform into the main form you need to link the two forms so they stay in sync using the Master/Child fields (your StationID) which are available in the property sheet for the subform container:

multiple records for one person in a form in Access

For my internship I am making a database in Microsoft Access about employee's accidents at work. There is one table and one query in the database. For the form I want it to have one employee and all the previous and future dates of all the accidents they have had and the comments to show if they are repeating them. If this is possible how can it happen?
You'll need at least two tables: one table for the employee information (their name, employee number, and stuff like that) and another table for the accidents (employee number of the person who had the accident, when it happened, what happened, etc.). Then you could use a Form with an imbedded subform to display the information.
Microsoft has provided detailed information on how to use a subform here:
Create a form that contains a subform

MS Access. Names in forms instead of ID's

i have two tables
student(studentid, name, class)
Course (courseID, CourseName, CreditHours)
these tables have many to many relation ship so i created a third table
student_course(studentID,CourseID)
Now i have designed the forms in ms access through which user enters data in student and course tables
But i want to design a from through which user can assign courses to students which means user
have to enter data in student_course table.
but i want to design a form though which users can see and enter the student name and course name insted of ID's at backend ID should store in student_course table,
Can anyone help me in this matter.
You can use a combo box .. try to insert a combo box on the form using the wizard and it should walk you through the steps in showing the course name in the front end and saving the course id in the back end database ...

Resources