Esempio n. 1
0
        // 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));
        }
Esempio n. 2
0
        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));
        }