public async Task <IActionResult> Index([Required] string subid)
        {
            var result = await _services.GetAllAsync(subid);

            if (result.IsValid)
            {
                return(View(result.Result));
            }
            TempData["ErrorsList"] = result.ErrorsList;
            return(View());
        }
예제 #2
0
        public async Task <IActionResult> Index([Required] string id)
        {
            var result = await _services.GetAllAsync(id);

            var referenceParent = _referenceParent.GetHashIdEmployee(id, ReferenceParentType.Family);

            if (result.IsValid && referenceParent.IsValid)
            {
                ViewData["HashIdFamily"]   = id;
                ViewData["HashIdEmployee"] = referenceParent.Result;
                return(View(result.Result));
            }
            var errorsList = new List <string>();

            errorsList.AddRange(result.ErrorsList);
            errorsList.AddRange(referenceParent.ErrorsList);
            TempData["ErrorsList"] = errorsList;
            return(View());
        }