Ejemplo n.º 1
0
 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();
 }
Ejemplo n.º 2
0
        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();
            }
        }