Example #1
0
        private void LoadDepartments()
        {
            cboDepartment.DataSource = null;
            IDepartmentData department = new DepartmentData();

            departments = department.SelectAllDepartments().OrderBy(d => d.DepartmentName).ToList();

            if (departments.Count > 0)
            {
                cboDepartment.DataSource    = departments;
                cboDepartment.DisplayMember = "DepartmentName";
                cboDepartment.ValueMember   = "Id";
                cboDepartment.SelectedIndex = -1;
            }
            lblMessage.Text = "";
        }
Example #2
0
        private void LoadAllDepartments()
        {
            IDepartmentData department = new DepartmentData();

            departments = department.SelectAllDepartments();
            if (departments.Count() > 0)
            {
                cboDepartment.DataSource    = departments;
                cboDepartment.DisplayMember = "DepartmentName";
                cboDepartment.ValueMember   = "Id";
                cboDepartment.SelectedIndex = -1;
                lblDepartments.Text         = $"{departments.Count()} Registered Departments";
            }
            else
            {
                lblDepartments.Text = "No Departments Found.";
            }
        }