public async Task <ActionResult> Create(CreateRevenueSourcesInput input)
        {
            if (ModelState.IsValid)
            {
                await _revenueSourceAppService.CreateRevenueResource(input);

                return(RedirectToAction("Index"));
            }
            else
            {
                return(View(input));
            }
        }
        public async Task CreateRevenueResource(CreateRevenueSourcesInput input)
        {
            var Exist = _revenueResourceRepository.FirstOrDefault(p => p.Description == input.Description);

            if (Exist == null)
            {
                var resource = new RevenueSource {
                    Code        = input.Code,
                    Description = input.Description
                };
                await _revenueResourceRepository.InsertAsync(resource);
            }
            else
            {
                throw new UserFriendlyException("There is already a Revenue Resource with given name");
            }
        }
Exemple #3
0
 public Task CreateRevenueResource(CreateRevenueSourcesInput input)
 {
     throw new NotImplementedException();
 }