private void btnPyNew_Click(object sender, EventArgs e) { var editor = new PaymentsView(); editor.Invoicedetail = this; editor.ShowObject(null); editor.ShowDialog(); }
public void OpenSelected() { if (_paymentRecord != null) { var paymentdetail = new PaymentsView(); paymentdetail.ShowObject(_paymentRecord); paymentdetail.Dock = DockStyle.Fill; paymentdetail.ShowDialog(); } }
private void btnPyNew_Click(object sender, EventArgs e) { var paymenteditor = new PaymentsView(); var pmt = new PaymentRecord(); paymenteditor.ShowObject(pmt); paymenteditor.InvoiceTotal = GetInvoiceTotal(); paymenteditor.PaymentTotal = GetPaymentTotal(); var result = paymenteditor.ShowDialog(); if (result == DialogResult.OK) { _invoice.PaymentRecord.Add(paymenteditor.CurrentObject); } }
private void gridControl2_DoubleClick(object sender, EventArgs e) { var selectedpayment = paymentbindingSource.Current as PaymentRecord; var editpayment = new PaymentsView(); //var pay = _context.PaymentRecords.FirstOrDefault(pr => pr.PaymentId == selectedpayment.PaymentId); editpayment.InvoiceTotal = GetInvoiceTotal(); editpayment.PaymentTotal = GetPaymentTotal(); editpayment.ShowObject(selectedpayment); var result = editpayment.ShowDialog(); if (result == DialogResult.Cancel) { return; } if (result == DialogResult.OK) { _invoice.PaymentRecord.Add(editpayment.CurrentObject); } }