public ActionResult CreateSupplier(Supplier c)
 {
     ViewBag.ActionMethod = "CreateSupplier";
     return CreateCustomerSupplier(c);
 }
        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);
        }
 public SupplierViewModel()
 {
     customerSupplier = new Supplier();
     CustomerSupplierBase = new CustomerSupplierBase();
 }