Exemplo n.º 1
0
        public async Task UpdateRevenueResource(RevenueSourcesDto input)
        {
            // here aoutomapping can be done;
            var resource = _revenueResourceRepository.FirstOrDefault(input.Id);

            resource.Description = input.Description;
            resource.Code        = input.Code;

            await _revenueResourceRepository.UpdateAsync(resource);
        }
Exemplo n.º 2
0
        public async Task DeleteRefSubRevenueResourceAsync(RevenueSourcesDto input)
        {
            var resource = _refSubRevenueResourceRepository.FirstOrDefault(input.Id);

            if (resource == null)
            {
                throw new UserFriendlyException("Revenue Sub Resource not Found!");
            }

            await _refSubRevenueResourceRepository.DeleteAsync(resource);
        }
Exemplo n.º 3
0
        public async Task <ActionResult> Edit(int id, RevenueSourcesDto input)
        {
            try
            {
                // TODO: Add update logic here
                if (ModelState.IsValid)
                {
                    await _revenueSourceAppService.UpdateRevenueResource(input);

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