Inheritance: System.Windows.Forms.Form
Esempio n. 1
0
        private void dgvClass_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                #region Groups Button
                if (e.ColumnIndex == 8 && e.RowIndex >= 0 && e.RowIndex < dgvClass.RowCount - 1)
                {
                    AddGroupsForm agForm = new AddGroupsForm();
                    agForm.Text = "Add Groups To Class";
                    agForm.Interface_TextBox = (DataGridViewTextBoxCell)dgvClass[9, e.RowIndex];
                    agForm.ShowDialog();
                }
                #endregion

                #region Professor Button
                if (e.ColumnIndex == 1 && e.RowIndex >= 0 && e.RowIndex < dgvClass.RowCount - 1)
                {
                    AddProfessorsForm apForm = new AddProfessorsForm(int.Parse(dgvClass[0, e.RowIndex].Value.ToString()));
                    apForm.Text     = "Add Professors To Class";
                    apForm.Location = new Point((this.Location.X + dgvClass.Columns[0].Width + 25),
                                                (this.Location.Y + 100));
                    apForm.Interface_TextBox = (DataGridViewTextBoxCell)dgvClass[2, e.RowIndex];
                    apForm.ShowDialog();
                }
                #endregion
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }
        private void dgvClass_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                #region Groups Button
                if (e.ColumnIndex == 8 && e.RowIndex >= 0 && e.RowIndex < dgvClass.RowCount - 1)
                {
                    AddGroupsForm agForm = new AddGroupsForm();
                    agForm.Text = "Add Groups To Class";
                    agForm.Interface_TextBox = (DataGridViewTextBoxCell)dgvClass[9, e.RowIndex];
                    agForm.ShowDialog();
                }
                #endregion

                #region Professor Button
                if (e.ColumnIndex == 1 && e.RowIndex >= 0 && e.RowIndex < dgvClass.RowCount - 1)
                {
                    AddProfessorsForm apForm = new AddProfessorsForm(int.Parse(dgvClass[0, e.RowIndex].Value.ToString()));
                    apForm.Text = "Add Professors To Class";
                    apForm.Location = new Point((this.Location.X + dgvClass.Columns[0].Width + 25),
                                                (this.Location.Y + 100));
                    apForm.Interface_TextBox = (DataGridViewTextBoxCell)dgvClass[2, e.RowIndex];
                    apForm.ShowDialog();
                }
                #endregion
            }
            catch (Exception ex) { MessageBox.Show(ex.Message, ex.Source); }
        }