Beispiel #1
0
 private void label17_Click(object sender, EventArgs e)
 {
     if (textBox2.Text == "" || textBox5.Text == "" || textBox4.Text == "" || textBox3.Text == "" || textBox1.Text == "")
     {
         MessageBox.Show("بعض الخانات مفقودة !");
         return;
     }
     try {
         sqlCon.OpenConection();
         String[]    a = { "@name", "@unit", "@quantity", "@accepted", "@refused", "@ex" };
         String[]    b = { textBox1.Text, textBox5.Text, textBox2.Text, textBox3.Text, textBox4.Text, ex_no };
         SqlDbType[] c = { SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.Int, SqlDbType.Int, SqlDbType.Int, SqlDbType.Int };
         sqlCon.ExecuteInsertOrUpdateOrDeleteUsingStoredProc("add_class", a, b, c);
         this.Hide();
     }
     catch (Exception ex) { MessageBox.Show(ex.Message); }
     finally { sqlCon.CloseConnection(); }
     x.generate_reports();
 }
Beispiel #2
0
        private void label17_Click(object sender, EventArgs e)
        {
            if (comboBox1.SelectedValue == null || textBox1.Text == "")
            {
                MessageBox.Show("بعض الخانات مفقودة !");
                return;
            }

            try
            {
                sqlCon.OpenConection();
                String[]    a = { "@code1", "@missions1", "@head1", "@ex" };
                String[]    b = { textBox1.Text, textBox1.Text, (Convert.ToInt32(checkBox1.Checked)).ToString(), ex_no };
                SqlDbType[] c = { SqlDbType.Int, SqlDbType.NVarChar, SqlDbType.Bit, SqlDbType.Int };
                sqlCon.ExecuteInsertOrUpdateOrDeleteUsingStoredProc("Add_commity", a, b, c);
                this.Hide();
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }
            finally { sqlCon.CloseConnection(); }
            x.generate_reports();
        }