public async Task LoadShiftComboBoxAsysnc()
        {
            List <Shifts> listShift = await _shiftsRepository.GetList();

            foreach (Shifts item in listShift)
            {
                cbbShift.Items.Add(item.id + "." + item.shiftName);
            }
        }
Exemplo n.º 2
0
        private async void LoadData()
        {
            List <Departments> listDepartments = await _departmentRepository.GetList();

            List <Shifts> listShifts = await _shiftsRepository.GetList();

            List <Attendances> listAttendances = await _attendancesRepository.GetList();

            List <Roles> listRoles = await _rolesRepository.GetList();

            List <Payslips> listPayslips = await _payslipsRepository.GetList();

            List <Users> listUsers = await _usersRepository.GetList();

            switch (flag)
            {
            case 1:
                ucView1.dgvManagement.DataSource = listDepartments;
                break;

            case 2:
                ucView1.dgvManagement.DataSource = listRoles;
                break;

            case 3:
                ucView1.dgvManagement.DataSource = listUsers;
                break;

            case 4:
                ucView1.dgvManagement.DataSource = listShifts;
                break;

            case 5:
                ucView1.dgvManagement.DataSource = listAttendances;
                break;

            case 6:
                ucView1.dgvManagement.DataSource = listPayslips;
                break;

            default:
                break;
            }
        }
Exemplo n.º 3
0
        private async void LoadData()
        {
            try
            {
                List <Departments> listDepartments = await _departmentRepository.GetList();

                List <Shifts> listShifts = await _shiftsRepository.GetList();

                List <Attendances> listAttendances = await _attendancesRepository.GetList();

                List <Roles> listRoles = await _rolesRepository.GetList();

                List <Payslips> listPayslips = await _payslipsRepository.GetList();

                List <Users> listUsers = await _usersRepository.GetList();

                switch (flag)
                {
                case 1:
                    if (listDepartments == null)
                    {
                        return;
                    }
                    ucView1.dgvManagement.DataSource = listDepartments;
                    ucView1.dgvManagement.Columns["shifts"].Visible = false;
                    ucView1.dgvManagement.AutoResizeColumns();
                    ucView1.dgvManagement.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;

                    break;

                case 2:
                    if (listRoles == null)
                    {
                        return;
                    }
                    ucView1.dgvManagement.DataSource = listRoles;
                    ucView1.dgvManagement.AutoResizeColumns();
                    ucView1.dgvManagement.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;

                    break;

                case 3:
                    if (listUsers == null)
                    {
                        return;
                    }
                    ucView1.dgvManagement.DataSource = listUsers;
                    ucView1.dgvManagement.Columns["roles"].Visible       = false;
                    ucView1.dgvManagement.Columns["departments"].Visible = false;
                    ucView1.dgvManagement.Columns["shifts"].Visible      = false;
                    ucView1.dgvManagement.AutoResizeColumns();
                    ucView1.dgvManagement.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
                    break;

                case 4:
                    if (listShifts == null)
                    {
                        return;
                    }
                    ucView1.dgvManagement.DataSource = listShifts;
                    ucView1.dgvManagement.AutoResizeColumns();
                    ucView1.dgvManagement.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
                    break;

                case 5:
                    if (listAttendances == null)
                    {
                        return;
                    }
                    ucView1.dgvManagement.DataSource = listAttendances;
                    ucView1.dgvManagement.AutoResizeColumns();
                    ucView1.dgvManagement.AutoSizeColumnsMode      = DataGridViewAutoSizeColumnsMode.Fill;
                    ucView1.dgvManagement.Columns["users"].Visible = false;

                    break;

                case 6:
                    if (listPayslips == null)
                    {
                        return;
                    }
                    ucView1.dgvManagement.DataSource = listPayslips;
                    ucView1.dgvManagement.AutoResizeColumns();
                    ucView1.dgvManagement.Columns["users"].Visible = false;
                    ucView1.dgvManagement.AutoSizeColumnsMode      = DataGridViewAutoSizeColumnsMode.Fill;

                    break;

                default:
                    break;
                }
            }
            catch (Exception)
            {
            }
        }