Example #1
0
 /// <summary>
 /// Insert a PronoteProceduresDetail.
 /// </summary>
 public void Insert(Model.PronoteProceduresDetail pronoteProceduresDetail)
 {
     //
     // todo:add other logic here
     //
     accessor.Insert(pronoteProceduresDetail);
 }
Example #2
0
 /// <summary>
 /// Update a PronoteProceduresDetail.
 /// </summary>
 public void Update(Model.PronoteProceduresDetail pronoteProceduresDetail)
 {
     //
     // todo: add other logic here.
     //
     accessor.Update(pronoteProceduresDetail);
 }
Example #3
0
 public void Update(Model.PronoteProceduresDetail e)
 {
     this.Update <Model.PronoteProceduresDetail>(e);
 }
Example #4
0
 public void Insert(Model.PronoteProceduresDetail e)
 {
     this.Insert <Model.PronoteProceduresDetail>(e);
 }
Example #5
0
        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            foreach (Model.MRSdetails _mrsdetail in detail)
            {
                //this.pronoteHeader.Details = new List<Model.Pronotedetails>();
                pronoteHeader.DetailsMaterial       = new List <Model.PronotedetailsMaterial>();
                this.pronoteHeader.DetailProcedures = new List <Model.PronoteProceduresDetail>();
                pronoteHeader.PronoteHeaderID       = pronoteHeaderManager.GetId();
                pronoteHeader.Employee0             = _mrsdetail.MRSHeader.Employee0;
                if (pronoteHeader.Employee0 != null)
                {
                    pronoteHeader.Employee0Id = pronoteHeader.Employee0.EmployeeId;
                }
                pronoteHeader.PronoteDate = DateTime.Now;
                pronoteHeader.MRSHeaderId = _mrsdetail.MRSHeaderId;

                this.pronoteHeader.Product     = _mrsdetail.Product;
                this.pronoteHeader.ProductId   = _mrsdetail.ProductId;
                this.pronoteHeader.DetailsSum  = _mrsdetail.MRSdetailssum - (_mrsdetail.MRSHasSingleSum == null ? 0 : _mrsdetail.MRSHasSingleSum);
                this.pronoteHeader.ProductUnit = _mrsdetail.ProductUnit;
                this.pronoteHeader.Employee0   = BL.V.ActiveOperator.Employee;
                this.pronoteHeader.Employee1   = BL.V.ActiveOperator.Employee;

                //   Model.Pronotedetails pronotedetails = new Book.Model.Pronotedetails();
                //   pronotedetails.PronotedetailsID = Guid.NewGuid().ToString();
                ////   pronotedetails.MPSDetailId = _mrsdetail.MRSdetailsId;

                //   pronotedetails.DetailsSum = _mrsdetail.MRSdetailssum - (_mrsdetail.MRSHasSingleSum == null ? 0 : _mrsdetail.MRSHasSingleSum);
                //   pronotedetails.QuantityTemp = pronotedetails.DetailsSum;
                //   pronotedetails.Product = _mrsdetail.Product;
                //   pronotedetails.ProductId = _mrsdetail.ProductId;
                //   pronotedetails.MPSQuantity = _mrsdetail.MRSdetailssum;
                //   pronotedetails.ProductStock = _mrsdetail.Product.StocksQuantity;
                //   pronotedetails.PronoteHeader = this.pronoteHeader;
                //   pronotedetails.MRSHeaderId = _mrsdetail.MRSHeaderId;
                //   pronotedetails.MRSdetailsId = _mrsdetail.MRSdetailsId;
                //   pronotedetails.ProductUnit = _mrsdetail.ProductUnit;
                //   pronotedetails.InvoiceXOId = this.mPSdetailsManager.Get(_mrsdetail.MPSdetailsId).InvoiceXOId;
                //   pronotedetails.PronoteHeaderID = this.pronoteHeader.PronoteHeaderID;
                //   pronotedetails.MPSheaderId = _mrsdetail.MPSheaderId; // l.MRSHeader.MPSheaderId;

                //   this.pronoteHeader.Details.Add(pronotedetails);
                //

                //if (pronotedetails.Product.IsCustomerProduct == true)
                //{
                //    bomP = new BL.BomParentPartInfoManager().Get(this.productManager.Get(pronotedetails.Product.CustomerBeforeProductId), pronotedetails.Product.Customer);
                //    if (bomP == null)
                //        bomP = new BL.BomParentPartInfoManager().Get(this.productManager.Get(pronotedetails.Product.CustomerBeforeProductId));
                //}

                //else
                Model.BomParentPartInfo bomP = new BL.BomParentPartInfoManager().Get(this.pronoteHeader.Product);

                //配料
                foreach (Model.BomComponentInfo component in bomComponentinfoManager.Select(bomP))
                {
                    Model.PronotedetailsMaterial materials = new Model.PronotedetailsMaterial();
                    materials.PronotedetailsMaterialId = Guid.NewGuid().ToString();
                    materials.Product         = component.Product;
                    materials.ProductId       = component.ProductId;
                    materials.PronoteHeader   = this.pronoteHeader;
                    materials.PronoteHeaderID = this.pronoteHeader.PronoteHeaderID;
                    materials.PronoteQuantity = component.UseQuantity * this.pronoteHeader.DetailsSum;

                    materials.MPSQuantity = _mrsdetail.MRSdetailssum * component.UseQuantity;
                    //materials.Pronotedetails = pronotedetails;
                    //materials.PronotedetailsID = pronotedetails.PronotedetailsID;
                    materials.MPSheaderId  = _mrsdetail.MPSheaderId;
                    materials.MRSHeaderId  = _mrsdetail.MRSHeaderId;
                    materials.MRSdetailsId = _mrsdetail.MRSdetailsId;
                    pronoteHeader.DetailsMaterial.Add(materials);
                }

                //工序
                if (manProcedureManager.Select(bomP, _mrsdetail.Customer) != null)
                {
                    Model.TechonlogyHeader        techonlogyHeader        = techonlogyHeaderManager.Get(manProcedureManager.Select(bomP, _mrsdetail.Customer).TechonlogyHeaderId);
                    Model.PronoteProceduresDetail pronoteProceduresDetail = null;
                    foreach (Model.Technologydetails technologydetails in (new BL.TechnologydetailsManager().Select(techonlogyHeader)))
                    {
                        pronoteProceduresDetail = new Book.Model.PronoteProceduresDetail();
                        pronoteProceduresDetail.PronoteProceduresDetailId = Guid.NewGuid().ToString();
                        pronoteProceduresDetail.Procedures = technologydetails.Procedures;
                        //  pronoteProceduresDetail.PronoteMachine = technologydetails.Procedures.PronoteMachine;
                        pronoteProceduresDetail.ProceduresNo = technologydetails.TechnologydetailsNo;
                        if (technologydetails.Procedures != null)
                        {
                            pronoteProceduresDetail.ProceduresId = technologydetails.Procedures.ProceduresId;
                        }
                        pronoteProceduresDetail.WorkHouseId = technologydetails.Procedures.WorkHouseId;
                        this.pronoteHeader.DetailProcedures.Add(pronoteProceduresDetail);
                    }
                }
                this.pronoteHeaderManager.Insert(this.pronoteHeader);



                //Model.
                //_mrsdetail.MRSHeader.MPSheaderId
                //this.mPSdetailsManager.Update();
                // this.gridControl2.RefreshDataSource();
            }
            this._mpsDetails.IsPronoteHeader = true;
            this.mPSdetailsManager.Update(this._mpsDetails);
            this.barButtonItem1.Enabled = false;
            MessageBox.Show(Properties.Resources.SuccessfullySaved, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
        }