private void CreateDiscipline_Save_Btn_Click(object sender, EventArgs e) { String name = CreateDiscipline_DisciplineName_txt.Text; String session = CreateDiscipline_AcademicSession_txt.Text; String code = CreateDiscipline_DisciplineCode_txt.Text; if (name.Equals("") || session.Equals("") || code.Equals("")) { return; } try { bool flag = controller.DExists(); if (flag == false) { controller.saveDiscipline(name, session, code); MessageBox.Show("Discipline Saved !"); CreateDiscipline_DisciplineName_txt.Text = ""; CreateDiscipline_AcademicSession_txt.Text = ""; CreateDiscipline_DisciplineCode_txt.Text = ""; } else { MessageBox.Show("One Discipline has already been created"); CreateDiscipline_DisciplineName_txt.Text = ""; CreateDiscipline_AcademicSession_txt.Text = ""; CreateDiscipline_DisciplineCode_txt.Text = ""; } }catch (Exception) {} }
private void AddCourse_Save_Btn_Click(object sender, EventArgs e) { DisciplineController disc = new DisciplineController(); bool f = disc.DExists(); if (f == true) { String code = AddCourse_CourseCode_txt.Text; String hour = AddCourse_CreditHours_txt.Text; String title = AddCourse_CourseName_txt.Text; if (code.Equals("") || hour.Equals("") || title.Equals("")) { return; } if (!AddCourse_Sessional_RadioBtn.Checked && !AddCourse_Theory_RadioBtn.Checked) { return; } bool flag = controller.CExists(code); if (flag == false) { if (AddCourse_Theory_RadioBtn.Checked) { controller.saveCourse(code, hour, title, ""); } if (AddCourse_Sessional_RadioBtn.Checked) { controller.saveCourse(code, hour, title, "yes"); } MessageBox.Show("Course Saved"); AddCourse_CourseCode_txt.Text = ""; AddCourse_CourseName_txt.Text = ""; AddCourse_CreditHours_txt.Text = ""; } else { MessageBox.Show("Course Already Exists"); } } else { MessageBox.Show("You have not created any Discipline yet !!!", "Warning", MessageBoxButtons.OK); AddCourse_CourseCode_txt.Text = ""; AddCourse_CourseName_txt.Text = ""; AddCourse_CreditHours_txt.Text = ""; } }
private void AddBatch_Save_Btn_Click(object sender, EventArgs e) { String name = AddBatch_Batch_Txt.Text; String term = AddBatch_Term_ComboBox.Text; String rollFrom = AddBatch_RollFrom_Txt.Text; String rollTo = AddBatch_RollTo_Txt.Text; if (name.Equals("") || term.Equals("") || rollFrom.Equals("") || rollTo.Equals("")) { return; } DisciplineController disc = new DisciplineController(); bool f = disc.DExists(); if (f == true) { bool flag = bController.BExist(name); if (flag == false) { bController.saveBatch(name, term, rollFrom, rollTo); MessageBox.Show("Batch Inserted !"); AddBatch_Batch_Txt.Text = ""; AddBatch_Term_ComboBox.Text = ""; AddBatch_RollFrom_Txt.Text = ""; AddBatch_RollTo_Txt.Text = ""; } else { MessageBox.Show("Batch Name Already Exists ! Plz Retry with another Batch Name"); } } else { MessageBox.Show("You have not created any Discipline yet !!!", "Warning", MessageBoxButtons.OK); AddBatch_Batch_Txt.Text = ""; AddBatch_Term_ComboBox.Text = ""; AddBatch_RollFrom_Txt.Text = ""; AddBatch_RollTo_Txt.Text = ""; } }