public JsonResultEntity GetById(int id) { CityBL cityBL = new CityBL(); JsonResultEntity response = new JsonResultEntity(); try { var result = cityBL.GetById(id); if (result.HasWarning()) { response.Message = String.Join(",", result.Warning); return(response); } response.Success = true; response.Data = result.Value; } catch (Exception ex) { response.Message = ex.Message; LoggerHelper.Error(ex); } return(response); }
public PartialViewResult GetCityById(string CityID) { CityModel CM = new CityModel(); tbl_City city; city = CityBL.GetById(CityID); if (city == null) { city = new tbl_City(); } CM.CityID = city.CityID; CM.CityName = city.CityName; return(PartialView("~/Views/City/Partial/_CityDetailsPartial.cshtml", CM)); }