public ActionResult DeleteConfirmed(int id) { tblTransitStationMaster tbltransitstationmaster = db.tblTransitStationMasters.Find(id); db.tblTransitStationMasters.Remove(tbltransitstationmaster); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /TransitStationMaster/Delete/5 public ActionResult Delete(int id = 0) { tblTransitStationMaster tbltransitstationmaster = db.tblTransitStationMasters.Find(id); if (tbltransitstationmaster == null) { return(HttpNotFound()); } return(View(tbltransitstationmaster)); }
public ActionResult Edit(tblTransitStationMaster tbltransitstationmaster) { if (ModelState.IsValid) { db.Entry(tbltransitstationmaster).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tbltransitstationmaster)); }
public ActionResult Create(tblTransitStationMaster tbltransitstationmaster) { if (ModelState.IsValid) { db.tblTransitStationMasters.Add(tbltransitstationmaster); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(tbltransitstationmaster)); }
public ActionResult DeleteConfirmed(int id) { tblTransitStationMaster t = (from c in db.tblTransitStationMasters where c.ID == id select c).FirstOrDefault(); if (t == null) { return(HttpNotFound()); } else { db.tblTransitStationMasters.Remove(t); db.SaveChanges(); TempData["SuccessMsg"] = "You have successfully Deleted Transit Station."; return(RedirectToAction("Index")); } return(View()); }
public ActionResult Create(TransitStationVM v) { tblTransitStationMaster t = new tblTransitStationMaster(); if (ModelState.IsValid) { t.Name = v.Name; t.CountryID = v.CountryID; t.IsActive = v.IsActive; db.tblTransitStationMasters.Add(t); db.SaveChanges(); TempData["SuccessMsg"] = "You have successfully added Transit Station."; return(RedirectToAction("Index")); } return(View()); }
public ActionResult Edit(int id) { tblTransitStationMaster t = (from c in db.tblTransitStationMasters where c.ID == id select c).First(); TransitStationVM v = new TransitStationVM(); ViewBag.Country = db.CountryMasters.ToList(); if (t == null) { return(HttpNotFound()); } else { v.ID = t.ID; v.Name = t.Name; v.CountryID = t.CountryID.Value; v.IsActive = t.IsActive.Value; } return(View(v)); }
public ActionResult Edit(TransitStationVM v) { tblTransitStationMaster t = new tblTransitStationMaster(); if (ModelState.IsValid) { t.ID = v.ID; t.Name = v.Name; t.CountryID = v.CountryID; t.IsActive = v.IsActive; db.Entry(t).State = EntityState.Modified; db.SaveChanges(); TempData["SuccessMsg"] = "You have successfully Updated Transit Station."; return(RedirectToAction("Index")); } return(View(v)); }