Spiritfarer
Spiritfarer
CC#
Created by Spiritfarer on 11/8/2023 in #help
❔ How can I add multiple services to my quotations?
That's why I want to see if someone with more knowledge has another idea.
14 replies
CC#
Created by Spiritfarer on 11/8/2023 in #help
❔ How can I add multiple services to my quotations?
The only solution I see possible is to first insert the data that is not related to the services themselves to generate the ID, and then add the services or something like that.... I'm not entirely sure how good it is from a code quality perspective, but it's the only idea that comes to mind at the moment.
14 replies
CC#
Created by Spiritfarer on 11/8/2023 in #help
❔ How can I add multiple services to my quotations?
I chose to keep the intermediate table and add a custom pricing field because it allows me to set custom prices for each service within a quotation (it's a requirement set by the professor for the assignment (sigh)). Besides, from what I understand, in relational databases, you can't establish many-to-many relationships as such without an intermediate table.
14 replies
CC#
Created by Spiritfarer on 11/8/2023 in #help
❔ How can I add multiple services to my quotations?
These are my entities Quotations: public class Quote { public int Quote_Id { get; set; } public int serial { get; set; } public int User_Id { get; set; } public User User { get; set; } public int Client_Id { get; set; } public Client Client { get; set; } public int Quantity { get; set; } public string Status { get; set; } public int Sub_Total { get; set; } public int Discount { get; set; } public int ITBS { get; set; } public int TotalGrl { get; set; } public List<SerQuo> serQuos { get; set; } } Services: public class Service { public int Service_Id { get; set; } public string Service_Name { get; set; } public string Service_Description { get; set; } public double Service_Price { get; set; } public List<SerQuo> serQuos { get; set; } } public class SerQuo { public int SerQuo_Id { get; set; } public int Quote_Id { get; set; } public Quote Quote { get; set; } public int Service_Id { get; set; } public Service Service { get; set; } }
14 replies