public async Task <IActionResult> CreateNew()
 {
     try
     {
         EmployeeDto dto = new EmployeeDto();
         ViewBag.Roles = _viewbagConvert.ConvertToSelectList(await Helper.GetRolesAPICall(_config.GetValue <string>("RolesAPI")));
         return(View(dto));
     }
     catch (Exception Ex)
     { throw; }
 }
Beispiel #2
0
 public async Task <IActionResult> CreateNew(int Id)
 {
     try
     {
         EmployeeTaskCollection dto = new EmployeeTaskCollection();
         dto.TaskId        = Id;
         ViewBag.Employees = _viewbagConvert.ConvertToSelectList(await Helper.GetEmployeesAPICall(_config.GetValue <string>("EmployeesAPI")));
         return(View(dto));
     }
     catch (Exception Ex)
     { throw; }
 }
        public async Task <IActionResult> CreateNew()
        {
            try
            {
                HourDto dto       = new HourDto();
                var     employees = new List <SelectListItem>();
                employees.Add(new SelectListItem()
                {
                    Text = "Select Employee", Selected = true, Value = "-1"
                });

                employees.AddRange(_viewbagConvert.ConvertToSelectList(await Helper.GetEmployeesAPICall(_config.GetValue <string>("EmployeesAPI"))));

                ViewBag.Employees = employees;
                return(View(dto));
            }
            catch (Exception Ex)
            { throw; }
        }