private void add_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { try { conn.OpenConection(); string[] parmnames = { "@op_s", "@begin_date", "@end_date", "@wm_num_of_hours", "@operating_order_type", "@demander_place", "@num_of_detergentss", "@order_id", "@emp_id" }; string[] parmvalues = { service.Text, fromdate.Text, todate.Text, numHoures.Text, opOrderType.Text, demanderPlace.Text, detergentsesQuantity.Text, empId.Text }; SqlDbType[] paradbtype = { SqlDbType.VarChar, SqlDbType.DateTime, SqlDbType.DateTime, SqlDbType.Int, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.Int, SqlDbType.Int }; conn.ShowDataInsertUsingStoredProc("wm_operating_order_Insert", parmnames, parmvalues, paradbtype); conn.CloseConnection(); conn.OpenConection(); dataGridView1.DataSource = conn.ShowDataInGridViewUsingStoredProc("wm_operating_order_Select"); conn.CloseConnection(); clear.Clear(this); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { conn.CloseConnection(); } }
private void add_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { try { conn.OpenConection(); string[] parmnames = { "@cover_name", "@wm_code" }; string[] parmvalues = { coverName.Text, textBox2.Text }; SqlDbType[] paradbtype = { SqlDbType.VarChar, SqlDbType.Int }; conn.ShowDataInsertUsingStoredProc("covers_clothes_Insert", parmnames, parmvalues, paradbtype); conn.CloseConnection(); conn.OpenConection(); dataGridView1.DataSource = conn.ShowDataInGridViewUsingStoredProc("covers_clothes_Select"); conn.CloseConnection(); clear.Clear(this); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { conn.CloseConnection(); } }
private void button1_Click(object sender, EventArgs e) { con.OpenConection(); string[] parmnames = { "@p_number" }; string[] parmvalues = { textBox3.Text }; SqlDbType[] paradbtype = { SqlDbType.Int }; con.ShowDataInsertUsingStoredProc("selecteheartExaminationOrderByPatient", parmnames, parmvalues, paradbtype); con.CloseConnection(); }
private void add_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e) { //try //{ // if (devName.Text != "") // { // con.Open(); // SqlCommand cmd = new SqlCommand("INSERT INTO washing_machine (wm_name, max_temp, wm_type, description, colors, condition) VALUES ('" + devName.Text + "','" + temp.Text + "','" + kind.Text + "','" + descriptions.Text + "','" + colores.Text + "','" + conditions.Text + "')", con); // cmd.ExecuteNonQuery(); // MessageBox.Show("تم الاضافة"); // cmd = new SqlCommand("select wm_code as 'كود الجهاز', wm_name as 'اسم الجهاز', max_temp as ' حرارة الجهاز', wm_type as 'نوع الجهاز', description as 'وصف الجهاز', colors as 'لون الجهاز', condition as 'حالة الجهاز' from washing_machine", con); // SqlDataReader da; // DataTable dt = new DataTable(); // da = cmd.ExecuteReader(); // dt.Load(da); // dataGridView1.DataSource = dt; // da.Close(); // clear(); // } // else MessageBox.Show("الرجاء إدخال البيانات "); //}catch(Exception ex) //{ // MessageBox.Show(ex.Message); //} //finally { con.Close(); } try { conn.OpenConection(); string [] parmnames = { "@WM_Name", "@temp", "@type", "@des", "@colors", "@con" }; string [] parmvalues = { devName.Text, temp.Text, kind.Text, descriptions.Text, colores.Text, conditions.Text }; SqlDbType [] paradbtype = { SqlDbType.VarChar, SqlDbType.Float, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar }; conn.ShowDataInsertUsingStoredProc("washing_machine_insert", parmnames, parmvalues, paradbtype); conn.CloseConnection(); conn.OpenConection(); dataGridView1.DataSource = conn.ShowDataInGridViewUsingStoredProc("washing_machine_select"); conn.CloseConnection(); clear.Clear(this); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { conn.CloseConnection(); } }
private void add_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { // try // { // if (quantity.Text != "" && price.Text != "") // { // con.Open(); // SqlCommand cmd4 = new SqlCommand("insert into detergents(detergent_quantity,price) values('" + quantity.Text + "','" + price.Text + "' )", con); // cmd4.ExecuteNonQuery(); // Utilities.ResetAllControls(this); // cmd4 = new SqlCommand("select detergent_id as 'كود المسحوق' ,detergent_quantity as 'كمية المسحوق',price as 'سعر المسحوق' from detergents", con); // SqlDataReader da; // DataTable dt = new DataTable(); // da = cmd4.ExecuteReader(); // dt.Load(da); // dataGridView1.DataSource = dt; // da.Close(); // clear(); //} // else MessageBox.Show("الرجاء إدخال البيانات "); // } // catch (Exception ex) // { // MessageBox.Show(ex.Message); // } // finally { con.Close(); } try { conn.OpenConection(); string[] parmnames = { "@detName", "@detergent_quantity", "@price" }; string[] parmvalues = { detName.Text, quantity.Text, price.Text }; SqlDbType[] paradbtype = { SqlDbType.VarChar, SqlDbType.Float, SqlDbType.Int }; conn.ShowDataInsertUsingStoredProc("detergents_Insert", parmnames, parmvalues, paradbtype); conn.CloseConnection(); conn.OpenConection(); dataGridView1.DataSource = conn.ShowDataInGridViewUsingStoredProc("detergents_Select"); conn.CloseConnection(); clear.Clear(this); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { conn.CloseConnection(); } }
private void toolStripLabel2_Click(object sender, EventArgs e) { string[] a = { name.Text, website.Text, address.Text, type.Text, natureOfActivity.Text, e_mail.Text, phoneNumber.Text }; string[] b = { "@name", "@website", "@address", "@type", "@natureOfActivity", "@e_mail", "@phoneNumberint" }; SqlDbType[] c = { SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.Int }; conn.OpenConection(); conn.ShowDataInsertUsingStoredProc("supplier_insert", b, a, c); conn.CloseConnection(); conn.OpenConection(); dataGridView1.DataSource = conn.ShowDataInGridViewUsingStoredProc("supplier_Select"); clear.Clear(this); conn.CloseConnection(); }
private void add_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { //try //{ // if (job.Text !="") // { //con.Open(); //SqlCommand cmd4 = new SqlCommand("insert into wm_employees(emplyee_name,wm_name,job,notes,emp_id) values //('" + empName.Text + "','" + textBox1.Text + "','" + job.Text + "','" + notes.Text + "','" + textBox2.Text + "')", con); //cmd4.ExecuteNonQuery(); //cmd4 = new SqlCommand("select wm_employee_id as ' كود عامل المغسلة',emplyee_name as 'اسم العامل ',wm_name as 'اسم المغسلة ',job as 'الوظيفة ',notes as ' ملاحظات',emp_id as 'كود الموظف' from wm_employees", con); //SqlDataReader da; //DataTable dt = new DataTable(); //da = cmd4.ExecuteReader(); //dt.Load(da); //dataGridView1.DataSource = dt; //da.Close(); // } // else MessageBox.Show("الرجاء إدخال البيانات "); //} //catch (Exception ex) //{ // MessageBox.Show(ex.Message); //} //finally { con.Close(); } try { conn.OpenConection(); string[] parmnames = { "@emplyee_name", "@wm_name", "@job", "@notes", "@emp_id" }; string[] parmvalues = { empName.Text, textBox1.Text, job.Text, notes.Text, textBox2.Text }; SqlDbType[] paradbtype = { SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.Int }; conn.ShowDataInsertUsingStoredProc("wm_employees_Insert", parmnames, parmvalues, paradbtype); conn.CloseConnection(); conn.OpenConection(); dataGridView1.DataSource = conn.ShowDataInGridViewUsingStoredProc("wm_employees_Select"); conn.CloseConnection(); clear.Clear(this); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { conn.CloseConnection(); } }
private void add_LinkClicked_1(object sender, LinkLabelLinkClickedEventArgs e) { //try //{ // if (order_id.Text != "" && place.Text != "") // { //con.Open(); //SqlCommand cmd4 = new SqlCommand("insert into WM_coversPrep (order_id,services_name,quantitiy,demander_place,started_date,end_date,wm_employee_id) values('" + order_id.Text + "','" + serv.Text + "','" + quantity.Text + "','" + place.Text + "','" + fromdate.Value.Date.ToString("MM/dd/yyyy") + "','" + todate.Value.Date.ToString("MM/dd/yyyy") + "','" + empId.Text + "')", con); //cmd4.ExecuteNonQuery(); //MessageBox.Show("تم الاضافة "); //cmd4 = new SqlCommand("select order_id as 'رقم الطلب' , services_name as 'الخدمة' , quantitiy as 'الكمية' , demander_place as 'المكان الطالب' , started_date as 'من تاريخ' , end_date as 'الى تاريخ' , wm_employee_id as 'عامل المغسلة' from WM_coversPrep", con); //SqlDataReader da; //DataTable dt = new DataTable(); //da = cmd4.ExecuteReader(); //dt.Load(da); //dataGridView1.DataSource = dt; //da.Close(); //} // else MessageBox.Show("الرجاء إدخال البيانات "); //} //catch (Exception ex) //{ // MessageBox.Show(ex.Message); //} //finally { con.Close(); } try { conn.OpenConection(); string[] parmnames = { "@services_name", "@quantitiy", "@demander_place", "@started_date", "@end_date", "@wm_employee_id" }; string[] parmvalues = { serv.Text, quantity.Text, place.Text, fromdate.Text, todate.Text, empId.Text }; SqlDbType[] paradbtype = { SqlDbType.VarChar, SqlDbType.Int, SqlDbType.VarChar, SqlDbType.DateTime, SqlDbType.DateTime, SqlDbType.Int }; conn.ShowDataInsertUsingStoredProc("WM_coversPrep_Insert", parmnames, parmvalues, paradbtype); conn.CloseConnection(); conn.OpenConection(); dataGridView1.DataSource = conn.ShowDataInGridViewUsingStoredProc("WM_coversPrep_Select"); conn.CloseConnection(); clear.Clear(this); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { conn.CloseConnection(); } }
//كود الاضافة private void toolStripLabel6_Click(object sender, EventArgs e) { string [] a = { "@manager", "@inventoryName", "@place", "@inventoryType", "@emp_id" }; string [] c = { manager.Text, inventoryName.Text, place.Text, inventoryType.Text, employee_id.Text }; SqlDbType[] b = { SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.Int }; conn.OpenConection(); conn.ShowDataInsertUsingStoredProc("Inventory_inventory_insert", a, c, b); conn.CloseConnection(); conn.OpenConection(); dataGridView1.DataSource = conn.ShowDataInGridViewUsingStoredProc("Inventory_inventory_show"); conn.CloseConnection(); clear.Clear(this); MessageBox.Show("تمـــت الإضافة"); }
private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { bool agree; try { con.OpenConection(); if (checkBox1.Checked == true) { agree = true; } else { agree = false; } string[] parmnames = { "@p_number", "@id", "@openingFileDate", "@approvalstate" }; string[] parmvalues = { textBox6.Text, textBox3.Text, dateTimePicker1.Text, agree.ToString() }; SqlDbType[] paradbtype = { SqlDbType.Int, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.Bit }; con.ShowDataInsertUsingStoredProc("[insertHeartExaminationOrder]", parmnames, parmvalues, paradbtype); con.CloseConnection(); con.OpenConection(); dataGridView2.DataSource = con.ShowDataInGridViewUsingStoredProc("[selectalleheartExaminationOrder]"); con.CloseConnection(); clear.Clear(this); } catch (Exception ex) { MessageBox.Show("ادخل البيانات كاملة"); } }
private void toolStripLabel4_Click(object sender, EventArgs e) { string[] a = { "@categoryName", "@cost_price", "@categoryState", "@barcode", "@expiredate", "@description", "@amount", "@inventory_id", "@operation_id" }; string[] c = { categoryName.Text, cost_price.Text, categoryState.Text, barcode.Text, date.Text, description.Text, amount.Text, inventoryid.Text, op_id.Text }; SqlDbType[] b = { SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.Int, SqlDbType.Date, SqlDbType.Text, SqlDbType.Int, SqlDbType.Int, SqlDbType.Int }; conn.OpenConection(); conn.ShowDataInsertUsingStoredProc("category_insert", a, c, b); conn.CloseConnection(); conn.OpenConection(); dataGridView1.DataSource = conn.ShowDataInGridViewUsingStoredProc("category_show"); conn.CloseConnection(); clear.Clear(this); MessageBox.Show("تمـــت الإضافة"); }
private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { try { con.OpenConection(); string[] parmnames = { "@states", "@deviceID", "@types", "@startTime", "@endTime", "@startDate", "@endDate" }; string[] parmvalues = { "", deviceText.Text, comboBox1.Text, textBox2.Text, textBox4.Text, dateTimePicker3.Text, dateTimePicker4.Text }; SqlDbType[] paradbtype = { SqlDbType.VarChar, SqlDbType.Int, SqlDbType.VarChar, SqlDbType.Time, SqlDbType.Time, SqlDbType.VarChar, SqlDbType.VarChar }; con.ShowDataInsertUsingStoredProc("insertHeatrExaminationScheduale", parmnames, parmvalues, paradbtype); con.CloseConnection(); con.OpenConection(); dataGridView2.DataSource = con.ShowDataInGridViewUsingStoredProc("[selectalleheartExaminationSchedual]"); con.CloseConnection(); clear.Clear(this); } catch (Exception ex) { MessageBox.Show("ادخل البيانات كاملة"); } }
private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { try { con.OpenConection(); string[] parmnames = { "@arabicDescribtion", "@latinDescribtion", "@disciplines", "@roomNumber", "@deviceType", "@devicesID", "@film", "@expectedTime", "@deviceState " }; string[] parmvalues = { textBox2.Text, textBox3.Text, textBox4.Text, textBox9.Text, textBox8.Text, textBox6.Text, "", "", "" }; SqlDbType[] paradbtype = { SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.Int, SqlDbType.VarChar, SqlDbType.Int, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, }; con.ShowDataInsertUsingStoredProc("insertHeartExaminationDevices", parmnames, parmvalues, paradbtype); con.CloseConnection(); con.OpenConection(); dataGridView1.DataSource = con.ShowDataInGridViewUsingStoredProc("[selecteheartExaminationDevicesFormLoad]"); con.CloseConnection(); clear.Clear(this); } catch (Exception ex) { MessageBox.Show("ادخل البيانات كاملة"); } }
private void btn_add_Click(object sender, EventArgs e) { try { con.OpenConection(); string[] s = new string[] { "@id_branchd", "@arabic_name", "@english_name", "@describe" }; string[] s2 = new string[] { txtId.Text, txtArbName.Text, txtEngName.Text, txtDescribe.Text }; SqlDbType[] s3 = new SqlDbType[] { SqlDbType.Int, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar }; con.ShowDataInsertUsingStoredProc("DIFFSERV", s, s2, s3); display(); txtId.Text = ""; con.CloseConnection(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btn_add_Click(object sender, EventArgs e) { try { con.OpenConection(); string[] s = new string[] { "@id", "@aname", "ename", "stime", "etime" }; string[] s2 = new string[] { textBox1.Text, textBox2.Text, textBox3.Text, textBox4.Text, textBox5.Text }; SqlDbType[] s3 = new SqlDbType[] { SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.NVarChar, SqlDbType.Time, SqlDbType.Time }; con.ShowDataInsertUsingStoredProc("insertshift", s, s2, s3); display(); textBox1.Text = ""; con.CloseConnection(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { try { con.OpenConection(); string[] parmnames = { "p_number", "@states", "@CSdate", "@approvalDate", "@roomNumber", "@notes" }; string[] parmvalues = { patient_id.Text, comboBox1.Text, textBox4.Text, dateTimePicker3.Text, textBox1.Text, "" }; SqlDbType[] paradbtype = { SqlDbType.Int, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.VarChar, SqlDbType.Int, SqlDbType.VarChar }; con.ShowDataInsertUsingStoredProc("insertHeartcatheterSurgery", parmnames, parmvalues, paradbtype); con.CloseConnection(); con.OpenConection(); dataGridView1.DataSource = con.ShowDataInGridViewUsingStoredProc("[selecteheartCatheterSurgery]"); con.CloseConnection(); clear.Clear(this); } catch (Exception ex) { MessageBox.Show("ادخل البيانات كاملة"); } }