예제 #1
0
        //选择借入
        private void barBtnChooseJR_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            ChooseInvoiceJrForm chooseform = new ChooseInvoiceJrForm();

            if (chooseform.ShowDialog(this) == DialogResult.OK)
            {
                foreach (Model.InvoiceJRDetail item in details)
                {
                    this.newChooseContorlSupper.EditValue = item.Invoice.Supplier;
                    this.buttonEditEmployee.EditValue     = item.Invoice.Employee0;
                    this.lookUpEditDepot.EditValue        = item.Invoice.DepotId;
                    this.textEditjrinvoiceid.Text         = item.InvoiceId;
                }
                this.invoicehc.Details.Clear();
                this.invoicehc.Jrdetails = new List <Model.InvoiceJRDetail>();
                foreach (Model.InvoiceJRDetail detail in details)
                {
                    Model.InvoiceHCDetail hcdetail = new Book.Model.InvoiceHCDetail();
                    hcdetail.InvoiceId               = detail.InvoiceId;
                    hcdetail.InvoiceHCDetailId       = Guid.NewGuid().ToString();
                    hcdetail.InvoiceHCDetailNote     = detail.InvoiceHCDetailNote;
                    hcdetail.InvoiceHCDetailQuantity = detail.InvoiceHCDetailQuantity;
                    hcdetail.InvoiceJRDetailId       = detail.InvoiceJRDetailId;
                    hcdetail.InvoiceProductUnit      = detail.InvoiceProductUnit;
                    hcdetail.DepotPositionId         = detail.DepotPositionId;
                    hcdetail.InvoiceHCDetailQuantity = detail.InvoiceWeiHuaiChuQuantity;
                    hcdetail.ProductId               = detail.ProductId;
                    this.invoicehc.Details.Add(hcdetail);
                }
                this.bindingSource1.DataSource = this.invoicehc.Details;
                this.gridControl1.RefreshDataSource();
            }
        }
예제 #2
0
        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            this.invoicehc.Details.Clear();
            ChooseInvoiceJrForm chooseform = new ChooseInvoiceJrForm();

            if (chooseform.ShowDialog(this) == DialogResult.OK)
            {
                foreach (Model.InvoiceJRDetail item in details)
                {
                    Model.InvoiceHCDetail tem = new Book.Model.InvoiceHCDetail();
                    tem.InvoiceHCDetailId       = Guid.NewGuid().ToString();
                    tem.InvoiceJRDetailId       = item.InvoiceJRDetailId;
                    tem.InvoiceHCDetailQuantity = item.InvoiceYiHuaiChuQuantity;
                    this.invoicehc.Details.Add(tem);
                }
                this.gridControl1.RefreshDataSource();
            }
        }