Пример #1
0
        public async Task <IActionResult> Edit([Bind("ChildId,FirstName,LastName")] Child child)
        {
            if (ModelState.IsValid)
            {
                await _childrenService.UpdateAsync(child);

                return(RedirectToAction(nameof(Index)));
            }
            return(View(child));
        }
        public async Task <IActionResult> Update(UpdateChildrenViewModel vm)
        {
            if (ModelState.IsValid)
            {
                var result = await _services.UpdateAsync(_mapper.Map <ChildrenDTO>(vm));

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

                    return(RedirectToAction("Index", new { id = vm.HashIdEmployee }));
                }
                TempData["ErrorsListConfirmed"] = result.ErrorsList;
            }
            return(View(vm));
        }