// GET: Admin/PaymentStatus/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var paymentStatu = new PaymentStatusDAL().ViewDetail(id); if (paymentStatu == null) { return(HttpNotFound()); } return(View(paymentStatu)); }
public ActionResult Edit([Bind(Include = "PaymentStatusID,Name,Note,CreateDate,CreateUser,ModifiedDate,ModifiedUser,IsActive")] PaymentStatu paymentStatu) { var UserSession = (UserLogin)Session[TechDeviShopVs002.Common.CommonConstants.USER_SESSION]; if (ModelState.IsValid) { var _dal = new PaymentStatusDAL(); paymentStatu.ModifiedUser = UserSession.UserID; var _result = _dal.Update(paymentStatu); if (_result) { return(RedirectToAction("Index", "PaymentStatus")); } else { ModelState.AddModelError("", "Cập nhật trạng thái thanh toán ko thành công"); } } return(View(paymentStatu)); }