private void buttonUpdate_Click(object sender, EventArgs e) { string query = "update firoz_center.tbl_vehicle set engine_no='" + this.textBoxEngine.Text + "', chasis_no='" + this.textBoxChassis.Text + "' where vehicleId='" + this.vehicleId + "' and invoice_no='" + this.invoice + "' and engine_no='" + this.engine + "' and chasis_no='" + this.chassis + "';"; this.dbc.Update(query); MessageBox.Show("Update Completed"); EditPurchaseMotorCycle cycle = new EditPurchaseMotorCycle(this.invoice); cycle.Show(); cycle.do_it(); base.Close(); }
private void buttondelete_Click(object sender, EventArgs e) { string query = "Delete from firoz_center.tbl_vehicle where vehicleid = '" + this.vehicleId + "' and engine_no='" + this.engine + "' and chasis_no='" + this.chassis + "';"; this.dbc.Delete(query); long num = long.Parse(this.total) - long.Parse(this.purchase_rate); query = string.Concat(new object[] { "update firoz_center.tbl_purchase set grand_total='", num, "', net_amount='", num, "' where invoice_no='", this.invoice, "';" }); this.dbc.Update(query); query = string.Concat(new object[] { "update firoz_center.tbl_transcation set credit='", num, "' where invoice_no='", this.invoice, "';" }); this.dbc.Update(query); MessageBox.Show("Delete Completed"); EditPurchaseMotorCycle cycle = new EditPurchaseMotorCycle(this.invoice); cycle.Show(); cycle.do_it(); base.Close(); }