Exemple #1
0
        public async Task <IActionResult> RestructuringConfirmed(RestructuringViewModel vm)
        {
            if (ModelState.IsValid)
            {
                var result = await _services.RestructuringUnits(_mapper.Map <SubdivisionDTO>(vm));

                return(result.IsValid
                    ? RedirectToAction("Index")
                    : _oops.OutPutError("Subdivision", "Index", result.ErrorsList));
            }
            return(View(vm));
        }
        public async Task <IActionResult> RestructuringUnits([FromBody] RestructuringViewModel vm)
        {
            var result = await _services.RestructuringUnits(_mapper.Map <RestructuringSubdivisionDTO>(vm));

            if (result.IsValid)
            {
                await _systemAuditService.AuditAsync(User.GetEmail(), _accessor.GetIp(), Operations.Update, Tables.Subdivisions);

                return(NoContent());
            }
            return(BadRequest(result.ErrorsList));
        }
Exemple #3
0
        public async Task <IActionResult> RestructuringConfirmed(RestructuringViewModel vm)
        {
            if (ModelState.IsValid)
            {
                var result = await _services.RestructuringUnits(_mapper.Map <RestructuringSubdivisionDTO>(vm));

                if (result.IsValid)
                {
                    await _systemAuditService.AuditAsync(User.GetEmail(), _accessor.GetIp(), Operations.Update, Tables.Subdivisions);

                    return(RedirectToAction("Index"));
                }
                TempData["ErrorsListConfirmed"] = result.ErrorsList;
            }
            return(View(vm));
        }