public JsonResult ShowCity() { BL_City city = new BL_City(); return(new JsonResult { Data = city.SelectAllCity(), JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }
public JsonResult DatatableBind(string prefix) { Obj_Model.StoreAllCity = new DataSet(); Obj_Model.StoreAllCity = Obj_City.SelectAllCity(); List <City> serch = new List <City>(); if (Obj_Model.StoreAllCity.Tables.Count != null) { foreach (DataRow dr in Obj_Model.StoreAllCity.Tables[0].Rows) { serch.Add(new City { CityID = Convert.ToInt32(dr["CityID"]), CityName = dr["CityName"].ToString(), ReferenceCode = dr["ReferenceCode"].ToString(), }); } } return(new JsonResult { Data = serch, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }