protected override async Task OnInitializedAsync()
        {
            Employee = await EmployeeDataService.GetEmployeeDetails(int.Parse(Id));

            Department = (await DepartmentDataService.GetDepartmentById(Employee.DepartmentId)).Name;
            MapMarkers = new List <Marker>
            {
                new Marker {
                    Description = $"{Employee.FirstName} {Employee.LastName}", ShowPopup = false, X = 53.5357812, Y = -2.2339628
                }
            };
        }
Exemplo n.º 2
0
        protected override async Task OnInitializedAsync()
        {
            Saved       = false;
            Departments = (await DepartmentDataService.GetAllDepartments()).ToList();
            int.TryParse(Id, out var employeeId);

            if (employeeId == 0) //new employee is being created
            {
                //add some defaults
                Employee = new Employee {
                    DepartmentId = 1, BirthDate = DateTime.Now, JoinedDate = DateTime.Now
                };
            }
            else
            {
                Employee = await EmployeeDataService.GetEmployeeDetails(int.Parse(Id));
            }
            DepartmentId = Employee.DepartmentId.ToString();
        }
Exemplo n.º 3
0
 protected override async Task OnInitializedAsync()
 {
     Employees   = (await EmployeeDataService.GetAllEmployees()).ToList();
     Departments = (await DepartmentDataService.GetAllDepartments()).ToList();
 }