Example #1
0
        public JsonResultEntity GetById(int id)
        {
            CountryBL        countryBL = new CountryBL();
            JsonResultEntity response  = new JsonResultEntity();

            try
            {
                var result = countryBL.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 GetCountryById(int CountryID)
        {
            CountryModel CM = new CountryModel();
            tbl_Country  Country;

            Country = CountryBL.GetById(CountryID);

            if (Country == null)
            {
                Country = new tbl_Country();
            }
            CM.CountryID   = Country.CountryID;
            CM.CountryName = Country.CountryName;

            return(PartialView("~/Views/Country/Partial/_CountryDetailsPartial.cshtml", CM));
        }