public IActionResult Create(ApplicationType obj) { _appTypeRepo.Add(obj); _appTypeRepo.Save(); TempData[WC.Success] = "Action completed successfully"; return(RedirectToAction("Index")); }
public IActionResult Create(ApplicationType obj) { if (ModelState.IsValid) { _appTypeRepo.Add(obj); _appTypeRepo.Save(); return(RedirectToAction("Index")); } return(View(obj)); }
public IActionResult Create(ApplicationType obj) { if (ModelState.IsValid) { _appTypeRepo.Add(obj); _appTypeRepo.Save(); TempData[WebConstants.Success] = "Action Successfull!"; return(RedirectToAction("Index")); } return(View(obj)); }
public IActionResult Create(ApplicationType obj) { if (ModelState.IsValid) { _applicationTypeRepository.Add(obj); _applicationTypeRepository.Save(); TempData[WC.Success] = "Application type created successfully"; return(RedirectToAction("Index")); } TempData[WC.Error] = "Error while creating application type"; return(View(obj)); }
public IActionResult Create(ApplicationType obj) { if (ModelState.IsValid) { _appTypeRepo.Add(obj); _appTypeRepo.Save(); TempData[WC.Success] = "Action completed successfully"; return(RedirectToAction("Index")); } TempData[WC.Error] = "Error"; return(View(obj)); }
public ServiceResultModel <ApplicationType> Add(ApplicationType applicationType) { var res = new ServiceResultModel <ApplicationType> { IsSuccess = false, Errors = new List <string>() }; if (!IsApplicationTypeNameAvailable(applicationType.ApplicationTypeName)) { res.Errors.Add("The Application Type Name is already present"); return(res); } _applicationTypeRepository.Add(applicationType); UnitOfWork.Commit(); res.IsSuccess = true; res.Data = applicationType; ; return(res); }