private StateMasterListVM GetStateListVM(StateMasterFilter objFilter) { //Thread.Sleep(1000); //CountryMasterListVM userListVM = null; CommonBL objCommonBL = null; try { objStateBL = new StateBL(); objListVM = new StateMasterListVM(); objCommonBL = new CommonBL(); objFilter.PagingRoute = new PagingRoute() { Action = "Index", Controller = "State" }; objListVM.lstStateMaster = objStateBL.GetData(objFilter); //objDetailsVM.CntMst = Chikitsa.DataAccessLayer.StateDAL.GetCountry(); //objCommonBL.GetCodeDetail(new CodeDetailFilter() { CodeTypeId = 1 }); objListVM.QueryBO = objListVM.objFilter = objFilter; return(objListVM); } catch (Exception ex) { throw; } finally { objListVM = 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); }