public IActionResult Create(AccountView accountView, IFormFile inputphoto) { accountView.DayCreate = DateTime.Now; accountView.DayEdited = DateTime.Now; accountView.Status = true; string FileNameSave = "dui.jpg"; if (inputphoto != null) { FileNameSave = FileACE.SaveFile(webHostEnvironment, inputphoto, "admin/image"); } accountView.Images = FileNameSave; int id = (int)CheckError.ErrorOrther; if (ModelState.IsValid) { id = accountRepository.CreateACE(accountView); } switch (id) { case (int)CheckError.AlreadyEmail: ViewBag.Result = CheckError.AlreadyEmail; break; case (int)CheckError.AlreadyPhone: ViewBag.Result = CheckError.AlreadyPhone; break; case (int)CheckError.ErrorOrther: ViewBag.Result = CheckError.ErrorOrther; break; default: return(RedirectToAction("index")); } ViewBag.StationList = stationRepository.GetDataACE(); return(View(accountView)); }