Esempio n. 1
0
        /// <summary>
        /// Заповнення таблиці працівників для відображення
        /// </summary>
        private void FillGrid()
        {
            manager = new ContextManager();
            DataGV.Rows.Clear();
            StaffEmployeeLogic employees = new StaffEmployeeLogic(manager);

            DataGV.AutoGenerateColumns = false;
            int enterpriseId;
            int?StructureObjectId = null;

            if (StructureObjectsCB.SelectedIndex > 0)
            {
                StructureObjectId = Convert.ToInt32(StructureObjectsCB.SelectedValue);
            }

            BindingSource bs = new BindingSource();
            StaffEmployeePositionsLogic employeePositions = new StaffEmployeePositionsLogic(manager);

            //bs.DataSource = employees.GetAll(enterpriseId);
            if (StructureObjectId != null)
            {
                bs.DataSource = employeePositions.GetAll(StructureObjectId);
            }
            else
            {
                bs.DataSource = employees.GetAll();
            }

            DataGV.DataSource = bs;

            DataGV.Update();
            DataGV.Refresh();
        }