private void DetailsButton_Click(object sender, EventArgs e) { Sections grp = new Sections(); Topics top = new Topics(); foreach (DataGridViewRow row in dataGridView1.SelectedRows) { grp.ID = (int)row.Cells[0].Value; grp.GroupSize = (byte)row.Cells[1].Value; grp.Status = row.Cells[2].Value.ToString(); if (row.Cells[4].Value != null) { grp.TopicID = (int)row.Cells[4].Value; top.ID = (int)row.Cells[4].Value; top.Title = row.Cells[5].Value.ToString(); } else { top.ID = 0; grp.TopicID = 0; } grp.SemID = (int)row.Cells[3].Value; } top = DependencyFacade.GetTopicData(top); MoreInfo mri = new MoreInfo(2, grp, top); mri.ShowDialog(); }
private void MySecButton_Click(object sender, EventArgs e) { Sections grp = new Sections(); Topics top = new Topics(); grp = DependencyFacade.GetMySection(LoginPanel.albumNumber); if (grp != null && grp.TopicID != null) { top.ID = (int)grp.TopicID; top = DependencyFacade.GetTopicData(top); } MoreInfo mri = new MoreInfo(1, grp, top); mri.ShowDialog(); }
private void InfoButton_Click(object sender, EventArgs e) { Sections sec = new Sections(); Topics top = new Topics(); foreach (DataGridViewRow row in dataGridView1.SelectedRows) { if (row.Cells[4].Value != null) { top.ID = (int)row.Cells[4].Value; top.Title = row.Cells[5].Value.ToString(); } sec.ID = (int)row.Cells[0].Value; } sec = DependencyFacade.GetSection(sec); top = DependencyFacade.GetTopicData(top); MoreInfo mri = new MoreInfo(0, sec, top); mri.ShowDialog(); }
private void DetailsButton_Click(object sender, EventArgs e) { Topics top = new Topics(); TopicDetails tpd; foreach (DataGridViewRow row in dataGridView1.SelectedRows) { top.ID = (int)row.Cells[0].Value; } top = DependencyFacade.GetTopicData(top); if (top != null) { if (LoginPanel.TeacherID == top.TeacherID) { tpd = new TopicDetails(0, top); } else { tpd = new TopicDetails(2, top); } tpd.ShowDialog(); } }
public TopicDetails(int mode, Topics topic) { if (mode == 0) { opentype = 0; InitializeComponent(); StatusCombobox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; Topics top = DependencyFacade.GetTopicData(topic); if (top != null) { TopicTextbox.Text = top.Title; InfoRichTextbox.Text = top.Description; if (top.Status == "Open") { StatusCombobox.SelectedIndex = 0; } else if (top.Status == "Close") { StatusCombobox.SelectedIndex = 1; } else { StatusCombobox.SelectedIndex = 2; } TeacherTextbox.Text = UserFacade.GetName(top.TeacherID); IDTextbox.Text = top.ID.ToString(); } IDTextbox.Enabled = false; TeacherTextbox.Enabled = false; } else if (mode == 1) { opentype = 1; InitializeComponent(); StatusCombobox.Enabled = false; StatusCombobox.SelectedIndex = 0; IDTextbox.Enabled = false; TeacherTextbox.Text = UserFacade.GetName(LoginPanel.TeacherID); TeacherTextbox.Enabled = false; } else if (mode == 2) { opentype = 0; InitializeComponent(); StatusCombobox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; Topics top = DependencyFacade.GetTopicData(topic); if (top != null) { TopicTextbox.Text = top.Title; InfoRichTextbox.Text = top.Description; if (top.Status == "Open") { StatusCombobox.SelectedIndex = 0; } else if (top.Status == "Close") { StatusCombobox.SelectedIndex = 1; } else { StatusCombobox.SelectedIndex = 2; } TeacherTextbox.Text = UserFacade.GetName(top.TeacherID); IDTextbox.Text = top.ID.ToString(); } TopicTextbox.Enabled = false; InfoRichTextbox.Enabled = false; TeacherTextbox.Enabled = false; IDTextbox.Enabled = false; StatusCombobox.Enabled = false; } }