public ActionResult DetailsPost(CityDetailsVM objDetailsVM, string Submit) { CommonBL objCommonBL = null; try { if (Submit == "Save") { objCityBL = new CityBL(); objCommonBL = new CommonBL(); objDetailsVM.CityMstr.Status = 1; objResponse = objCityBL.SaveState(objDetailsVM.CityMstr, objDetailsVM.CityMstr.CityID > 0 ? "U" : "C"); objDetailsVM.CntMst = Chikitsa.DataAccessLayer.StateDAL.GetCountry(); // objDetailsVM.lstUserTypes = objCommonBL.GetCodeDetail(new CodeDetailFilter() { CodeTypeId = 1 }); objDetailsVM.Toast = WebCommon.SetToast(objResponse, "City", "Index"); } return(View(objDetailsVM)); } catch (Exception ex) { throw ex; } finally { objCityBL = null; objDetailsVM = null; objCommonBL = null; } }
public ActionResult Action(CityMasterFilter objFilter, string submit) { CommonBL objCommonBL = null; CityMaster objCity = null; try { objDetailsVM = new CityDetailsVM(); if (submit.ToLower() == "edit") { objCommonBL = new CommonBL(); TempData["CountryFilter"] = objFilter; objCityBL = new CityBL(); objDetailsVM = new CityDetailsVM(); objDetailsVM.CityMstr = objCityBL.GetData(new CityMasterFilter() { CityID = 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") { objCityBL = new CityBL(); objListVM = new CityMasterListVM(); objCity = new CityMaster(objFilter.StateID); objCity.ModifiedBy = 1; objCity.Remark = "Deleted"; objResponse = objCityBL.SaveState(objCity, "D"); objFilter.CountryID = 0; objListVM = GetCityListVM(objFilter); objListVM.Toast = WebCommon.SetToast(objResponse); return(View("Index", objListVM)); } } catch (Exception ex) { throw; } finally { objCityBL = null; objDetailsVM = null; objListVM = null; objCommonBL = null; } return(null); }