예제 #1
0
 public ActionResult _Edit(string id)
 {
     if (string.IsNullOrEmpty(id))
     {
         return(HttpNotFound());
     }
     else
     {
         SCMSupplierPlant SCMSupplierPlant = base.genericMgr.FindById <SCMSupplierPlant>(id);
         return(PartialView(SCMSupplierPlant));
     }
 }
예제 #2
0
 public ActionResult _Edit(SCMSupplierPlant SCMSupplierPlant)
 {
     try
     {
         base.genericMgr.Update(SCMSupplierPlant);
         SaveSuccessMessage(Resources.SCM.SCMSupplierPlant.SCMSupplierPlant_Updated);
         return(RedirectToAction("List"));
     }
     catch (BusinessException ex)
     {
         SaveBusinessExceptionMessage(ex);
     }
     catch (Exception ex)
     {
         SaveErrorMessage(ex);
     }
     return(RedirectToAction("_Edit/" + SCMSupplierPlant.Code));
 }
예제 #3
0
        public ActionResult New(SCMSupplierPlant SCMSupplierPlant)
        {
            if (ModelState.IsValid)
            {
                if (base.genericMgr.FindAll <long>(duiplicateVerifyStatement, new object[] { SCMSupplierPlant.Code })[0] > 0)
                {
                    SaveErrorMessage(Resources.ErrorMessage.Errors_Existing_Code, SCMSupplierPlant.Code);
                }
                else
                {
                    base.genericMgr.Create(SCMSupplierPlant);
                    SaveSuccessMessage(Resources.SCM.SCMSupplierPlant.SCMSupplierPlant_Added);
                    return(RedirectToAction("_Edit/" + SCMSupplierPlant.Code));
                }
            }

            return(View(SCMSupplierPlant));
        }