예제 #1
0
        private void btEdit_Click(object sender, EventArgs e)
        {
            this.invoiceMasterBindingSource.EndEdit();
            this.Save();



            this.mainDataset.InvoiceDetail.Merge(this.mDataSet.InvoiceDetail);

            if (this.ValidateChildren())
            {
                FormDialog _formDialog = new FormDialog();
                _formDialog.Text = this.Tag.ToString();

                //   _formDialog.WindowState = FormWindowState.Maximized;


                _formDialog.AcceptButton = null;
                InvoiceDetailEdit _invoiceDetail = new InvoiceDetailEdit(_curentMasterRow, this.mainDataset.Product, (this.ParentForm as MainForm));

                //  _invoiceDetail.Dock = DockStyle.Fill;

                _formDialog.panel.Controls.Add(_invoiceDetail);

                if (DialogResult.OK == _formDialog.ShowDialog(this))
                {
                    this.invoiceMasterBindingSource.EndEdit();

                    btRefresh_Click(sender, e);

                    this.mDataSet.Remains.Merge(this.mainDataset.Remains);
                }
                else
                {
                    this.invoiceMasterBindingSource.CurrencyManager.CancelCurrentEdit();
                    btRefresh_Click(sender, e);
                }
            }
        }
예제 #2
0
        private void btEdit_Click(object sender, EventArgs e)
        {
            this.invoiceMasterBindingSource.EndEdit();
            this.Save();

            

            this.mainDataset.InvoiceDetail.Merge(this.mDataSet.InvoiceDetail);

            if (this.ValidateChildren())
            {
                FormDialog _formDialog = new FormDialog();
                _formDialog.Text = this.Tag.ToString();

            //   _formDialog.WindowState = FormWindowState.Maximized;


                _formDialog.AcceptButton = null;
                InvoiceDetailEdit _invoiceDetail = new InvoiceDetailEdit(_curentMasterRow, this.mainDataset.Product,(this.ParentForm as MainForm));

              //  _invoiceDetail.Dock = DockStyle.Fill;

                _formDialog.panel.Controls.Add(_invoiceDetail);

                if (DialogResult.OK == _formDialog.ShowDialog(this))
                {
                    this.invoiceMasterBindingSource.EndEdit();

                    btRefresh_Click(sender, e);

                    this.mDataSet.Remains.Merge(this.mainDataset.Remains);

                }
                else
                {
                    this.invoiceMasterBindingSource.CurrencyManager.CancelCurrentEdit();
                    btRefresh_Click(sender, e);
                }
            }
        }