public int ReturnRealtorIDOnCase(int ID) { using (var database = new EstateBrokerContext()) { Database.Case tempCase = database.Cases.Find(ID); return(tempCase.RealtorID); } }
public bool UpdateCase(int ID, DateTime creationDate, DateTime?closedDate, double price, int realtorID) { try { using (var database = new EstateBrokerContext()) { Database.Case workingCase = database.Cases.Find(ID); workingCase.CreationDate = creationDate; workingCase.ClosedDate = closedDate; workingCase.Price = price; workingCase.RealtorID = realtorID; database.SaveChanges(); } return(true); } catch { return(false); } }