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