private void button1_Click(object sender, EventArgs e) { if (MessageBox.Show("Are you sure !! You want to Confirm this Order !!", "Medical system", MessageBoxButtons.OKCancel) == DialogResult.OK) { if (gvsales.Rows.Count == 0) { MessageBox.Show("Enter Some Item First !!"); } else { SDT = SAdapter.SelectBy_PNAME(txtpname.Text); for (int i = 0; i < SDT.Rows.Count; i++) { int sout = SOutAdapter.Insert(txtpname.Text, SDT.Rows[i]["IName"].ToString(), Convert.ToInt32(SDT.Rows[i]["Quantity"].ToString()), Convert.ToDouble(SDT.Rows[i]["Price"].ToString()), Convert.ToDouble(SDT.Rows[i]["TPrice"].ToString()), 0, System.DateTime.Now.Date); StockAdapter.StockMst_SELL_Update_Quantity(Convert.ToInt32(SDT.Rows[i]["Quantity"].ToString()), Convert.ToDouble(SDT.Rows[i]["TPrice"].ToString()), SDT.Rows[i]["IName"].ToString()); } int del = SAdapter.Delete(); MessageBox.Show("Your Order has been Submitted !!", "Medical System"); gvsales.DataSource = null; } gpdispatch.Visible = false; } }
private void button2_Click(object sender, EventArgs e) { if (MessageBox.Show("Are you sure !! You want to Cancel this Order !!", "Medical system", MessageBoxButtons.OKCancel) == DialogResult.OK) { int del = SAdapter.Delete(); gpdispatch.Visible = false; } }
private void SELL_Load(object sender, EventArgs e) { int del = SAdapter.Delete(); SqlConnection con = new SqlConnection("Data Source='.\\SQLEXPRESS';Integrated Security='true';Initial Catalog='MEDICAL'"); SqlCommand cmd = new SqlCommand("SELECT I_name FROM StockInMst", con); con.Open(); SqlDataReader reader = cmd.ExecuteReader(); AutoCompleteStringCollection SCollection = new AutoCompleteStringCollection(); while (reader.Read()) { SCollection.Add(reader.GetString(0)); } txtiname.AutoCompleteCustomSource = SCollection; con.Close(); CDT = CAdapter.SelectClient(); comboBox1.DataSource = CDT; comboBox1.DisplayMember = "cu_name"; comboBox1.ValueMember = "cu_id"; }