Esempio n. 1
0
 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));
 }
Esempio n. 3
0
 public IActionResult Create(ApplicationType obj)
 {
     if (ModelState.IsValid)
     {
         _appTypeRepo.Add(obj);
         _appTypeRepo.Save();
         TempData[WebConstants.Success] = "Action Successfull!";
         return(RedirectToAction("Index"));
     }
     return(View(obj));
 }
Esempio n. 4
0
 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));
 }
Esempio n. 5
0
        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);
        }