Exemple #1
0
        public async Task <IActionResult> Update([FromBody] UpdateCulturalViewModel vm)
        {
            var result = await _services.UpdateAsync(_mapper.Map <DirectoryDTO>(vm));

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

                return(NoContent());
            }
            return(BadRequest(result.ErrorsList));
        }
        public async Task <IActionResult> UpdateConfirmed(UpdateCulturalViewModel vm)
        {
            if (ModelState.IsValid)
            {
                var result = await _services.UpdateAsync(_mapper.Map <DirectoryDTO>(vm));

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

                    return(RedirectToAction("Index"));
                }
                TempData["ErrorsListConfirmed"] = result.ErrorsList;
            }
            return(View(vm));
        }
Exemple #3
0
        public async Task <IActionResult> UpdateConfirmed(CulturalViewModel vm)
        {
            if (ModelState.IsValid)
            {
                if (vm.HashId == null)
                {
                    return(NotFound());
                }
                var result = await _services.UpdateAsync(_mapper.Map <DirectoryDTO>(vm));

                return(result.IsValid
                    ? RedirectToAction("Index")
                    : _oops.OutPutError("Cultural", "Index", result.ErrorsList));
            }
            return(View(vm));
        }