コード例 #1
0
        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());
            }
        }
コード例 #2
0
        public ActionResult Edit(TaiKhoanModel taiKhoanModel)
        {
            try
            {
                // TODO: Add update logic here
                var model = _taiKhoanRepository.UpdateTaiKhoan(taiKhoanModel);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }