Exemplo n.º 1
0
        private void btSelToTradePutlet_Click(object sender, EventArgs e)
        {

            FormDialog formDialog = new FormDialog();
            SelectTradePutlet selectTradePutlet = new SelectTradePutlet();

            selectTradePutlet.tradePutletBindingSource.DataSource = this.mDataSet.TradePutlet;
            selectTradePutlet.tradePutletBindingSource.ResetBindings(false);
           
             formDialog.panel.Controls.Add(selectTradePutlet);


             if (formDialog.ShowDialog(this) == DialogResult.OK)
             {
                 try
                 {
                    
                     (this.ParentForm as MainForm).receiptMasterTableAdapter.ReceiptMasterSellCommand(this.CurentReceiptMasterRow.ID, (int)selectTradePutlet.lookUpEdit.EditValue);
                     (this.ParentForm as MainForm).RefreshData(this._curentReceiptMasterRow);
                     (this.ParentForm as MainForm).RefreshData(this.mDataSet.Remains as DataTable);
                 }
                 catch (Exception err)
                 {

                     MessageBox.Show(err.Message);
                 }

                 this.btClose_Click(sender,e);
             }

        }
Exemplo n.º 2
0
        private void btCloseByOrganization_Click(object sender, EventArgs e)
        {
            //***/



            this.invoiceMasterBindingSource.EndEdit();


            if (!this.Save()) return;

            if (_curentMasterRow.Sum == 0) return;

            foreach (DataRow detrow in this._curentMasterRow.GetInvoiceDetailRows())
            {
                if ((detrow as MDataSet.InvoiceDetailRow).PriceRetailNDS == 0)
                {
                    MessageBox.Show("Есть не установленные цены!!!");
                    return;
                }
            }

            SelectTradePutlet _selectTradePutlet = new SelectTradePutlet();


            _selectTradePutlet.organizationBindingSource.DataSource = this.mainDataset.Organization;

            _selectTradePutlet.organizationBindingSource.ResetBindings(false);


            _selectTradePutlet.lookUpEdit.Properties.DataSource = _selectTradePutlet.organizationBindingSource;


            FormDialog _formDialog = new FormDialog();
            _formDialog.panel.Controls.Add(_selectTradePutlet);

           try
            {  int _OrganizationRef ;

            if (_formDialog.ShowDialog(this) == DialogResult.OK)
            {
                if (Convert.ToInt32(_selectTradePutlet.lookUpEdit.EditValue) == 0)
                    return;

                _OrganizationRef = Convert.ToInt32(_selectTradePutlet.lookUpEdit.EditValue);

         





           
                (this.ParentForm as MainForm).invoiceMasterTableAdapter.InvoiceMasterMoveToOrg(_curentMasterRow.ID, _OrganizationRef);

                (this.ParentForm as MainForm).RefreshData(_curentMasterRow, false);
   }

            }
            catch
            { MessageBox.Show("Ошибка внутреннего перемещения!"); }

            finally
            {
                this.btClose.PerformClick();
            }









          


        }