public virtual async Task <JsonResult> GetSelectorsForOrganization(bool includeDeleted = false)
        {
            var listSelectors = new ListSelectorsForOrganization();

            var listIndustriesRequest = await _crmIndustryService.GetAllIndustriesAsync(includeDeleted);

            var lisEmployeesRequest = await _crmEmployeeService.GetAllEmployeesAsync();


            if (listIndustriesRequest.IsSuccess)
            {
                listSelectors.ListIndustry = listIndustriesRequest.Result.Select(s => new SelectListItem
                {
                    Value = s.Id.ToString(),
                    Text  = s.Name
                });
            }

            if (lisEmployeesRequest.IsSuccess)
            {
                listSelectors.ListEmployees = lisEmployeesRequest.Result.Select(s => new SelectListItem
                {
                    Value = s.Id.ToString(),
                    Text  = s.Interval
                });
            }

            var result = new ResultModel <ListSelectorsForOrganization>
            {
                IsSuccess = true,
                Result    = listSelectors
            };

            return(Json(result, SerializerSettings));
        }
Ejemplo n.º 2
0
 public async Task <JsonResult> GetAllEmployees()
 => await JsonAsync(_employeeService.GetAllEmployeesAsync());