private void حفظToolStripMenuItem_Click_1(object sender, EventArgs e) { if (textBox2.Text.Length == 0) { MessageBox.Show("قم بادخال كود الموظف"); } try { string[] s = new string[] { "@x", "@y" }; string[] s2 = new string[] { textBox1.Text, textBox2.Text }; SqlDbType[] s3 = new SqlDbType[] { SqlDbType.VarChar, SqlDbType.Int }; con.ExecuteInsertOrUpdateOrDeleteUsingStoredProc("register_leaving_in", s, s2, s3); // cmd = new SqlCommand("register_leaving_in ", con); // cmd.CommandType = CommandType.StoredProcedure; //cmd.Parameters.AddWithValue("@x", textBox1.Text); //cmd.Parameters.AddWithValue("@y", textBox2.Text); // cmd.ExecuteNonQuery(); if (textBox2.Text.Length != 0) { موافق f = new موافق(); f.Show(); } } catch (Exception ee) { MessageBox.Show(ee.Message); } }
//private void button1_Click(object sender, EventArgs e) //{ // cmd = new SqlCommand("select name as 'الاسم'from employee where emp_id=@x", con); // cmd.Parameters.AddWithValue("@x", textBox1.Text); // SqlDataReader dataReader = cmd.ExecuteReader(); // dataReader.Read(); // textBox2.Text = dataReader[0].ToString(); // dataReader.Close(); //} private void button4_Click(object sender, EventArgs e) { try { if (textBox1.Text.Length == 0) { MessageBox.Show("قم بادخال كود الموظف"); } if (textBox1.Text.Length != 0 & comboBox2.Text.Length == 0) { MessageBox.Show("قم باختيار نوع الاذن"); } string[] s = new string[] { "@x", "@y" }; string[] s2 = new string[] { textBox1.Text, comboBox2.Text }; SqlDbType[] s3 = new SqlDbType[] { SqlDbType.Int, SqlDbType.VarChar }; con.ExecuteInsertOrUpdateOrDeleteUsingStoredProc("reg_permits_in", s, s2, s3); //cmd = new SqlCommand("reg_permits_in", con); //cmd.CommandType = CommandType.StoredProcedure; //cmd.Parameters.AddWithValue("@x", textBox1.Text); //cmd.Parameters.AddWithValue("@y", comboBox2.SelectedItem); //cmd.ExecuteNonQuery(); if (textBox1.Text.Length != 0 & comboBox2.Text.Length != 0) { موافق f = new موافق(); f.Show(); } } catch (Exception ee) { MessageBox.Show(ee.Message); } }
private void button1_Click(object sender, EventArgs e) { try { if (textBox2.Text.Length == 0 && textBox3.Text.Length == 0) { MessageBox.Show("قم بادخال البيانات"); } string[] s = new string[] { "@x", "@y" }; string[] s2 = new string[] { textBox3.Text, textBox2.Text }; SqlDbType[] s3 = new SqlDbType[] { SqlDbType.VarChar, SqlDbType.VarChar }; con.ExecuteInsertOrUpdateOrDeleteUsingStoredProc("reg_method_attending_leaving1", s, s2, s3); //cmd = new MySqlCommand("insert into methods_attending_leaving set attending_method=@x,short_name=@y,attend_method=@z", con); //cmd.Parameters.AddWithValue("@x", textBox3.Text); //cmd.Parameters.AddWithValue("@y", textBox2.Text); //cmd.Parameters.AddWithValue("@z", comboBox1.SelectedItem); //cmd.ExecuteNonQuery(); if (textBox2.Text.Length != 0 && textBox3.Text.Length != 0) { موافق f = new موافق(); f.Show(); } } catch (Exception ee) { MessageBox.Show(ee.Message); } }
private void حفظToolStripMenuItem_Click(object sender, EventArgs e) { try { if (textBox2.Text.Length == 0 & comboBox1.Text.Length == 0 & comboBox2.Text.Length == 0 & comboBox3.Text.Length == 0) { MessageBox.Show("قم بادخال البيانات"); } if (textBox2.Text.Length != 0 & comboBox1.Text.Length == 0 & comboBox2.Text.Length == 0 & comboBox3.Text.Length == 0) { MessageBox.Show("قم بادخال وقت الوردية ونوع الوردية وعدد الورديات"); } string[] s = new string[] { "@x", "@y", "@z", "@m" }; string[] s2 = new string[] { comboBox2.Text, comboBox1.Text, comboBox3.Text, textBox2.Text }; SqlDbType[] s3 = new SqlDbType[] { SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.Int }; con.ExecuteInsertOrUpdateOrDeleteUsingStoredProc("reg_roceasa_in", s, s2, s3); //{ // MessageBox.Show("تم تسجيل وردية لهذا الموظف من قبل"); //} //else //{ // موافق f = new موافق(); // f.Show(); //} //cmd = new SqlCommand("reg_roceasa_in", con); //cmd.CommandType = CommandType.StoredProcedure; //cmd.Parameters.AddWithValue("@x",comboBox2.SelectedItem); //cmd.Parameters.AddWithValue("@y",comboBox1.SelectedItem); //cmd.Parameters.AddWithValue("@z",comboBox3.SelectedItem); //cmd.Parameters.AddWithValue("@m",textBox2.Text); //cmd.ExecuteNonQuery(); if (textBox2.Text.Length != 0 & comboBox1.Text.Length != 0 & comboBox2.Text.Length != 0 & comboBox3.Text.Length != 0) { موافق f = new موافق(); f.Show(); } } catch (Exception ee) { MessageBox.Show(ee.Message); } }