public ActionResult DeleteConfirmed(int id) { OrdersInfors ordersInfors = db.OrdersInfors.Find(id); db.OrdersInfors.Remove(ordersInfors); db.SaveChanges(); return(RedirectToAction("Index")); }
// GET: OrdersInfors/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } OrdersInfors ordersInfors = db.OrdersInfors.Find(id); if (ordersInfors == null) { return(HttpNotFound()); } return(View(ordersInfors)); }
public ActionResult Create([Bind(Exclude = "StatusChangedDate")] OrdersInfors ordersInfors , [Bind(Prefix = "StatusChangedDate.CheckDateTime")] Models.DateTimeViewModel MdDate ) { if (ModelState.IsValid) { ordersInfors.StatusChangedDate = new DateTime(MdDate.Year, MdDate.Month, MdDate.Day); db.OrdersInfors.Add(ordersInfors); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(ordersInfors)); }
public ActionResult Edit([Bind(Exclude = "StatusChangedDate")] OrdersInfors ordersInfors , [Bind(Prefix = "StatusChangedDate.CheckDateTime")] Models.DateTimeViewModel MdDate , FormCollection fcs) { /*[Bind(Include = "ID,UserName,OrderNumber,CreateDate,Status,StatusChangedDate,CheckedUserName",Prefix ="StatusChangedDate")] */ var objForm = fcs; if (ModelState.IsValid) { ordersInfors.StatusChangedDate = new DateTime(MdDate.Year, MdDate.Month, MdDate.Day); db.Entry(ordersInfors).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(ordersInfors)); }