public ActionResult DetailsPost(StateDetailsVM objDetailsVM, string Submit) { CommonBL objCommonBL = null; try { if (Submit == "Save") { objStateBL = new StateBL(); objCommonBL = new CommonBL(); objDetailsVM.StateMstr.Status = 1; objResponse = objStateBL.SaveState(objDetailsVM.StateMstr, objDetailsVM.StateMstr.StateID > 0 ? "U" : "C"); objDetailsVM.CntMst = Chikitsa.DataAccessLayer.StateDAL.GetCountry(); // objDetailsVM.lstUserTypes = objCommonBL.GetCodeDetail(new CodeDetailFilter() { CodeTypeId = 1 }); objDetailsVM.Toast = WebCommon.SetToast(objResponse, "State", "Index"); } return(View(objDetailsVM)); } catch (Exception ex) { throw ex; } finally { objStateBL = null; objDetailsVM = null; objCommonBL = null; } }
public ActionResult Action(StateMasterFilter objFilter, string submit) { CommonBL objCommonBL = null; StateMaster objState = null; try { objDetailsVM = new StateDetailsVM(); if (submit.ToLower() == "edit") { objCommonBL = new CommonBL(); TempData["CountryFilter"] = objFilter; objStateBL = new StateBL(); objDetailsVM = new StateDetailsVM(); objDetailsVM.StateMstr = objStateBL.GetData(new StateMasterFilter() { StateID = objFilter.StateID }).FirstOrDefault(); objDetailsVM.CntMst = Chikitsa.DataAccessLayer.StateDAL.GetCountry(); // objDetailsVM.lstUserTypes = objCommonBL.GetCodeDetail(new CodeDetailFilter() { CodeTypeId = 1 }); return(View("Details", objDetailsVM)); } else if (submit.ToLower() == "delete") { objStateBL = new StateBL(); objListVM = new StateMasterListVM(); objState = new StateMaster(objFilter.StateID); objState.ModifiedBy = 1; objState.Remark = "Deleted"; objResponse = objStateBL.SaveState(objState, "D"); objFilter.CountryID = 0; objListVM = GetStateListVM(objFilter); objListVM.Toast = WebCommon.SetToast(objResponse); return(View("Index", objListVM)); } } catch (Exception ex) { throw; } finally { objStateBL = null; objDetailsVM = null; objListVM = null; objCommonBL = null; } return(null); }
// GET: User public ActionResult Details() { CommonBL objCommonBL = null; try { objDetailsVM = new StateDetailsVM(); objCommonBL = new CommonBL(); objDetailsVM.CntMst = Chikitsa.DataAccessLayer.StateDAL.GetCountry(); return(View(objDetailsVM)); } catch (Exception ex) { throw; } finally { objCommonBL = null; } }