private void SAVE_Click(object sender, EventArgs e) { if (Voucher_ID.Text == "" || Voucher_No.Text == "" || Voucher_Date.Text == "" || Description.Text == "" || Voucher_Name.Text == "" || Amount.Text == "" || Emp_ID.Text == "" || Date.Text == "") { MessageBox.Show("PLZ_FILL_UP_ALL_DATA__!!!"); } else { con.Open(); SqlDataAdapter sda = new SqlDataAdapter("INSERT INTO VOUCHER(Voucher_ID,Voucher_No,Voucher_Date,Description,Voucher_Name,Amount,Emp_ID,Date)VALUES('" + Voucher_ID.Text + "','" + Voucher_No.Text + "','" + Voucher_Date.Text + "','" + Description.Text + "','" + Voucher_Name.Text + "','" + Amount.Text + "','" + Emp_ID.Text + "','" + Date.Text + "')", con); sda.SelectCommand.ExecuteNonQuery(); con.Close(); Voucher_ID.Text = ""; Voucher_No.Text = ""; Voucher_Date.Text = ""; Description.Text = ""; Voucher_Name.Text = ""; Amount.Text = ""; Emp_ID.Text = ""; Date.Text = ""; Voucher_Date.Focus(); MessageBox.Show("SAVED_sUCCESSFULLY!!!"); Add_Voucher_Entry ds = new Add_Voucher_Entry(); this.Dispose(false); ds.Show(); } }
private void CLEAR_Click(object sender, EventArgs e) { //Voucher_ID.Text = ""; Voucher_No.Text = ""; Voucher_Date.Text = ""; Description.Text = ""; Voucher_Name.Text = ""; Amount.Text = ""; Emp_ID.Text = ""; Date.Text = ""; Voucher_Date.Focus(); MessageBox.Show("ALL_CLEARED__"); }