Exemplo n.º 1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            XS.SearcharInvoiceXSForm f = new Book.UI.Invoices.XS.SearcharInvoiceXSForm();
            if (f.ShowDialog(this) == DialogResult.OK)
            {
                if (f.key != null && f.key.Count > 0)
                {
                    foreach (Model.InvoiceXODetail detail in f.key)
                    {
                        invoicezx                  = new Book.Model.InvoiceZX();
                        invoicezx.InvoiceZXId      = Guid.NewGuid().ToString();
                        invoicezx.ParentInvoceZXId = null;

                        invoicezx.Product      = detail.Product;
                        invoicezx.ProductId    = detail.ProductId;
                        invoicezx.Customer     = detail.Invoice.Customer;
                        invoicezx.CustomerId   = detail.Invoice.CustomerId;
                        invoicezx.XOcustomer   = detail.Invoice.xocustomer;
                        invoicezx.XOcustomerId = detail.Invoice.xocustomerId;
                        invoicezx.UNITPRICE    = detail.InvoiceXODetailPrice;

                        //this.HasPackingNum = this.invoicezxmenager.SelectHasPackingNum(detail.ProductId);
                        invoicezx.ProductNum = Convert.ToDouble(detail.InvoiceXODetailQuantity0);

                        LInvoiceZXList.Add(invoicezx);
                    }
                }
                this.bindingSourceXO.DataSource = LInvoiceZXList;
                this.gridControl6.RefreshDataSource();
                this.bindingSourceXO.Position = this.bindingSourceXO.IndexOf(invoicezx);
            }
            f.Dispose();
            GC.Collect();
        }