예제 #1
0
        //选择加工单
        private void bar_ChoosePNT_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            produceManager.PronoteHeader.ChoosePronoteHeaderForm f = new Book.UI.produceManager.PronoteHeader.ChoosePronoteHeaderForm();
            if (f.ShowDialog(this) == DialogResult.OK)
            {
                if (produceManager.PronoteHeader.ChoosePronoteHeaderForm._PronotedetailsMaterialList.Count > 0)
                {
                    if (this._depotIn.Details.Count > 0 && string.IsNullOrEmpty(this._depotIn.Details[0].ProductId))
                    {
                        this._depotIn.Details.RemoveAt(0);
                    }

                    Model.DepotInDetail detail;
                    foreach (var item in produceManager.PronoteHeader.ChoosePronoteHeaderForm._PronotedetailsMaterialList)
                    {
                        detail = new Book.Model.DepotInDetail();
                        detail.DepotInDetailId = Guid.NewGuid().ToString();
                        detail.Inumber         = this._depotIn.Details.Count + 1;
                        detail.Product         = item.Product;
                        detail.ProductId       = item.ProductId;
                        detail.ProductUnit     = item.ProductUnit;
                        detail.PronoteHeaderId = item.PronoteHeaderID;
                        detail.DepotInQuantity = item.PronoteQuantity;
                        detail.PronoteHeaderId = item.PronoteHeaderID;
                        detail.PronoteHeaderId = item.PronoteHeaderID;

                        this._depotIn.Details.Add(detail);
                    }

                    this.gridControl1.RefreshDataSource();
                }
            }
        }
예제 #2
0
        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            PronoteHeader.ChoosePronoteHeaderForm f = new Book.UI.produceManager.PronoteHeader.ChoosePronoteHeaderForm();
            if (f.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }
            if (PronoteHeader.ChoosePronoteHeaderForm._PronotedetailsMaterialList.Count != 0)
            {
                Model.PronoteHeader pronoteHeader = PronoteHeader.ChoosePronoteHeaderForm._PronotedetailsMaterialList[0].PronoteHeader;

                this._produceMaterialExit.PronoteHeaderID = pronoteHeader.PronoteHeaderID;
                this.textEditProId.Text      = pronoteHeader.Product.Id;
                this.textEditProName.Text    = pronoteHeader.Product.ProductName;
                this.textEditCusProName.Text = pronoteHeader.Product.CustomerProductName;
                //if (!string.IsNullOrEmpty(pronoteHeader.InvoiceXOId))
                //{
                //    Model.InvoiceXO xo = new BL.InvoiceXOManager().Get(pronoteHeader.InvoiceXOId);
                //    if (xo != null)
                this.textEditCustomerXOId.Text = pronoteHeader.InvoiceCusId;
                //    else
                //        this.textEditCustomerXOId.EditValue = null;
                //}
                //else
                //    this.textEditCustomerXOId.EditValue = null;
                this.tEtPronoteHeaderId.Text = pronoteHeader.PronoteHeaderID;
                foreach (Model.PronotedetailsMaterial pronoteMaterial in PronoteHeader.ChoosePronoteHeaderForm._PronotedetailsMaterialList)
                {
                    Model.ProduceMaterialExitDetail produceMaterialExitDetail = new Book.Model.ProduceMaterialExitDetail();
                    produceMaterialExitDetail.ProduceMaterialExitDetailId = Guid.NewGuid().ToString();
                    produceMaterialExitDetail.Product   = pronoteMaterial.Product;
                    produceMaterialExitDetail.Inumber   = this._produceMaterialExit.Detail.Count + 1;
                    produceMaterialExitDetail.ProductId = pronoteMaterial.ProductId;
                    //   produceMaterialExitDetail.PronotedetailsMaterialId = pronoteMaterial.PronotedetailsMaterialId;
                    produceMaterialExitDetail.ProduceQuantity = 0;
                    if (produceMaterialExitDetail.Product != null)
                    {
                        if (pronoteMaterial.Product.ProduceUnit != null)
                        {
                            produceMaterialExitDetail.ProductUnit = pronoteMaterial.Product.ProduceUnit.CnName;
                        }
                        // produceMaterialExitDetail. = pronotedetails.Product.ProductSpecification;                                  }
                        //单位  pronotedetails. =  pronotedetails.ProductUnit;
                        //pronotedetails.InDepotQuantity = Convert.ToDouble(mpsdetail.MPSdetailssum);
                        //produceMaterialExitDetail.ProduceAllUserQuantity = pronotedetails.DetailsSum;
                        //produceMaterialExitDetail. = this._produceMaterialExit;
                        //produceMaterialExitDetail._produceMaterialExitID = this._produceMaterialExit._produceMaterialExitID
                        //produceMaterialExitDetail.MPSheaderId = pronotedetails.MPSheaderId;
                        //produceMaterialExitDetail.InvoiceXOId = pronotedetails.InvoiceXOId;
                        //produceMaterialExitDetail.InvoiceXODetailId = pronotedetails.InvoiceXODetailId;
                    }
                    this._produceMaterialExit.Detail.Add(produceMaterialExitDetail);
                }
                this.gridControl1.RefreshDataSource();
            }
        }
