Пример #1
0
 public ActionResult CreateSupplier(Supplier c)
 {
     ViewBag.ActionMethod = "CreateSupplier";
     return CreateCustomerSupplier(c);
 }
Пример #2
0
        public ActionResult EditSupplier(Supplier s)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    customerSupplierRepository.Edit(s);
                    customerSupplierRepository.Save();
                    return Json(new { redirectUrl = Url.Action("Index")});
                }
                catch (Exception ex)
                {
                    ModelState.AddModelError(string.Empty, "Something went wrong. Message: " + ex.Message);
                }
            }
            ViewBag.ActionMethod = "EditSupplier";

            //If we come here, something went wrong. Return it back.        
            return PartialView("_EditAndCreateSupplier", s);
        }
Пример #3
0
 public SupplierViewModel()
 {
     customerSupplier = new Supplier();
     CustomerSupplierBase = new CustomerSupplierBase();
 }