private void btnAddInvoice_Click(object sender, EventArgs e) { //sırasıyla methodları cagırıyorum ve ekliyorum.Her ihtimale karsı transaction kullandım herhangi bir hatada rolback edilsin db bozulmasın diye.. System.Data.Entity.DbContextTransaction tran = db.Database.BeginTransaction(); try { InvoiceSave(); InvoiceDetailSave(); tran.Commit(); FormInvoiceDetails frm = new FormInvoiceDetails(Convert.ToInt32(lblInvoiceNo.Text)); frm.Show(); } catch (Exception) { tran.Rollback(); MessageBox.Show("Delivery Note is not nul !!"); } }
private void ınvoiceViewQueryEditToolStripMenuItem_Click(object sender, EventArgs e) { FormInvoiceDetails frm = new FormInvoiceDetails(); frm.Show(); }