public ActionResult LawGuideView(string prm = "") { HomeLawGuideViewModel objHomeLawGuideViewModel = new HomeLawGuideViewModel(); //if prm(Paramter) is empty means Add condition else edit condition if (!String.IsNullOrEmpty(prm)) { int LawGuideId; //decrypt parameter and set in CategoryId variable int.TryParse(CommonUtils.Decrypt(prm), out LawGuideId); //Get Category detail by Category Id serviceResponse = objUtilityWeb.GetAsync(WebApiURL.Home + "/GetLawGuideList?CategoryId=" + LawGuideId.ToString()); objHomeLawGuideViewModel = serviceResponse.StatusCode == HttpStatusCode.OK ? serviceResponse.Content.ReadAsAsync <HomeLawGuideViewModel>().Result : null; objHomeLawGuideViewModel.SelectedLawGuideId = LawGuideId; } return(View(objHomeLawGuideViewModel)); }
public ActionResult SaveLawGuide(string prm = "") { LawGuideModel objLawGuideModel = new LawGuideModel(); try { //if prm(Paramter) is empty means Add condition else edit condition if (!String.IsNullOrEmpty(prm)) { int LawGuideId; //decrypt parameter and set in LawGuideId variable int.TryParse(CommonUtils.Decrypt(prm), out LawGuideId); //Get LawGuide detail by LawGuide Id serviceResponse = objUtilityWeb.GetAsync(WebApiURL.LawGuide + "/GetLawGuideById?LawGuideId=" + LawGuideId.ToString()); objLawGuideModel = serviceResponse.StatusCode == HttpStatusCode.OK ? serviceResponse.Content.ReadAsAsync <LawGuideModel>().Result : null; } SubCatDropDown(objLawGuideModel.SubCategoryID, null, null); } catch (Exception ex) { ErrorLog(ex, "LawGuide", "SaveLawGuide Get"); } return(View("SaveLawGuide", objLawGuideModel)); }