public ActionResult MasterPartial(int masterCode) { OtherChargeViewModel otherChargeVM = masterCode == 0 ? new OtherChargeViewModel() : Mapper.Map <OtherCharge, OtherChargeViewModel>(_otherChargeBusiness.GetOtherCharge(masterCode)); otherChargeVM.IsUpdate = masterCode == 0 ? false : true; return(PartialView("_AddOtherCharge", otherChargeVM)); }
public ActionResult CheckOtherChargeCodeExist(OtherChargeViewModel otherChargeVM) { bool exists = _otherChargeBusiness.CheckOtherChargeCodeExist(Mapper.Map <OtherChargeViewModel, OtherCharge>(otherChargeVM)); if (exists) { return(Json("<p><span style='vertical-align: 2px'>OtherCharge already is in use </span> <i class='fa fa-times' style='font-size:19px; color: red'></i></p>", JsonRequestBehavior.AllowGet)); } return(Json(true, JsonRequestBehavior.AllowGet)); }
public string GetOtherCharge(int code) { try { OtherChargeViewModel otherChargeVM = Mapper.Map <OtherCharge, OtherChargeViewModel>(_otherChargeBusiness.GetOtherCharge(code)); return(JsonConvert.SerializeObject(new { Status = "OK", Record = otherChargeVM, Message = "Success" })); } catch (Exception ex) { AppConstMessage cm = _appConstant.GetMessage(ex.Message); return(JsonConvert.SerializeObject(new { Status = "ERROR", Record = "", Message = cm.Message })); } }
public string InsertUpdateOtherCharge(OtherChargeViewModel otherChargeVM) { try { AppUA appUA = Session["AppUA"] as AppUA; otherChargeVM.PSASysCommon = new PSASysCommonViewModel { CreatedBy = appUA.UserName, CreatedDate = _psaSysCommon.GetCurrentDateTime(), UpdatedBy = appUA.UserName, UpdatedDate = _psaSysCommon.GetCurrentDateTime(), }; var result = _otherChargeBusiness.InsertUpdateOtherCharge(Mapper.Map <OtherChargeViewModel, OtherCharge>(otherChargeVM)); return(JsonConvert.SerializeObject(new { Status = "OK", Record = result, Message = "Success" })); } catch (Exception ex) { AppConstMessage cm = _appConstant.GetMessage(ex.Message); return(JsonConvert.SerializeObject(new { Status = "ERROR", Record = "", Message = cm.Message })); } }
//#region OtherChargeSelectList //[AuthSecurityFilter(ProjectObject = "OtherCharge", Mode = "R")] //public ActionResult OtherChargeSelectList(string required) //{ // ViewBag.IsRequired = required; // OtherChargeViewModel otherChargeVM = new OtherChargeViewModel(); // otherChargeVM.OtherChargeSelectList = _otherChargeBusiness.GetOtherChargeForSelectList(); // return PartialView("_OtherChargeSelectList", otherChargeVM); //} //#endregion #region OtherChargeSelectList public ActionResult OtherChargeSelectList(string required, bool?disabled) { ViewBag.IsRequired = required; ViewBag.IsDisabled = disabled; ViewBag.HasAddPermission = false; ViewBag.propertydisable = disabled == null ? false : disabled; AppUA appUA = Session["AppUA"] as AppUA; Permission permission = _psaSysCommon.GetSecurityCode(appUA.UserName, "OtherCharge"); if (permission.SubPermissionList.Count > 0) { if (permission.SubPermissionList.First(s => s.Name == "SelectListAddButton").AccessCode.Contains("R")) { ViewBag.HasAddPermission = true; } } OtherChargeViewModel otherChargeVM = new OtherChargeViewModel(); otherChargeVM.OtherChargeSelectList = _otherChargeBusiness.GetOtherChargeForSelectList(); return(PartialView("_OtherChargeSelectList", otherChargeVM)); }