// GET: Admin/OrderStatus/Edit/5 public ActionResult Edit(byte?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var orderStatu = new OrderStatusDAL().ViewDetail(id); if (orderStatu == null) { return(HttpNotFound()); } return(View(orderStatu)); }
public ActionResult Edit([Bind(Include = "OrderStatusID,OrderStatusName,Description,DisplayOrder,CreateDate,CreateUser,ModifiedDate,ModifiedUser,IsActive")] OrderStatu orderStatu) { var UserSession = (UserLogin)Session[TechDeviShopVs002.Common.CommonConstants.USER_SESSION]; if (ModelState.IsValid) { var _dal = new OrderStatusDAL(); orderStatu.ModifiedUser = UserSession.UserID; var _result = _dal.Update(orderStatu); if (_result) { return(RedirectToAction("Index", "OrderStatus")); } else { ModelState.AddModelError("", "Cập nhật trạng thái hóa đơn ko thành công"); } } return(View(orderStatu)); }