Esempio n. 1
0
        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();
                }
            }
        }
Esempio n. 2
0
        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);
                }
            }
        }
Esempio n. 3
0
        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();

                }
            }


        }
Esempio n. 4
0
        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);


          }

          }

        }