void Clear_All_ClassManagement() { NewClass_textbox.Clear(); NewClassSem_combobox.SelectedIndex = 0; NewBranch_textbox.Clear(); UpdateBranch_combobox.SelectedIndex = 0; Semester_combobox.SelectedIndex = 0; Course_textbox.Clear(); Examcode_textbox.Clear(); ACode_textbox.Clear(); }
private void AddNewCourse_btn_Click(object sender, EventArgs e) { msgbox.show("Click Yes to Add New Course ", "Confirm", CustomMessageBox.MessageBoxButtons.YesNo, CustomMessageBox.MessageBoxIcon.Warning); var result = msgbox.ReturnValue; try { if (result == "Yes") { if (UpdateBranch_combobox.SelectedIndex != 0 && Semester_combobox.SelectedIndex != 0 && Course_textbox.Text != "" && Examcode_textbox.Text != "" && ACode_textbox.Text != "") { SQLiteCommand comm = new SQLiteCommand("Select Default_Scheme from Management where (Default_Scheme is not null)", con.ActiveCon()); string scheme = (string)comm.ExecuteScalar(); SQLiteCommand command = new SQLiteCommand("insert into Scheme(Scheme,Branch,Semester,Course,Sub_Code,Acode)Values(" + " @Scheme,@Branch,@Semester,@Course,@Sub_Code,@Acode) ", con.ActiveCon()); command.Parameters.AddWithValue("@Scheme", scheme); command.Parameters.AddWithValue("@Branch", UpdateBranch_combobox.Text); command.Parameters.AddWithValue("@Semester", Semester_combobox.Text); command.Parameters.AddWithValue("@Course", Course_textbox.Text); command.Parameters.AddWithValue("@Sub_Code", Examcode_textbox.Text); command.Parameters.AddWithValue("@Acode", ACode_textbox.Text); command.ExecuteNonQuery(); Branch_dgv_Fill(); Course_textbox.Clear(); Examcode_textbox.Clear(); ACode_textbox.Clear(); NewcourseFilter(); msgbox.show("New Course Added ", "Success", CustomMessageBox.MessageBoxButtons.OK, CustomMessageBox.MessageBoxIcon.Information); } else { msgbox.show("Fill Necessary Details. ", "Error", CustomMessageBox.MessageBoxButtons.OK, CustomMessageBox.MessageBoxIcon.Error); } } } catch (Exception ex) { MessageBox.Show(ex.ToString()); } finally { con.CloseCon(); } }
public override void InputFormFields() { if (Data.Course != null) { Course_textbox.SendKeys(Data.Course); } if (Data.Department != null) { Department_dropdown.SelectByText(Data.Department); } if (Data.GradeLow != null) { GradeFromSelect.Wait(5); GradeFromSelect.Wait(5).SelectByText(Data.GradeLow); } if (Data.GradeHigh != null) { GradeToSelect.Wait(5); GradeToSelect.Wait(5).SelectByText(Data.GradeHigh); } if (Data.LimitBySchools != null) { if (Data.LimitBySchools == "1") { ClickLimitBySchools(); } } if (Data.AddSelected != null) { if (Data.AddSelected == "1") { ClickAddSelected(); } } if (Data.RemoveSelected != null) { if (Data.RemoveSelected == "1") { ClickRemoveSelected(); } } //if (Data.AssignedCourseName != null) //{ // if (Data.AssignedCourseName.Equals("1")) // { // SelectCourseName(AssignedCourseName_chkbox, true); // } //} //if (Data.AvailableCourseName != null) //{ // if (Data.AvailableCourseName.Equals("1")) // { // SelectCourseName(AvailableCourseName_chkbox, true); // } //} //if (Data.AssignedCourseName != null) //{ // if (Data.CourseName.Equals("1")) // { // SelectCourseName(AssignedCourseName_chkbox, true); // } //} }