public ActionResult generateQuotation(pquotation c) { pquotation p = db.pquotations.Where(x => x.quotationId == c.quotationId).FirstOrDefault(); pquotation a = new pquotation(); a.productId = c.productId; a.availability = c.availability; a.category = c.category; a.color = c.color; a.description = c.description; a.name = c.name; product d = db.products.Where(x => x.productId == c.productId).FirstOrDefault(); a.vendorId = d.userId; a.quantity = c.quantity; a.userId = Session["userid"].ToString(); a.status = "pending"; a.vendorStatus = "pending"; db.pquotations.Remove(db.pquotations.Where(x => x.productId == d.productId).FirstOrDefault()); db.pquotations.Add(a); db.SaveChanges(); return(View("quotationRequested")); }
public ActionResult vendorQuotation(pquotation c) { pquotation p = db.pquotations.Where(x => x.quotationId == c.quotationId).FirstOrDefault(); pquotation a = new pquotation(); var p1 = db.products.Where(x => x.productId == c.productId).FirstOrDefault(); a.availability = p.availability; a.productId = p.productId; a.category = p.category; a.color = p.color; a.description = p.description; a.name = p.name; var d = db.products.Where(x => x.productId == a.productId).FirstOrDefault(); a.userId = p.userId; a.quantity = 2; a.vendorId = Session["userid"].ToString(); a.status = "pending"; a.quotation = c.quotation; a.vendorStatus = "accept"; db.pquotations.Remove(db.pquotations.Where(x => x.productId == p.productId).FirstOrDefault()); db.pquotations.Add(a); db.SaveChanges(); return(View("quotationSubmitted")); }
public ActionResult approveQuotation(int id) { pquotation c = db.pquotations.Where(a => a.quotationId == id).FirstOrDefault(); if (c.vendorStatus == "pending") { return(View("quotationStatusPending")); } else { return(RedirectToAction("Agreement", c)); } }
public ActionResult generateQuotation(int id) { pquotation a = new pquotation(); a.productId = id; var p = db.products.Where(x => x.productId == id).FirstOrDefault(); a.description = p.description; a.name = p.name; a.category = p.category; a.color = p.color; a.productId = id; a.availability = p.availability; a.vendorId = p.userId; a.quantity = 1; a.userId = Session["userid"].ToString(); a.status = "pending"; a.vendorStatus = "pending"; db.pquotations.Add(a); db.SaveChanges(); return(View(a)); }
public ActionResult Agreement(pquotation p) { return(View(p)); }