예제 #1
0
        private void btAdd_Click(object sender, EventArgs e)
        {
            if (!InitDataCash())
            {
                MessageBox.Show("Ошибка принтера :InitDataCash false");
                return;
            }

            InvoiceDetailDatecs _InvoiceDetailDatecs = new InvoiceDetailDatecs(this.ParentForm as MainForm);

            _InvoiceDetailDatecs.Text = "Новый расходный документ";



            if (DialogResult.OK == _InvoiceDetailDatecs.ShowDialog(this))
            {
                if (!InitDataCash())
                {
                    MessageBox.Show("Ошибка принтера :InitDataCash false");
                    return;
                }
            }
            else
            {
                this.mDataSet.InvoiceMaster.RejectChanges();
                this.mDataSet.ReceiptRemains.RejectChanges();
            }

            _InvoiceDetailDatecs.Dispose();
            _InvoiceDetailDatecs = null;
            GC.Collect();
        }
예제 #2
0
        private void btOpen_Click(object sender, EventArgs e)
        {
            /* if (_)
             * {
             *
             *   MessageBox.Show("Ошибка принтера :InitDataCash false");
             *   return;
             * }*/

            MDataSet.InvoiceMasterRow _master = this.gridViewInvDatAll.GetDataRow(this.gridViewInvDatAll.FocusedRowHandle) as MDataSet.InvoiceMasterRow;


            if (_master == null)
            {
                return;
            }

            if (_master.DocumentTypeRef != 0)
            {
                MessageBox.Show("Документ закрыт!");
                return;
            }

            InvoiceDetailDatecs _InvoiceDetailDatecs = new InvoiceDetailDatecs(this.ParentForm as MainForm, _master);

            _InvoiceDetailDatecs.Text = "Открыть расходный документ";



            if (DialogResult.OK == _InvoiceDetailDatecs.ShowDialog(this))
            {
                if (!InitDataCash())
                {
                    MessageBox.Show("Ошибка принтера :InitDataCash false");
                    return;
                }
            }
            else
            {
                this.mDataSet.InvoiceMaster.RejectChanges();
            }
            _InvoiceDetailDatecs.Free();
            _InvoiceDetailDatecs = null;
            GC.Collect();
        }
예제 #3
0
        private void btOpen_Click(object sender, EventArgs e)
        {
          
            
           /* if (_)
            {

                MessageBox.Show("Ошибка принтера :InitDataCash false");
                return;
            }*/

            MDataSet.InvoiceMasterRow _master = this.gridViewInvDatAll.GetDataRow(this.gridViewInvDatAll.FocusedRowHandle) as MDataSet.InvoiceMasterRow;


            if (_master == null) return;

            if (_master.DocumentTypeRef != 0)
            {
                MessageBox.Show("Документ закрыт!");
                return;
           
            }

            InvoiceDetailDatecs _InvoiceDetailDatecs = new InvoiceDetailDatecs(this.ParentForm as MainForm, _master);
           
            _InvoiceDetailDatecs.Text = "Открыть расходный документ";



            if (DialogResult.OK == _InvoiceDetailDatecs.ShowDialog(this))
            {
                if (!InitDataCash())
                {

                    MessageBox.Show("Ошибка принтера :InitDataCash false");
                    return;
                }
            }
            else
            {
                this.mDataSet.InvoiceMaster.RejectChanges();
            }
            _InvoiceDetailDatecs.Free();
            _InvoiceDetailDatecs = null;
            GC.Collect();

        }
예제 #4
0
        private void btAdd_Click(object sender, EventArgs e)
        {

            if (!InitDataCash())
            {

                MessageBox.Show("Ошибка принтера :InitDataCash false");
                return;
            }
         
            InvoiceDetailDatecs _InvoiceDetailDatecs = new InvoiceDetailDatecs(this.ParentForm as MainForm);
           _InvoiceDetailDatecs.Text = "Новый расходный документ";



            if (DialogResult.OK == _InvoiceDetailDatecs.ShowDialog(this))
            {
                if (!InitDataCash())
                {

                    MessageBox.Show("Ошибка принтера :InitDataCash false");
                    return;
                }
            }
            else
            {
                this.mDataSet.InvoiceMaster.RejectChanges();
                this.mDataSet.ReceiptRemains.RejectChanges();

            }

            _InvoiceDetailDatecs.Dispose();
            _InvoiceDetailDatecs = null; 
            GC.Collect();
        }