public ActionResult Detail(TaiKhoanModel taiKhoanModel) { try { if (ModelState.IsValid) { var model = _taiKhoanRepo.UpdateTaiKhoan(taiKhoanModel); if (model.CheckStatus()) { return(RedirectToAction("Detail")); } } else { var model = _taiKhoanRepo.getTaiKhoanInfo(taiKhoanModel.TenTaiKhoan); ModelState.AddModelError("", "Update Failed"); return(View(model.Data.FirstOrDefault())); } return(View()); } catch { return(View()); } }
public ActionResult Edit(TaiKhoanModel taiKhoanModel) { try { // TODO: Add update logic here var model = _taiKhoanRepository.UpdateTaiKhoan(taiKhoanModel); return(RedirectToAction("Index")); } catch { return(View()); } }