public ActionResult AddState(watershed_state data) { if (DAL.VillageDataDal.AddState(data) == true) { ViewData.Add("AddState", "success"); } else { ViewData.Add("AddState", "fail"); } return View(); }
public ActionResult AddState(watershed_state state) { //WaterShed.WaterShedservice.Service1Client service = new WaterShed.WaterShedservice.Service1Client(); String statelist = StateList.GetStateList(); try { return(Json(new { msg = "success ", list = statelist })); } catch (Exception ex) { throw ex; } }
public static bool AddState(watershed_state state) { watershedEntities db = new watershedEntities(); if (null == getStatesByName(state.sname)) { try { db.watershed_state.Add(state); db.SaveChanges(); }catch (DbEntityValidationException ex) { return(false); } return(true); } return(false); }