public ActionResult Edit(CostCenter costCenter) { try { if (ModelState.IsValid) { this.genericMgr.UpdateWithTrim(costCenter); SaveSuccessMessage(Resources.CUST.CostCenter.CostCenter_Updated); } } catch (Exception ex) { SaveErrorMessage(ex); } return View(costCenter); }
public ActionResult New(CostCenter costCenter) { try { if (ModelState.IsValid) { this.genericMgr.CreateWithTrim(costCenter); SaveSuccessMessage(Resources.CUST.CostCenter.CostCenter_Added); string Code = costCenter.Code; return new RedirectToRouteResult(new RouteValueDictionary { { "action", "Edit" }, { "controller", "CostCenter" }, { "Code", Code } }); } } catch (Exception e) { SaveErrorMessage(e); } return View(costCenter); }