public static watershed_city getCity(watershed_city city) { watershedEntities db = new watershedEntities(); try { return((from u in db.watershed_city where u.cname == city.cname && u.sid == city.sid select u).SingleOrDefault()); } catch (DbEntityValidationException ex) { return(null); } }
public ActionResult AddCity(watershed_city data) { if (DAL.VillageDataDal.AddCity(data) == true) { ViewData.Add("AddCity", "success"); } else { ViewData.Add("AddCity", "fail"); } return View(); }
public ActionResult GetTalukaList(watershed_city city) { //WaterShed.WaterShedservice.Service1Client service = new WaterShed.WaterShedservice.Service1Client(); String citylist = StateList.GetTalukaList(city.cid); try { return(Json(new { msg = "success ", list = citylist })); } catch (Exception ex) { throw ex; } }
public static bool AddCity(watershed_city city) { watershedEntities db = new watershedEntities(); if (null == getCity(city)) { try { db.watershed_city.Add(city); db.SaveChanges(); } catch (DbEntityValidationException ex) { return(false); } return(true); } return(false); }