public void CreateNewRepair(string description, string purchaseOrder, string quoteNumber, Nullable <DateTime> dueDate, int customerID) { //Convert incomming due date to utc and store it. if (dueDate != null) { dueDate = DateTime.SpecifyKind((DateTime)dueDate, DateTimeKind.Local); } else { dueDate = DateTime.Now.ToUniversalTime(); } Repair repair = new Repair(); repair.Description = description; repair.PurchaseOrder = purchaseOrder; repair.QuoteNumber = quoteNumber; repair.Completed = false; repair.DueDate = dueDate.Value.ToUniversalTime(); repair.CustomerID = customerID; using (AHDBContext myContext = new AHDBContext()) { myContext.spInsertRepair(repair.Description, repair.PurchaseOrder, repair.QuoteNumber, repair.DueDate, repair.CustomerID); myContext.SaveChanges(); } }
public void AssignVendorToRepair(int repairID, int vendorID) { using (AHDBContext myContext = new AHDBContext()) { myContext.spInsertVendorRepair(repairID, vendorID); myContext.SaveChanges(); } }
public void CreateNewVendor(string description, string companyName) { using (AHDBContext myContext = new AHDBContext()) { myContext.spInsertVendor(description, companyName); myContext.SaveChanges(); } }