private void btOpen_Click(object sender, EventArgs e) { MDataSet.InvoiceMasterRow _row = this.gridViewInvAll.GetDataRow(this.gridViewInvAll.FocusedRowHandle) as MDataSet.InvoiceMasterRow; if (_row != null) { if (_row.DocumentTypeRef == 0) { InvoicePrintMar _invoiceDetail = new InvoicePrintMar(this.ParentForm as MainForm, _row, _printer); if (DialogResult.OK == _invoiceDetail.ShowDialog(this)) { this.labelCashCustomer.Text = _invoiceDetail.CashCustomer.ToString(); this.LableChanges.Text = _invoiceDetail.Changes.ToString(); this.LabelLastSum.Text = _invoiceDetail.LastSum.ToString(); } _invoiceDetail.Dispose(); GC.Collect(); } } }
private void btAdd_Click(object sender, EventArgs e) { try { this.invoiceMasterBindingSource.EndEdit(); } catch (Exception err) { MessageBox.Show(err.Message); MainForm.Log("btAdd_Click" + err.Message); } if (this.ValidateChildren()) { if (!InitDataCash()) { return; } try { InvoicePrintMar _invoiceDetail = new InvoicePrintMar(this.ParentForm as MainForm, _printer); if (DialogResult.OK == _invoiceDetail.ShowDialog(this)) { InitDataCash(); this.labelCashCustomer.Text = _invoiceDetail.CashCustomer.ToString(); this.LableChanges.Text = _invoiceDetail.Changes.ToString(); this.LabelLastSum.Text = _invoiceDetail.LastSum.ToString(); } else { this.mDataSet.InvoiceMaster.RejectChanges(); _printer.AbortCheck(); } _invoiceDetail.Dispose(); GC.Collect(); } catch (Exception err) { MessageBox.Show(err.Message); MainForm.Log(err.Message); } } }
private void btOpen_Click(object sender, EventArgs e) { MDataSet.InvoiceMasterRow _row = this.gridViewInvAll.GetDataRow(this.gridViewInvAll.FocusedRowHandle) as MDataSet.InvoiceMasterRow; if (_row!=null) { if (_row.DocumentTypeRef == 0) { InvoicePrintMar _invoiceDetail = new InvoicePrintMar(this.ParentForm as MainForm, _row,_printer); if (DialogResult.OK == _invoiceDetail.ShowDialog(this)) { this.labelCashCustomer.Text = _invoiceDetail.CashCustomer.ToString(); this.LableChanges.Text = _invoiceDetail.Changes.ToString(); this.LabelLastSum.Text = _invoiceDetail.LastSum.ToString(); } _invoiceDetail.Dispose(); GC.Collect(); } } }
private void btAdd_Click(object sender, EventArgs e) { try { this.invoiceMasterBindingSource.EndEdit(); } catch (Exception err) { MessageBox.Show(err.Message); MainForm.Log("btAdd_Click" +err.Message); } if (this.ValidateChildren()) { if (!InitDataCash()) return; try { InvoicePrintMar _invoiceDetail = new InvoicePrintMar(this.ParentForm as MainForm, _printer); if (DialogResult.OK == _invoiceDetail.ShowDialog(this)) { InitDataCash(); this.labelCashCustomer.Text = _invoiceDetail.CashCustomer.ToString(); this.LableChanges.Text = _invoiceDetail.Changes.ToString(); this.LabelLastSum.Text = _invoiceDetail.LastSum.ToString(); } else { this.mDataSet.InvoiceMaster.RejectChanges(); _printer.AbortCheck(); } _invoiceDetail.Dispose(); GC.Collect(); } catch (Exception err) { MessageBox.Show(err.Message); MainForm.Log(err.Message); } } }