public async Task <IActionResult> Details(ChildrenDetailViewModel formData)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    await _childrenServices.UpdateChildrenAsync(new EmployeeChildren
                    {
                        DateTimeModified = DateTimeOffset.Now,
                        EmployeeId       = formData.EmployeeId,
                        Name             = formData.Name,
                        DateOfBirth      = DateTime.Parse(formData.BirthDate),
                        Gender           = formData.Gender,
                        BirthOrderID     = formData.BirthOrderId,
                        UserAccount      = User.Identity.Name,
                        //BirthCertificateImage = await Base64StringHandler.GetFormFileBase64StringAsync(formData.BirthCertificateImg),
                        Id = formData.Id
                    });

                    TempData["Message"] = "Changes saved successfully";
                    _logger.LogInformation($"Success: successfully updated employee child record by user={@User.Identity.Name.Substring(4)}");
                    return(RedirectToAction("details", new { id = formData.Id }));
                }
            }
            catch (ApplicationException error)
            {
                _logger.LogError(
                    error,
                    $"FAIL: failed to update employee child details {formData.Name}. Internal Application Error.; user={@User.Identity.Name.Substring(4)}");
                ModelState.AddModelError("Children", $"Failed to update employee child record. {formData.Name} Contact IT ServiceDesk for support thank you.");
            }
            await LoadSelectListsAsync();

            return(View(formData));
        }
        public async Task <IActionResult> Details(Guid id)
        {
            var childrenQuery = await _childrenServices.GetChildrenById(id);

            if (childrenQuery == null)
            {
                return(NotFound());
            }

            var model = new ChildrenDetailViewModel
            {
                Id           = childrenQuery.Id,
                EmployeeId   = childrenQuery.EmployeeId ?? Guid.Empty,
                Name         = childrenQuery.Name,
                BirthOrderId = childrenQuery.BirthOrderID,
                Gender       = childrenQuery.Gender,
                // BirthCertificateImage = childrenQuery.BirthCertificateImage,
                BirthDate = childrenQuery.DateOfBirth == null ? string.Empty : DateTime.Parse(childrenQuery.DateOfBirth.ToString()).ToString("yyyy-MM-dd")
            };

            await LoadSelectListsAsync();

            return(View(model));
        }