예제 #1
0
 public ActionResult Create(int vendorId)
 {
     VendorInsurance vendorinsurance = new VendorInsurance();
     vendorinsurance.VendorID = vendorId;
     ViewBag.PossibleVendorInsuranceCategories = vendorinsurancecategoryRepository.All;
     return View(vendorinsurance);
 }
예제 #2
0
 public ActionResult Create(VendorInsurance vendorinsurance,int vendorId)
 {
     if (ModelState.IsValid) {
         vendorinsuranceRepository.InsertOrUpdate(vendorinsurance);
         vendorinsuranceRepository.Save();
         return RedirectToAction("Index",new { vendorId=vendorId });
     } else {
         ViewBag.PossibleVendorInsuranceCategories = vendorinsurancecategoryRepository.All;
         return View(vendorinsurance);
     }
 }
예제 #3
0
 public ViewResult Search(VendorInsurance searchVendorInsurance,int vendorId)
 {
     if(searchVendorInsurance!=null)
     {
                     }
                 return View("Index",vendorinsuranceRepository.AllIncluding(vendorId,vendorinsurance => vendorinsurance.Vendor, vendorinsurance => vendorinsurance.VendorInsuranceCategory));
 }
예제 #4
0
 public void InsertOrUpdate(VendorInsurance vendorinsurance)
 {
     if (vendorinsurance.VendorInsuranceID == default(int)) {
         // New entity
         context.VendorInsurance.Add(vendorinsurance);
     } else {
         // Existing entity
         context.Entry(vendorinsurance).State = EntityState.Modified;
     }
 }