private void Form1_Load(object sender, EventArgs e) { el = new EmployeeList(); departments = new DepartmentList(); departments = departments.GetAll(); phoneTypes = new PhoneTypeList(); phoneTypes = phoneTypes.GetAll(); emailTypes = new EmailTypeList(); emailTypes = emailTypes.GetAll(); HobbyList hobbyList; hobbyList = new HobbyList(); hobbyList.GetAll(); LoadHobbies(hobbyList); dgvFamily.DataError += DgvFamily_DataError; dgvFamily.CellFormatting += DgvFamily_CellFormatting; dgvEmployee.CellFormatting += DgvEmployee_CellFormatting; dgvEmployeePhones.CellFormatting += DgvEmployeePhones_CellFormatting; dgvEmployeeEmail.CellFormatting += DgvEmployeeEmail_CellFormatting; dgvEmployeePhones.DataError += DgvEmployeePhones_DataError; dgvEmployeeEmail.DataError += DgvEmployeeEmail_DataError; dgvEmployee.DataError += DgvEmployee_DataError; dgvEmployee.AutoGenerateColumns = false; dgvSubordinate.AutoGenerateColumns = false; dgvSubordinate.CellFormatting += DgvSubordinate_CellFormatting; dgvSubordinate.DataError += DgvSubordinate_DataError; dgvFamily.AutoGenerateColumns = false; dgvEmployeePhones.AutoGenerateColumns = false; dgvEmployeeEmail.AutoGenerateColumns = false; el.Savable += El_Savable; mnuSave.Enabled = false; dgvEmployee.RowHeaderMouseDoubleClick += DgvEmployee_RowHeaderMouseDoubleClick; dgvSubordinate.RowHeaderMouseDoubleClick += DgvSubordinate_RowHeaderMouseDoubleClick; }
private void btnGet_Click(object sender, EventArgs e) { EmailTypes = EmailTypes.GetAll(); this.dgvEmailType.DataSource = EmailTypes.List; }