public ActionResult DeleteConfirmed(int id) { MasterCity masterCity = db.MasterCities.Find(id); db.MasterCities.Remove(masterCity); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult DeleteConfirmed(int id) { MasterCity masterCity = store.AdminMgr.GetMasterCity(id); if (store.AdminMgr.RemoveMasterCity(masterCity)) { return(RedirectToAction("Index")); } return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Name")] MasterCity masterCity) { if (ModelState.IsValid) { db.Entry(masterCity).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(masterCity)); }
public bool RemoveMasterCity(MasterCity masterCity) { try { return(adminDb.RemoveMasterCity(masterCity)); } catch { return(false); } }
public bool EditMasterCity(MasterCity masterCity) { try { return(adminDb.EditMasterCity(masterCity)); } catch { return(false); } }
public ActionResult Edit([Bind(Include = "Id,Name")] MasterCity masterCity) { if (ModelState.IsValid) { if (store.AdminMgr.EditMasterCity(masterCity)) { return(RedirectToAction("Index")); } } return(View(masterCity)); }
public ActionResult Create([Bind(Include = "Id,Name")] MasterCity masterCity) { if (ModelState.IsValid) { db.MasterCities.Add(masterCity); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(masterCity)); }
public bool RemoveMasterCity(MasterCity masterCity) { try { db.MasterCities.Remove(masterCity); db.SaveChanges(); return(true); } catch { return(false); } }
public bool EditMasterCity(MasterCity masterCity) { try { db.Entry(masterCity).State = EntityState.Modified; db.SaveChanges(); return(true); } catch { return(false); } }
// GET: Admin/MasterCities/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MasterCity masterCity = store.AdminMgr.GetMasterCity((int)id); if (masterCity == null) { return(HttpNotFound()); } return(View(masterCity)); }
// GET: Admin/MasterCities/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } MasterCity masterCity = db.MasterCities.Find(id); if (masterCity == null) { return(HttpNotFound()); } return(View(masterCity)); }
public List <MasterCity> GetCity(MasterCity masterCity) { return(new ITCircleDAO.ApplicationDAO().GetCity(masterCity)); }