public ActionResult SavePOType(POTypeModel objPOTypeModel) { eTracLoginModel ObjLoginModel = null; ViewBag.AccountSection = true; if (Session["eTrac"] != null) { ObjLoginModel = (eTracLoginModel)(Session["eTrac"]); } try { var savedStatus = _IPOType.SavePOType(objPOTypeModel); if (savedStatus.Result == Result.Completed) { ViewBag.Message = CommonMessage.SaveSuccessMessage(); ViewBag.AlertMessageClass = ObjAlertMessageClass.Success; ModelState.Clear(); } else { ViewBag.Message = CommonMessage.FailureMessage(); ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger;// store the failure message in tempdata to display in view. } return(Json(new { Message = ViewBag.Message, AlertMessageClass = ViewBag.AlertMessageClass }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { ViewBag.Message = ex.Message; ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger; throw ex; } }
public POTypeModel SavePOType(POTypeModel objPOTypeModel) { string action = ""; try { if (objPOTypeModel.POT_Id == 0) { action = "I"; var savePOType = _workorderems.spSetPOType(action, null, objPOTypeModel.POT_POName, objPOTypeModel.POT_IsActive); } else { action = "U"; var savePOType = _workorderems.spSetPOType(action, objPOTypeModel.POT_Id, objPOTypeModel.POT_POName, objPOTypeModel.POT_IsActive); } objPOTypeModel.Result = Result.Completed; } catch (Exception ex) { Exception_B.Exception_B.exceptionHandel_Runtime(ex, "public POTypeModel SavePOType(String Action, int? POT_Id, string POT_POName, bool IsActive)", "Exception While Saving PO Type.", null); throw; } return(objPOTypeModel); }
public ActionResult AddPOType() { try { POTypeModel objPOTypeModel = new POTypeModel(); return(PartialView("AddPOType", objPOTypeModel)); } catch (Exception ex) { ViewBag.Message = ex.Message; ViewBag.AlertMessageClass = ObjAlertMessageClass.Danger; throw ex; } }