private CountryMasterListVM GetCountryListVM(CountryMasterFilter objFilter) { //Thread.Sleep(1000); //CountryMasterListVM userListVM = null; CommonBL objCommonBL = null; try { objCountryBL = new CountryBL(); objListVM = new CountryMasterListVM(); objCommonBL = new CommonBL(); objFilter.PagingRoute = new PagingRoute() { Action = "Index", Controller = "Country" }; objListVM.lstCountryMaster = objCountryBL.GetData(objFilter); objListVM.lstUserTypes = objCommonBL.GetCodeDetail(new CodeDetailFilter() { CodeTypeId = 1 }); objListVM.QueryBO = objListVM.objFilter = objFilter; return(objListVM); } catch (Exception ex) { throw; } finally { objListVM = null; } }
public ActionResult Action(CountryMasterFilter objFilter, string submit) { CommonBL objCommonBL = null; CountryMaster objCountry = null; try { objDetailsVM = new CountryDetailsVM(); if (submit.ToLower() == "edit") { objCommonBL = new CommonBL(); TempData["CountryFilter"] = objFilter; objCountryBL = new CountryBL(); objDetailsVM = new CountryDetailsVM(); objDetailsVM.CntMstr = objCountryBL.GetData(new CountryMasterFilter() { CountryID = objFilter.CountryID }).FirstOrDefault(); // objDetailsVM.lstUserTypes = objCommonBL.GetCodeDetail(new CodeDetailFilter() { CodeTypeId = 1 }); return(View("Details", objDetailsVM)); } else if (submit.ToLower() == "delete") { objCountryBL = new CountryBL(); objListVM = new CountryMasterListVM(); objCountry = new CountryMaster(objFilter.CountryID); objCountry.ModifiedBy = 1; objCountry.Remark = "Deleted"; objResponse = objCountryBL.SaveCountry(objCountry, "D"); objFilter.CountryID = 0; objListVM = GetCountryListVM(objFilter); objListVM.Toast = WebCommon.SetToast(objResponse); return(View("Index", objListVM)); } } catch (Exception ex) { throw; } finally { objCountryBL = null; objDetailsVM = null; objListVM = null; objCommonBL = null; } return(null); }