public ActionResult AcceptOffer(RequestAcceptedCanceled mod) { DBDataContext db = new DBDataContext(); CustomerRequestForService cust = db.CustomerRequestForServices.Where(t => t.ID == int.Parse(mod.customerrequestid)).First(); cust.VendorIDAccepted = int.Parse(mod.vendorid.ToString()); cust.status = UTIL.Conts.Accepted; db.SubmitChanges(); VendorServiceOfferForRequest vs = db.VendorServiceOfferForRequests.Where(t => t.CustomerRequestID == int.Parse(mod.customerrequestid) && t.VendorService.VendorID == int.Parse(mod.vendorid)).First(); vs.Status = UTIL.Conts.Accepted; db.SubmitChanges(); List <VendorServiceOfferForRequest> listoffers = db.VendorServiceOfferForRequests.Where(t => t.CustomerRequestID == int.Parse(mod.customerrequestid) && t.Status == UTIL.Conts.Active).ToList(); foreach (VendorServiceOfferForRequest v in listoffers) { v.Status = UTIL.Conts.Canceled; db.SubmitChanges(); } return(Json(new { Result = true })); }
public ActionResult CancelOffer(RequestAcceptedCanceled mod) { DBDataContext db = new DBDataContext(); VendorServiceOfferForRequest vs = db.VendorServiceOfferForRequests.Where(t => t.CustomerRequestID == int.Parse(mod.customerrequestid) && t.VendorService.VendorID == int.Parse(mod.vendorid)).First(); vs.Status = UTIL.Conts.Canceled; db.SubmitChanges(); return(Json(new { Result = true })); }