public ActionResult Create(VendorProposal vendorproposal)
 {
     if (ModelState.IsValid) {
         vendorproposalRepository.InsertOrUpdate(vendorproposal);
         vendorproposalRepository.Save();
         return RedirectToAction("Index");
     } else {
         return View();
     }
 }
 public void InsertOrUpdate(VendorProposal vendorproposal)
 {
     if (vendorproposal.VendorId == default(int)) {
         // New entity
         context.VendorProposals.Add(vendorproposal);
     } else {
         // Existing entity
         context.Entry(vendorproposal).State = EntityState.Modified;
     }
 }
        public ActionResult Create(VendorProposal vendorproposal)
        {
            if (ModelState.IsValid)
            {
                context.VendorProposals.Add(vendorproposal);
                context.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(vendorproposal);
        }
 public ActionResult Edit(VendorProposal vendorproposal)
 {
     if (ModelState.IsValid)
     {
         //context.Entry(vendorproposal).State = EntityState.Modified;
         context.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(vendorproposal);
 }