예제 #3
0
        //选择加工单
        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            PronoteHeader.ChoosePronoteHeaderForm f = new Book.UI.produceManager.PronoteHeader.ChoosePronoteHeaderForm();
            if (f.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }
            if (PronoteHeader.ChoosePronoteHeaderForm._PronotedetailsMaterialList.Count != 0)
            {
                foreach (Model.PronotedetailsMaterial pronoteMaterial in PronoteHeader.ChoosePronoteHeaderForm._PronotedetailsMaterialList)
                {
                    Model.ProduceMaterialExitDetail produceMaterialExitDetail = new Book.Model.ProduceMaterialExitDetail();
                    produceMaterialExitDetail.ProduceMaterialExitDetailId = Guid.NewGuid().ToString();
                    produceMaterialExitDetail.Product           = pronoteMaterial.Product;
                    produceMaterialExitDetail.Inumber           = this._produceMaterialExit.Detail.Count + 1;
                    produceMaterialExitDetail.ProductId         = pronoteMaterial.ProductId;
                    produceMaterialExitDetail.ProductUnit       = pronoteMaterial.ProductUnit;
                    produceMaterialExitDetail.HandbookId        = pronoteMaterial.PronoteHeader.HandbookId;
                    produceMaterialExitDetail.HandbookProductId = pronoteMaterial.PronoteHeader.HandbookProductId;


                    produceMaterialExitDetail.ProduceQuantity = 0;
                    if (produceMaterialExitDetail.Product != null)
                    {
                        produceMaterialExitDetail.PronoteHeaderId = pronoteMaterial.PronoteHeaderID;
                        produceMaterialExitDetail.InvoiceXOId     = pronoteMaterial.PronoteHeader.InvoiceXOId;
                        produceMaterialExitDetail.InvoiceXO       = pronoteMaterial.PronoteHeader.InvoiceXO == null?invoiceXOManager.Get(pronoteMaterial.PronoteHeader.InvoiceXOId) : pronoteMaterial.PronoteHeader.InvoiceXO;
                    }
                    this._produceMaterialExit.Detail.Add(produceMaterialExitDetail);
                }
                this.gridControl1.RefreshDataSource();
            }
            else if (f.pronoteHeader != null)
            {
                Model.ProduceMaterialExitDetail produceMaterialExitDetail = new Book.Model.ProduceMaterialExitDetail();
                produceMaterialExitDetail.ProduceMaterialExitDetailId = Guid.NewGuid().ToString();
                produceMaterialExitDetail.Inumber           = this._produceMaterialExit.Detail.Count + 1;
                produceMaterialExitDetail.Product           = productManager.Get(f.pronoteHeader.ProductId);
                produceMaterialExitDetail.ProductId         = f.pronoteHeader.ProductId;
                produceMaterialExitDetail.ProductUnit       = f.pronoteHeader.ProductUnit;
                produceMaterialExitDetail.HandbookId        = f.pronoteHeader.HandbookId;
                produceMaterialExitDetail.HandbookProductId = f.pronoteHeader.HandbookProductId;

                produceMaterialExitDetail.ProduceQuantity = 0;
                if (produceMaterialExitDetail.Product != null)
                {
                    produceMaterialExitDetail.PronoteHeaderId = f.pronoteHeader.PronoteHeaderID;
                    produceMaterialExitDetail.InvoiceXOId     = f.pronoteHeader.InvoiceXOId;
                    produceMaterialExitDetail.InvoiceXO       = f.pronoteHeader.InvoiceXO == null?invoiceXOManager.Get(f.pronoteHeader.InvoiceXOId) : f.pronoteHeader.InvoiceXO;
                }

                this._produceMaterialExit.Detail.Add(produceMaterialExitDetail);
                this.gridControl1.RefreshDataSource();
            }
        }