private void button1_Click(object sender, EventArgs e) { try { if (Validation()) { if (IfIdExists(textBox2.Text, textBox1.Text)) { MessageBox.Show("Already selected Id or Name...!!!...Take a new Id...!!!", "Polkotuwa Stores"); } else { DialogResult dr = MessageBox.Show("Are you sure want to Add", "Polkotuwa Stores", MessageBoxButtons.YesNo); if (dr == DialogResult.Yes) { con2.dataSend2("insert into [dbo].[Stock] (Item_Id,Item_Name,Item_Price,Item_Quantity) values('" + textBox1.Text.ToString() + "','" + textBox2.Text + "','" + textBox3.Text.ToString() + "','" + textBox4.Text.ToString() + "')"); MessageBox.Show("Record Added Successfully....!!!", "Polkotuwa Stores", MessageBoxButtons.OK, MessageBoxIcon.Information); ClearData(); } } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnUpdate_Click(object sender, EventArgs e) { try { DialogResult dr = MessageBox.Show("Are you sure want to Update", "Polkotuwa Stores", MessageBoxButtons.YesNo); if (dr == DialogResult.Yes) { con2.dataSend2("UPDATE [dbo].[Employee_Register] SET SupID ='" + txtID.Text + "', SupName ='" + txtName.Text + "', SupNum ='" + txtConNum.Text + "', SupAdd ='" + txtAdd.Text + "' where SupIDId='" + txtID.Text + "'"); MessageBox.Show("Record Updated Successfully....!!!", "Polkotuwa Stores", MessageBoxButtons.OK, MessageBoxIcon.Information); ClearData(); } disp_data(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void button3_Click(object sender, EventArgs e) { try { con2.dataSend2("insert into [dbo].[Billing_Details] (Customer_Name,Date,Sub_Total,Discount,Net_Total,Paid,Balance) values ('" + textBox11.Text.ToString() + "','" + dateTimePicker1.Value.ToString("dd-MM-yyyy") + "','" + textBox4.Text.ToString() + "','" + textBox5.Text.ToString() + "','" + textBox6.Text.ToString() + "','" + textBox7.Text.ToString() + "','" + textBox9.Text.ToString() + "')"); MessageBox.Show("Record Saved Successfully....!!!", "Polkotuwa Stores", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void btnAdd_Click(object sender, EventArgs e) { try { if (Validation()) { DialogResult dr = MessageBox.Show("Are you sure want to Save Record", "Polkotuwa Stores", MessageBoxButtons.YesNo); if (dr == DialogResult.Yes) { Connection2 con2 = new Connection2(); con2.dataSend2("insert into [dbo].[SupDetails] (SupID,SupName,SupNum,SupAdd) values('" + txtID.Text.ToString() + "', '" + txtName.Text.ToString() + "', '" + txtConNum.Text.ToString() + "', '" + txtAdd.Text.ToString() + "')"); MessageBox.Show("Record Saved Successfully....!!!", "Polkotuwa Stores", MessageBoxButtons.OK, MessageBoxIcon.Information); ClearData(); } disp_data(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }