Ejemplo n.º 1
0
 public ActionResult New(Supplier supplier)
 {
     if (ModelState.IsValid)
     {
         //判断描述不能重复
         if (base.genericMgr.FindAll<long>(selectCountSupplierStatement, new object[] { supplier.Code })[0] > 0)
         {
             base.SaveErrorMessage(Resources.MD.Party.Party_Supplier_Errors_Existing_Code, supplier.Code);
         }
         else if (base.genericMgr.FindAll<long>(selectCountCustomerStatement, new object[] { supplier.Code })[0] > 0)
         {
             base.SaveErrorMessage(Resources.MD.Party.Party_Errors_Exists_Code_UserdByCustomer, supplier.Code);
         }
         else if (base.genericMgr.FindAll<long>(selectCountRegionStatement, new object[] { supplier.Code })[0] > 0)
         {
             base.SaveErrorMessage(Resources.MD.Party.Party_Errors_Exists_Code_UserdByRegion, supplier.Code);
         }
         else
         {
             partyMgr.Create(supplier);
             SaveSuccessMessage(Resources.MD.Party.Party_Supplier_Added);
             return RedirectToAction("Edit/" + supplier.Code);
         }
     }
     return View(supplier);
 }
Ejemplo n.º 2
0
        public ActionResult _Edit(Supplier supplier)
        {

            if (ModelState.IsValid)
            {
                //if (string.IsNullOrWhiteSpace(supplier.PurchaseGroup))
                //{
                //    SaveErrorMessage("采购组不能为空。");
                //}
                //else
                //{
                    genericMgr.Update(supplier);
                    SaveSuccessMessage(Resources.MD.Party.Party_Supplier_Updated);
                //}
            }

            TempData["TabIndex"] = 0;
            return new RedirectToRouteResult(new RouteValueDictionary  
                                                   { 
                                                       { "action", "_Edit" }, 
                                                       { "controller", "Supplier" } ,
                                                       { "Id", supplier.Code }
                                                   });
        }
Ejemplo n.º 3
0
        public ActionResult _Edit(Supplier supplier)
        {

            if (ModelState.IsValid)
            {
                base.genericMgr.Update(supplier);
                SaveSuccessMessage(Resources.MD.Party.Party_Supplier_Updated);
            }

            TempData["TabIndex"] = 0;
            return new RedirectToRouteResult(new RouteValueDictionary  
                                                   { 
                                                       { "action", "_Edit" }, 
                                                       { "controller", "Supplier" } ,
                                                       { "Id", supplier.Code }
                                                   });
        }
Ejemplo n.º 4
0
 public ActionResult New(Supplier supplier)
 {
     if (ModelState.IsValid)
     {
         //判断描述不能重复
         if (this.genericMgr.FindAll<long>(CodeDuiplicateVerifyStatement, new object[] { supplier.Code })[0] > 0)
         {
             base.SaveErrorMessage(Resources.MD.Party.Party_Supplier_Errors_Existing_Code, supplier.Code);
         }
         else
         {
             //if (string.IsNullOrWhiteSpace(supplier.PurchaseGroup))
             //{
             //    SaveErrorMessage("采购组不能为空。");
             //}
             //else
             //{
                 partyMgr.Create(supplier);
                 SaveSuccessMessage(Resources.MD.Party.Party_Supplier_Added);
                 return RedirectToAction("Edit/" + supplier.Code);
             //}
         }
     }
     return View(supplier);
 }