public ActionResult DeleteStatus(int id) { var ShipView = new ShipView(); using (CMS_modelContainer context = new CMS_modelContainer()) { ShipView = context.ShipViews.Where(b => b.Ship_Id == id).FirstOrDefault(); context.ShipViews.Remove(ShipView); context.SaveChanges(); } return(RedirectToAction("Index")); }
public ActionResult EditStatus(EditShipViewModel b) { using (CMS_modelContainer context = new CMS_modelContainer()) { var shipView = context.ShipViews.Single(e => e.Ship_Id == b.Ship_Id); shipView.Ship_Id = b.Ship_Id; shipView.Ship_Place = b.Ship_Place; shipView.Ship_Depart = b.Ship_Depart; shipView.Ship_Arrived = b.Ship_Arrived; shipView.Status = b.Status; context.SaveChanges(); } return(RedirectToAction("Index")); }
public ActionResult Add_New(ShipView svs) { using (CMS_modelContainer context = new CMS_modelContainer()) { var shipView = new ShipView(); shipView.Ship_Place = svs.Ship_Place; shipView.Ship_Depart = svs.Ship_Depart; shipView.Ship_Arrived = svs.Ship_Arrived; shipView.Status = "Pending"; context.ShipViews.Add(shipView); context.SaveChanges(); } return(RedirectToAction("Index")); }