コード例 #1
0
ファイル: MRSdetailsManager.cs プロジェクト: daobataotie/Mobe
        /// <summary>
        /// Insert a MRSdetails.
        /// </summary>
        public void Insert(Model.MRSdetails mRSdetails)
        {
            //
            // todo:add other logic here
            //
            // mRSdetails.MRSdetailsId = Guid.NewGuid().ToString();
            //Model.Product product = ProductAccessor.Get(mRSdetails.ProductId);
            //if (product.MRSStockQuantity == null)
            //    product.MRSStockQuantity = 0;
            //if (mRSdetails.MRSdetailssum >= (mRSdetails.Product.StocksQuantity -  product.MRSStockQuantity))
            //    product.MRSStockQuantity += mRSdetails.Product.StocksQuantity -  product.MRSStockQuantity;
            //else {
            //    product.MRSStockQuantity += mRSdetails.MRSdetailssum;
            //}
            //    if (product.ProductImage == null)
            //        product.ProductImage = pic;
            //    if (product.ProductImage1 == null)
            //        product.ProductImage1 = pic;
            //    if (product.ProductImage2 == null)
            //        product.ProductImage2 = pic;
            //    if (product.ProductImage3 == null)
            //        product.ProductImage3 = pic;

            //    ProductAccessor.Update(product);

            accessor.Insert(mRSdetails);
        }
コード例 #2
0
ファイル: MRSdetailsManager.cs プロジェクト: daobataotie/Mobe
 /// <summary>
 /// Update a MRSdetails.
 /// </summary>
 public void Update(Model.MRSdetails mRSdetails)
 {
     //
     // todo: add other logic here.
     //
     accessor.Update(mRSdetails);
 }
コード例 #3
0
        /// <summary>
        /// 自定义列显示
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        //private void gridView1_CustomColumnDisplayText(object sender, DevExpress.XtraGrid.Views.Base.CustomColumnDisplayTextEventArgs e)
        //{
        //    if (e.ListSourceRowIndex < 0) return;
        //    IList<Model.MRSdetails> details = this.bindingSource1.DataSource as IList<Model.MRSdetails>;
        //    if (details == null || details.Count < 1) return;
        //    Model.MRSHeader detail = details[e.ListSourceRowIndex].MRSHeader;
        //    Model.Product products = details[e.ListSourceRowIndex].Product;
        //    switch (e.Column.Name)
        //    {
        //        case "gridColumn7":
        //            if (detail == null) return;
        //            e.DisplayText = detail == null ? "" : detail.MPSheaderId;
        //            break;
        //        case "gridColumn1":
        //            if (products == null) return;
        //            e.DisplayText = string.IsNullOrEmpty(products.Id) ? "" : products.Id;
        //            break;
        //        case "gridColumn4":
        //            if (products == null) return;
        //            e.DisplayText = string.IsNullOrEmpty(products.ProductSpecification) ? "" : products.ProductSpecification;
        //            break;
        //        case "gridColumnCusPro":
        //            if (products == null) return;
        //            e.DisplayText = products.CustomerProductName;
        //            break;
        //        case "gridColumnCusXO":
        //            if (!string.IsNullOrEmpty(detail.MPSheaderId))
        //            {
        //                Model.MPSheader mpsHeader = this.mPSheaderManager.Get(detail.MPSheaderId);
        //                if (mpsHeader != null)
        //                {

        //                    if (!string.IsNullOrEmpty(mpsHeader.InvoiceXOId))
        //                    {
        //                        Model.InvoiceXO invoiceXO = this.invoiceXOManager.Get(mpsHeader.InvoiceXOId);
        //                        e.DisplayText =invoiceXO==null?string.Empty: invoiceXO.CustomerInvoiceXOId;
        //                    }
        //                }
        //            }

        //            break;

        //    }
        //}

        private void repositoryItemCheckEdit1_Click(object sender, EventArgs e)
        {
            Model.MRSdetails mps = bindingSource1.Current as Model.MRSdetails;
            foreach (Model.MRSdetails item in list)
            {
                item.IsChecked = false;
            }
            mps.IsChecked = true;
            this.gridControl1.RefreshDataSource();
        }
コード例 #4
0
ファイル: PlanForm.cs プロジェクト: daobataotie/EDERP
        private void repositoryItemHyperLinkEdit1_Click(object sender, EventArgs e)
        {
            Model.MRSdetails mrsdetails = this.bindingSource1.Current as Model.MRSdetails;
            if (mrsdetails == null)
            {
                return;
            }
            EditForm f = new EditForm();

            if (f.ShowDialog(this) != DialogResult.OK)
            {
                return;
            }
        }
コード例 #5
0
        private void gridView3_CellValueChanging(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
        {
            if (e.Column.Name == "gridColumnCheck")
            {
                Model.MRSdetails detail = this.gridView3.GetRow(e.RowHandle) as Model.MRSdetails;

                if ((bool)e.Value)
                {
                    key.Add(detail.MRSdetailsId);
                    //  MrsDetails.Add(this.mRSdetailsManager.Get(detail.MRSdetailsId));
                }
                if (!(bool)e.Value)
                {
                    key.Remove(detail.MRSdetailsId);
                    //  MrsDetails.Remove(this.mRSdetailsManager.Get(detail.MRSdetailsId));
                }
            }
        }
コード例 #6
0
        public void Update(Model.PronoteHeader pronoteHeader)
        {
            //
            // todo: add other logic here.
            //
            Validate(pronoteHeader);
            // mPSheader.UpdateTime = DateTime.Now;
            // accessor.Update(mPSheader);
            if (pronoteHeader != null)
            {
                try
                {
                    BL.V.BeginTransaction();
                    //this.Delete(pronoteHeader);
                    pronoteHeader.UpdateTime = DateTime.Now;
                    //if (pronoteHeader.Employee0 != null)
                    //    pronoteHeader.Employee0Id = pronoteHeader.Employee0.EmployeeId;
                    if (pronoteHeader.Employee1 != null)
                    {
                        pronoteHeader.Employee1Id = pronoteHeader.Employee1.EmployeeId;
                    }
                    if (pronoteHeader.Employee2 != null)
                    {
                        pronoteHeader.Employee2Id = pronoteHeader.Employee2.EmployeeId;
                    }


                    pronoteHeader.InvoiceStatus = 1;
                    if (pronoteHeader.IsClose == null || !pronoteHeader.IsClose.Value)
                    {
                        pronoteHeader.InDepotQuantity = pronoteHeader.InDepotQuantity.HasValue ? pronoteHeader.InDepotQuantity : 0;
                        if (pronoteHeader.InDepotQuantity >= pronoteHeader.DetailsSum)
                        {
                            pronoteHeader.IsClose   = true;
                            pronoteHeader.JieAnDate = DateTime.Now;
                        }
                        else
                        {
                            pronoteHeader.IsClose = false;
                        }
                    }
                    accessor.Update(pronoteHeader);


                    Model.MRSdetails mrsDal = mRSdetailsManager.Get(pronoteHeader.MRSdetailsId);
                    if (mrsDal != null)
                    {
                        if (mrsDal.MRSHasSingleSum == null)
                        {
                            mrsDal.MRSHasSingleSum = 0;
                        }
                        mrsDal.MRSHasSingleSum += pronoteHeader.DetailsSum;
                        if (mrsDal.MRSHasSingleSum >= mrsDal.MRSdetailssum)
                        {
                            mrsDal.DetailsFlag = 2;
                        }
                        else
                        {
                            if (mrsDal.MRSHasSingleSum > 0)
                            {
                                mrsDal.DetailsFlag = 1;
                            }
                            else
                            {
                                mrsDal.DetailsFlag = 0;
                            }
                        }
                        //修改派单描述
                        if (mrsDal.DetailsFlag == 2)
                        {
                            mrsDal.ArrangeDesc = "已經排單";
                        }
                        mRSdetailsManager.Update(mrsDal);
                        UpdateMRSHeaderFlag(mrsDal.MRSHeader);
                    }
                    //foreach (Model.Pronotedetails pronotedetails in pronoteHeader.Details)
                    //{
                    //    if (pronotedetails.Product == null || string.IsNullOrEmpty(pronotedetails.Product.ProductId))
                    //        throw new Exception("貨品不為空");
                    //    pronotedetails.PronoteHeaderID = pronoteHeader.PronoteHeaderID;


                    //    Model.MRSdetails mrsDal = new BL.MRSdetailsManager().Get(pronotedetails.MRSdetailsId);
                    // //   double Sum = new BL.ProduceOtherCompactDetailManager().GetByMPSdetail(pronotedetails.MPSdetailId);
                    //    PronotedetailsAccessor.Insert(pronotedetails);
                    //    if (mrsDal != null)
                    //    {
                    //        if (mrsDal.MRSHasSingleSum == null)
                    //            mrsDal.MRSHasSingleSum = 0;
                    //        mrsDal.MRSHasSingleSum += pronotedetails.DetailsSum;
                    //        //if (mrsDal.MPSHasSingleSum == mpsDal.MPSdetailssum)
                    //        //{
                    //        //    mrsDal.MPSEndState = true;
                    //        //}
                    //        new BL.MRSdetailsManager().Update(mrsDal);
                    //    }
                    //}

                    PronotedetailsMaterialAccessor.DeleteByHeaderId(pronoteHeader.PronoteHeaderID);
                    foreach (Model.PronotedetailsMaterial proMaterial in pronoteHeader.DetailsMaterial)
                    {
                        if (string.IsNullOrEmpty(proMaterial.ProductId))
                        {
                            continue;
                        }
                        proMaterial.PronoteHeaderID = pronoteHeader.PronoteHeaderID;
                        if (PronotedetailsMaterialAccessor.ExistsPrimary(proMaterial.PronotedetailsMaterialId))
                        {
                            PronotedetailsMaterialAccessor.Update(proMaterial);
                        }
                        else
                        {
                            PronotedetailsMaterialAccessor.Insert(proMaterial);
                        }
                    }
                    foreach (Model.PronoteProceduresDetail detailProcedures in pronoteHeader.DetailProcedures)
                    {
                        if (string.IsNullOrEmpty(detailProcedures.PronoteProceduresDetailId))
                        {
                            continue;
                        }
                        detailProcedures.PronoteHeader   = pronoteHeader;
                        detailProcedures.PronoteHeaderID = pronoteHeader.PronoteHeaderID;
                        if (PronoteProceduresDetailAccessor.ExistsPrimary(detailProcedures.PronoteProceduresDetailId))
                        {
                            PronoteProceduresDetailAccessor.Update(detailProcedures);
                        }
                        else
                        {
                            PronoteProceduresDetailAccessor.Insert(detailProcedures);
                        }
                    }
                    foreach (Model.ProceduresMachine item in pronoteHeader.ProceduresMachineDetail)
                    {
                        if (ProceduresMachineAccessor.ExistsPrimary(item.ProceduresMachineId))
                        {
                            ProceduresMachineAccessor.Update(item);
                        }
                        else
                        {
                            ProceduresMachineAccessor.Insert(item);
                        }
                    }
                    BL.V.CommitTransaction();
                }
                catch
                {
                    BL.V.RollbackTransaction();
                    throw;
                }
            }
        }
コード例 #7
0
        public void InsertWithOutTrans(Model.PronoteHeader pronoteHeader)
        {
            pronoteHeader.InsertTime = DateTime.Now;
            pronoteHeader.UpdateTime = DateTime.Now;
            TiGuiExists(pronoteHeader);
            if (pronoteHeader.Employee0 != null)
            {
                pronoteHeader.Employee0Id = pronoteHeader.Employee0.EmployeeId;
            }
            if (pronoteHeader.Employee1 != null)
            {
                pronoteHeader.Employee1Id = pronoteHeader.Employee1.EmployeeId;
            }
            if (pronoteHeader.Employee2 != null)
            {
                pronoteHeader.Employee2Id = pronoteHeader.Employee2.EmployeeId;
            }
            string invoiceKind   = this.GetInvoiceKind().ToLower();
            string sequencekey_y = string.Format("{0}-y-{1}", invoiceKind, pronoteHeader.InsertTime.Value.Year);
            string sequencekey_m = string.Format("{0}-m-{1}-{2}", invoiceKind, pronoteHeader.InsertTime.Value.Year, pronoteHeader.InsertTime.Value.Month);
            string sequencekey_d = string.Format("{0}-d-{1}", invoiceKind, pronoteHeader.InsertTime.Value.ToString("yyyy-MM-dd"));
            string sequencekey   = string.Format(invoiceKind);

            SequenceManager.Increment(sequencekey_y);
            SequenceManager.Increment(sequencekey_m);
            SequenceManager.Increment(sequencekey_d);
            SequenceManager.Increment(sequencekey);
            pronoteHeader.InvoiceStatus   = 1;
            pronoteHeader.InDepotQuantity = 0;
            pronoteHeader.IsClose         = false;
            accessor.Insert(pronoteHeader);
            Model.MRSdetails mrsDal = mRSdetailsManager.Get(pronoteHeader.MRSdetailsId);
            if (mrsDal != null)
            {
                if (mrsDal.MRSHasSingleSum == null)
                {
                    mrsDal.MRSHasSingleSum = 0;
                }
                mrsDal.MRSHasSingleSum += pronoteHeader.DetailsSum;
                if (mrsDal.MRSHasSingleSum >= mrsDal.MRSdetailssum)
                {
                    mrsDal.DetailsFlag = 2;
                }
                else
                {
                    if (mrsDal.MRSHasSingleSum > 0)
                    {
                        mrsDal.DetailsFlag = 1;
                    }
                    else
                    {
                        mrsDal.DetailsFlag = 0;
                    }
                }
                mrsDal.ArrangeDesc = "已經排單";
                mRSdetailsManager.Update(mrsDal);
                UpdateMRSHeaderFlag(mrsDal.MRSHeader);
            }

            foreach (Model.PronotedetailsMaterial proMaterial in pronoteHeader.DetailsMaterial)
            {
                if (string.IsNullOrEmpty(proMaterial.ProductId))
                {
                    continue;
                }
                proMaterial.PronoteHeaderID = pronoteHeader.PronoteHeaderID;
                PronotedetailsMaterialAccessor.Insert(proMaterial);
            }
            foreach (Model.PronoteProceduresDetail detailProcedures in pronoteHeader.DetailProcedures)
            {
                if (detailProcedures.PronoteProceduresDetailId == null)
                {
                    continue;
                }
                detailProcedures.PronoteHeader   = pronoteHeader;
                detailProcedures.PronoteHeaderID = pronoteHeader.PronoteHeaderID;
                if (PronoteProceduresDetailAccessor.ExistsPrimary(detailProcedures.PronoteProceduresDetailId))
                {
                    PronoteProceduresDetailAccessor.Update(detailProcedures);
                }
                else
                {
                    PronoteProceduresDetailAccessor.Insert(detailProcedures);
                }
            }
            if (pronoteHeader.ProceduresMachineDetail != null)
            {
                foreach (Model.ProceduresMachine item in pronoteHeader.ProceduresMachineDetail)
                {
                    if (ProceduresMachineAccessor.ExistsPrimary(item.ProceduresMachineId))
                    {
                        ProceduresMachineAccessor.Update(item);
                    }
                    else
                    {
                        ProceduresMachineAccessor.Insert(item);
                    }
                }
            }
        }
コード例 #8
0
ファイル: RO.cs プロジェクト: daobataotie/Jianli
        public RO(string pronoteHeaderId, int flag)
        {
            InitializeComponent();
            this.pronoteHeader = this.pronoteHeaderManager.GetDetails(pronoteHeaderId);

            //CompanyInfo
            this.xrLabelCompanyInfoName.Text = BL.Settings.CompanyChineseName;
            //this.xrLabelDataName.Text = Properties.Resources.Pronotedetails;
            if (flag == 5)
            {
                this.xrLabelDataName.Text = Properties.Resources.GZZhiShi;
            }
            else if (flag == 4)
            {
                this.xrLabelDataName.Text = Properties.Resources.ZZJiaGong;
            }
            this.xrLabelPrintDate.Text = this.xrLabelPrintDate.Text + DateTime.Now.ToShortDateString();
            if (pronoteHeader.WorkHouse != null)
            {
                this.xrLabelWorkHouse.Text = this.pronoteHeader.WorkHouse.Workhousename;
            }

            Model.MRSdetails mrsdetail = this.mRSDetailsManager.Get(this.pronoteHeader.MRSdetailsId);
            if (mrsdetail != null)
            {
                this.xrLabelBeforepPackage.Text = mrsdetail.BeforePackageProduct == null ? string.Empty : (mrsdetail.BeforePackageProduct.IsCustomerProduct.HasValue && mrsdetail.BeforePackageProduct.IsCustomerProduct.Value ? mrsdetail.BeforePackageProduct.ProductName + "{" + mrsdetail.BeforePackageProduct.CustomerProductName + "}" : mrsdetail.BeforePackageProduct.ProductName);
            }
            else
            {
                this.xrLabelBeforepPackage.Text = string.Empty;
            }
            //生產通知
            this.xrLabelPronoteHeaderID.Text = this.pronoteHeader.PronoteHeaderID;
            this.xrLabelPronoteDte.Text      = this.pronoteHeader.PronoteDate.Value.ToString("yyyy-MM-dd");
            this.xrLabelMRP.Text             = this.pronoteHeader.MRSHeaderId;
            if (this.pronoteHeader.Employee0 != null && flag != 1)
            {
                this.xrLabelEmployee.Text = this.pronoteHeader.Employee0.EmployeeName;
            }
            this.xrLabel14.Text = this.pronoteHeader.AuditEmp == null ? "" : this.pronoteHeader.AuditEmp.EmployeeName;
            if (pronoteHeader.Product != null)
            {
                this.xrLabelProductName.Text = pronoteHeader.Product.ProductName;
                //this.xrLabelCustomerProductName.Text = pronoteHeader.Product.CustomerProductName;
                this.xrRichTextProDesc.Rtf = this.pronoteHeader.Product.ProductDescription;
                if (this.pronoteHeader.Product.AttrZhengMai != null)
                {
                    this.RichTextZhengMai.Rtf = this.pronoteHeader.Product.AttrZhengMai;
                }
                if (this.pronoteHeader.Product.AttrCeMai != null)
                {
                    this.RichTextCeMai.Rtf = this.pronoteHeader.Product.AttrCeMai;
                }
            }
            Model.InvoiceXO xo = new BL.InvoiceXOManager().Get(this.pronoteHeader.InvoiceXOId);
            if (xo != null)
            {
                //this.xrLabelCheckedStandard.Text = xo.xocustomer.CheckedStandard;
                this.xrLabelCustomer.Text     = xo.xocustomer.CustomerShortName;
                this.xrLabelCustomerXOId.Text = xo.CustomerInvoiceXOId;
                //this.xrLabelPiHao.Text = xo.CustomerLotNumber;
                this.xrLabelXOJHDate.Text = xo.InvoiceYjrq.Value.ToString("yyyy-MM-dd");

                this.lblCustomerId.Text = xo.Customer.Id;
            }
            this.xrLabelCount.Text       = pronoteHeader.DetailsSum.ToString();
            this.xrLabelUnit.Text        = pronoteHeader.ProductUnit;
            this.xrLabelPronotedesc.Text = this.pronoteHeader.Pronotedesc;

            //if (this.pronoteHeader.DetailProcedures != null && this.pronoteHeader.DetailProcedures.Count > 0)
            //{
            //    this.pronoteHeader.DetailProcedures = this.pronoteHeader.DetailProcedures.OrderByDescending(p => p.PronoteProceduresDate).ToList();

            //    if (this.pronoteHeader.DetailProcedures.First().WorkHouse != null)
            //        this.xrLabelhouseId.Text = this.pronoteHeader.DetailProcedures.First().WorkHouse.Workhousename;
            //}
            this.lblInvoiceXODetailQuantity.Text = this.pronoteHeader.InvoiceXODetailQuantity == null ? "0" : this.pronoteHeader.InvoiceXODetailQuantity.ToString();


            this.xrSubreport1.ReportSource = new RO1();
            this.xrSubreport2.ReportSource = new RO2();
        }
コード例 #9
0
ファイル: RO.cs プロジェクト: daobataotie/EDERP
        public RO(string pronoteHeaderId, int flag)
        {
            InitializeComponent();
            this.pronoteHeader = this.pronoteHeaderManager.GetDetails(pronoteHeaderId);

            //CompanyInfo
            this.xrLabelCompanyInfoName.Text = BL.Settings.CompanyChineseName;
            //this.xrLabelDataName.Text = Properties.Resources.Pronotedetails;
            if (flag == 5)
            {
                this.xrLabelDataName.Text = Properties.Resources.GZZhiShi;
            }
            else if (flag == 4)
            {
                this.xrLabelDataName.Text = Properties.Resources.ZZJiaGong;

                this.lbl_PageSign.Text = "QR8-06-09-1";
            }
            this.xrLabelPrintDate.Text = this.xrLabelPrintDate.Text + DateTime.Now.ToShortDateString();
            if (pronoteHeader.WorkHouse != null)
            {
                this.xrLabelWorkHouse.Text = this.pronoteHeader.WorkHouse.Workhousename;
            }

            Model.MRSdetails mrsdetail = this.mRSDetailsManager.Get(this.pronoteHeader.MRSdetailsId);
            if (mrsdetail != null)
            {
                this.xrLabelBeforepPackage.Text = mrsdetail.BeforePackageProduct == null ? string.Empty : (mrsdetail.BeforePackageProduct.IsCustomerProduct.HasValue && mrsdetail.BeforePackageProduct.IsCustomerProduct.Value ? mrsdetail.BeforePackageProduct.ProductName + "{" + mrsdetail.BeforePackageProduct.CustomerProductName + "}" : mrsdetail.BeforePackageProduct.ProductName);
            }
            else
            {
                this.xrLabelBeforepPackage.Text = string.Empty;
            }
            //生產通知
            this.xrLabelPronoteHeaderID.Text = this.pronoteHeader.PronoteHeaderID;
            this.xrLabelPronoteDte.Text      = this.pronoteHeader.PronoteDate.Value.ToString("yyyy-MM-dd");
            this.xrLabelMRP.Text             = this.pronoteHeader.MRSHeaderId;
            if (this.pronoteHeader.Employee0 != null && flag != 1)
            {
                this.xrLabelEmployee.Text = this.pronoteHeader.Employee0.EmployeeName;
            }
            this.xrLabel14.Text = this.pronoteHeader.AuditEmp == null ? "" : this.pronoteHeader.AuditEmp.EmployeeName;
            if (pronoteHeader.Product != null)
            {
                this.xrLabelProductName.Text = pronoteHeader.Product.ProductName + "    版次:" + pronoteHeader.Product.ProductVersion;
                if (string.IsNullOrEmpty(pronoteHeader.Product.CustomerProductName))
                {
                    this.xrLabelCustomerProductName.Text = new Help().GetCustomerProductNameByPronoteHeaderId(pronoteHeader.PronoteHeaderID, pronoteHeader.ProductId);
                }
                else
                {
                    this.xrLabelCustomerProductName.Text = pronoteHeader.Product.CustomerProductName;
                }
                this.xrRichTextProDesc.Rtf = this.pronoteHeader.Product.ProductDescription;

                //商品正侧唛单独划分出一张表 2021年7月18日20:28:12
                //if (this.pronoteHeader.Product.AttrZhengMai != null)
                //    this.RichTextZhengMai.Rtf = this.pronoteHeader.Product.AttrZhengMai;
                //if (this.pronoteHeader.Product.AttrCeMai != null)
                //    this.RichTextCeMai.Rtf = this.pronoteHeader.Product.AttrCeMai;
                Model.ProductMark mark = new BL.ProductMarkManager().SelectByProductId(this.pronoteHeader.ProductId);
                if (mark != null)
                {
                    if (!string.IsNullOrEmpty(mark.MainMark))
                    {
                        this.RichTextZhengMai.Rtf = mark.MainMark;
                    }

                    if (!string.IsNullOrEmpty(mark.SideMark))
                    {
                        this.RichTextCeMai.Rtf = mark.SideMark;
                    }
                }
            }
            Model.InvoiceXO xo = new BL.InvoiceXOManager().Get(this.pronoteHeader.InvoiceXOId);
            if (xo != null)
            {
                this.xrLabelCheckedStandard.Text = xo.xocustomer.CheckedStandard;
                this.xrLabelCustomer.Text        = xo.xocustomer.CustomerShortName;
                this.xrLabelCustomerXOId.Text    = xo.CustomerInvoiceXOId;
                this.xrLabelPiHao.Text           = xo.CustomerLotNumber;
                this.xrLabelXOJHDate.Text        = xo.InvoiceYjrq.Value.ToString("yyyy-MM-dd");

                if (xo.xocustomer != null && !string.IsNullOrEmpty(xo.xocustomer.CheckedStandard))
                {
                    if (xo.xocustomer.CheckedStandard.ToLower().Contains("jis") && xo.xocustomer.CustomerFullName.ToUpper().Contains("MIDORI"))
                    {
                        //CreateTagLable("JIS");

                        this.lbl_JIS.Text = "JIS";
                    }
                    else if (xo.xocustomer.CheckedStandard.ToLower().Contains("as"))
                    {
                        //CreateTagLable("AS");

                        this.lbl_JIS.Text = "AS";
                    }
                }
            }
            this.xrLabelCount.Text        = pronoteHeader.DetailsSum.ToString();
            this.xrLabelUnit.Text         = pronoteHeader.ProductUnit;
            this.xrLabelPronotedesc.Text  = this.pronoteHeader.Pronotedesc;
            this.lbl_ProduceMaterial.Text = this.pronoteHeader.Materialprocessum == null ? "" : this.pronoteHeader.Materialprocessum.ToString();

            //if (this.pronoteHeader.DetailProcedures != null && this.pronoteHeader.DetailProcedures.Count > 0)
            //{
            //    this.pronoteHeader.DetailProcedures = this.pronoteHeader.DetailProcedures.OrderByDescending(p => p.PronoteProceduresDate).ToList();

            //    if (this.pronoteHeader.DetailProcedures.First().WorkHouse != null)
            //        this.xrLabelhouseId.Text = this.pronoteHeader.DetailProcedures.First().WorkHouse.Workhousename;
            //}
            this.lblInvoiceXODetailQuantity.Text = this.pronoteHeader.InvoiceXODetailQuantity == null ? "0" : this.pronoteHeader.InvoiceXODetailQuantity.ToString();


            this.xrSubreport1.ReportSource = new RO1();
            this.xrSubreport2.ReportSource = new RO2();
        }
コード例 #10
0
ファイル: RO3.cs プロジェクト: daobataotie/Mobe
        public RO3(string pronoteHeaderId, int flag)
        {
            InitializeComponent();
            this.pronoteHeader = this.pronoteHeaderManager.Get(pronoteHeaderId);

            if (this.pronoteHeader == null)
            {
                return;
            }

            this.pronoteHeader.DetailProcedures = this.pronoteProceduresDetailManager.GetPronotedetailsMaterialByHeaderId(this.pronoteHeader);

            if (this.pronoteHeader.DetailProcedures != null)
            {
                foreach (Model.PronoteProceduresDetail detail in this.pronoteHeader.DetailProcedures)
                {
                    this.machineList = this.pronoteMachineManager.GetPronoteMachineByPronoteProceduresDetailId(detail.PronoteProceduresDetailId);
                    {
                        foreach (Model.PronoteMachine machine in machineList)
                        {
                            if (machineList.IndexOf(machine) == machineList.Count - 1)
                            {
                                detail.Machine += machine.PronoteMachineName;
                            }
                            else
                            {
                                detail.Machine += machine.PronoteMachineName + ",";
                            }
                            //this.proceManager.Insert(promachine);
                        }
                    }
                }
            }
            this.DataSource = this.pronoteHeader.DetailProcedures;

            //CompanyInfo
            this.xrLabelCompanyInfoName.Text = BL.Settings.CompanyChineseName;
            this.xrLabelDataName.Text        = Properties.Resources.ProducePronoteName;

            if (flag == 1)
            {
                this.xrLabelDataName.Text = Properties.Resources.GZZhiShi;
            }
            else if (flag == 2)
            {
                this.xrLabelDataName.Text = Properties.Resources.ZZJiaGong;
            }
            this.xrLabelPrintDate.Text = this.xrLabelPrintDate.Text + DateTime.Now.ToString("yyyy-MM-dd");
            //生產通知
            this.xrLabelPronoteHeaderID.Text = this.pronoteHeader.PronoteHeaderID;
            this.xrLabelPronoteDte.Text      = this.pronoteHeader.PronoteDate.Value.ToString("yyyy-MM-dd");
            this.xrRichTextProDesc.Rtf       = this.pronoteHeader.Product.ProductDescription;
            Model.MRSdetails mrsdetail = this.mRSDetailsManager.Get(this.pronoteHeader.MRSdetailsId);
            if (mrsdetail != null)
            {
                this.xrLabelBeforepPackage.Text = mrsdetail.BeforePackageProduct == null ? string.Empty : (mrsdetail.BeforePackageProduct.IsCustomerProduct.HasValue && mrsdetail.BeforePackageProduct.IsCustomerProduct.Value ? mrsdetail.BeforePackageProduct.ProductName + "{" + mrsdetail.BeforePackageProduct.CustomerProductName + "}" : mrsdetail.BeforePackageProduct.ProductName);
            }
            else
            {
                this.xrLabelBeforepPackage.Text = string.Empty;
            }
            if (pronoteHeader.WorkHouse != null)
            {
                this.xrLabelWorkHouse.Text = this.pronoteHeader.WorkHouse.Workhousename;
            }

            if (this.pronoteHeader.Employee0 != null)
            {
                this.xrLabelEmployee0.Text = this.pronoteHeader.Employee0.EmployeeName;
            }
            if (pronoteHeader.Product != null)
            {
                // this.xrLabelProductId.Text = pronoteHeader.Product.Id;
                this.xrLabelProductName.Text         = pronoteHeader.Product.ProductName;
                this.xrLabelCustomerProductName.Text = pronoteHeader.Product.CustomerProductName;
            }
            Model.InvoiceXO xo = new BL.InvoiceXOManager().Get(this.pronoteHeader.InvoiceXOId);
            if (xo != null)
            {
                this.xrLabelCustomer.Text        = xo.xocustomer.CustomerShortName;
                this.xrLabelCheckedStandard.Text = xo.xocustomer.CheckedStandard;
                this.xrLabelCustomerXOId.Text    = xo.CustomerInvoiceXOId;
                this.xrLabelXOJHDate.Text        = xo.InvoiceYjrq.Value.ToString("yyyy-MM-dd");
            }
            this.xrLabelCount.Text       = pronoteHeader.DetailsSum.ToString();
            this.xrLabelUnit.Text        = pronoteHeader.ProductUnit;
            this.xrLabelPronotedesc.Text = this.pronoteHeader.Pronotedesc;
            //this.xrLabelMachine.Text=

            //明细
            this.xrTableCellPronoteProceduresDate.DataBindings.Add("Text", this.DataSource, Model.PronoteProceduresDetail.PRO_PronoteProceduresDate, "{0:yyyy-MM-dd}");
            //this.xrTableCellProceduresNo.DataBindings.Add("Text", this.DataSource,Model.PronoteProceduresDetail.PRO_ProceduresNo);

            this.xrTableCellWorkHouseId.DataBindings.Add("Text", this.DataSource, "WorkHouse." + Model.WorkHouse.PROPERTY_WORKHOUSENAME);
            this.xrTableCellSupplierId.DataBindings.Add("Text", this.DataSource, "Supplier." + Model.Supplier.PROPERTY_SUPPLIERSHORTNAME);
            this.xrTableCellPronoteYingQuantity.DataBindings.Add("Text", this.DataSource, Model.PronoteProceduresDetail.PRO_PronoteYingQuantity);
            //this.xrTableCellFulfillQuantity.DataBindings.Add("Text", this.DataSource, Model.PronoteProceduresDetail.PRO_FulfillQuantity);
            //this.xrTableCellDeposeQuantity.DataBindings.Add("Text", this.DataSource,  Model.PronoteProceduresDetail.PRO_DeposeQuantity);
            //this.xrTableCellcheckQuantity.DataBindings.Add("Text", this.DataSource, Model.PronoteProceduresDetail.PRO_checkQuantity);
            //this.xrTableCellLossQuantity.DataBindings.Add("Text", this.DataSource, Model.PronoteProceduresDetail.PRO_LossQuantity);
            this.xrRichText1.DataBindings.Add("Rtf", this.DataSource, "Procedures." + Model.Procedures.PRO_Procedurename);
            this.xrTableCell12.DataBindings.Add("Text", this.DataSource, "Procedures." + Model.Procedures.PRO_Proceduredescription);
            this.xrTableCellNO.DataBindings.Add("Text", this.DataSource, Model.PronoteProceduresDetail.PRO_ProceduresNo);
            this.xrTableCellMachine.DataBindings.Add("Text", this.DataSource, Model.PronoteProceduresDetail.PRO_Machine);
        }
コード例 #11
0
        public RO(string pronoteHeaderId, int flag)
        {
            InitializeComponent();
            this.pronoteHeader = this.pronoteHeaderManager.GetDetails(pronoteHeaderId);

            //CompanyInfo
            this.xrLabelCompanyInfoName.Text = BL.Settings.CompanyChineseName;
            //this.xrLabelDataName.Text = Properties.Resources.Pronotedetails;
            if (flag == 5)
            {
                this.xrLabelDataName.Text = Properties.Resources.GZZhiShi;
            }
            else if (flag == 4)
            {
                this.xrLabelDataName.Text = Properties.Resources.ZZJiaGong;
                this.lbl_PageSign.Text    = "QR8-06-09-1";
            }
            this.xrLabelPrintDate.Text = this.xrLabelPrintDate.Text + DateTime.Now.ToString("yyyy-MM-dd");
            if (pronoteHeader.WorkHouse != null)
            {
                this.xrLabelWorkHouse.Text = this.pronoteHeader.WorkHouse.Workhousename;
            }

            Model.MRSdetails mrsdetail = this.mRSDetailsManager.Get(this.pronoteHeader.MRSdetailsId);
            if (mrsdetail != null)
            {
                this.xrLabelBeforepPackage.Text = mrsdetail.BeforePackageProduct == null ? string.Empty : (mrsdetail.BeforePackageProduct.IsCustomerProduct.HasValue && mrsdetail.BeforePackageProduct.IsCustomerProduct.Value ? mrsdetail.BeforePackageProduct.ProductName + "{" + mrsdetail.BeforePackageProduct.CustomerProductName + "}" : mrsdetail.BeforePackageProduct.ProductName);
                //this.lblPlanNum.Text = mrsdetail.MRSdetailsQuantity.ToString();
            }
            else
            {
                this.xrLabelBeforepPackage.Text = string.Empty;
            }

            //生產通知
            this.xrLabelPronoteHeaderID.Text = this.pronoteHeader.PronoteHeaderID;
            this.xrLabelPronoteDte.Text      = this.pronoteHeader.PronoteDate.Value.ToString("yyyy-MM-dd");
            this.xrLabelMRP.Text             = this.pronoteHeader.MRSHeaderId;
            this.lblBGHandBookId.Text        = this.pronoteHeader.HandbookId;
            this.lblBGHandBookDetailId.Text  = this.pronoteHeader.HandbookProductId;
            this.lblPlanNum.Text             = this.pronoteHeader.InvoiceXODetailQuantity.HasValue ? this.pronoteHeader.InvoiceXODetailQuantity.Value.ToString() : "";

            if (this.pronoteHeader.Employee0 != null && flag != 1)
            {
                this.xrLabelEmployee.Text = this.pronoteHeader.Employee0.EmployeeName;
            }
            if (pronoteHeader.Product != null)
            {
                this.xrLabelProductName.Text = pronoteHeader.Product.ProductName;
                this.lbl_Pro_Id.Text         = pronoteHeader.Product.Id;

                if (string.IsNullOrEmpty(pronoteHeader.Product.CustomerProductName))
                {
                    this.xrLabelCustomerProductName.Text = CommonHelp.GetCustomerProductNameByPronoteHeaderId(pronoteHeader, pronoteHeader.ProductId, pronoteHeader.HandbookProductId);
                }
                else
                {
                    this.xrLabelCustomerProductName.Text = pronoteHeader.Product.CustomerProductName;
                }

                this.xrRichTextProDesc.Rtf = this.pronoteHeader.Product.ProductDescription;

                //商品正侧唛单独划分出一张表 2021年8月22日22:53:53
                //if (this.pronoteHeader.Product.AttrZhengMai != null)
                //    this.RichTextZhengMai.Rtf = this.pronoteHeader.Product.AttrZhengMai;
                //if (this.pronoteHeader.Product.AttrCeMai != null)
                //    this.RichTextCeMai.Rtf = this.pronoteHeader.Product.AttrCeMai;
                Model.ProductMark mark = new BL.ProductMarkManager().SelectByProductId(this.pronoteHeader.ProductId);
                if (mark != null)
                {
                    if (!string.IsNullOrEmpty(mark.MainMark))
                    {
                        this.RichTextZhengMai.Rtf = mark.MainMark;
                    }

                    if (!string.IsNullOrEmpty(mark.SideMark))
                    {
                        this.RichTextCeMai.Rtf = mark.SideMark;
                    }
                }
            }
            Model.InvoiceXO xo = new BL.InvoiceXOManager().Get(this.pronoteHeader.InvoiceXOId);
            if (xo != null)
            {
                this.xrLabelCheckedStandard.Text = xo.xocustomer.CheckedStandard;
                this.xrLabelCustomer.Text        = xo.xocustomer.CustomerShortName;
                this.xrLabelCustomerXOId.Text    = xo.CustomerInvoiceXOId;
                this.xrLabelPiHao.Text           = xo.CustomerLotNumber;
                this.xrLabelXOJHDate.Text        = xo.InvoiceYjrq.Value.ToString("yyyy-MM-dd");
            }
            this.xrLabelCount.Text       = pronoteHeader.DetailsSum.ToString();
            this.xrLabelUnit.Text        = pronoteHeader.ProductUnit;
            this.xrLabelPronotedesc.Text = this.pronoteHeader.Pronotedesc;

            //if (this.pronoteHeader.DetailProcedures != null && this.pronoteHeader.DetailProcedures.Count > 0)
            //{
            //    this.pronoteHeader.DetailProcedures = this.pronoteHeader.DetailProcedures.OrderByDescending(p => p.PronoteProceduresDate).ToList();

            //    if (this.pronoteHeader.DetailProcedures.First().WorkHouse != null)
            //        this.xrLabelhouseId.Text = this.pronoteHeader.DetailProcedures.First().WorkHouse.Workhousename;
            //}


            this.xrSubreport1.ReportSource = new RO1();
            this.xrSubreport2.ReportSource = new RO2();
        }
コード例 #12
0
ファイル: ROJGZHishi.cs プロジェクト: daobataotie/EDERP
        public ROJGZHishi(string pronoteHeaderId, int flag)
        {
            InitializeComponent();
            this.pronoteHeader = this.pronoteHeaderManager.GetDetails(pronoteHeaderId);

            //CompanyInfo
            this.xrLabelCompanyInfoName.Text = BL.Settings.CompanyChineseName;
            this.xrLabelDataName.Text        = Properties.Resources.Pronotedetails;
            if (flag == 5)
            {
                this.xrLabelDataName.Text = Properties.Resources.GZZhiShi;
            }
            else if (flag == 4)
            {
                this.xrLabelDataName.Text = Properties.Resources.ZZJiaGong;
            }
            this.xrLabelPrintDate.Text = this.xrLabelPrintDate.Text + DateTime.Now.ToShortDateString();
            if (pronoteHeader.WorkHouse != null)
            {
                this.xrLabelWorkHouse.Text = this.pronoteHeader.WorkHouse.Workhousename;
            }

            Model.MRSdetails mrsdetail = this.mRSDetailsManager.Get(this.pronoteHeader.MRSdetailsId);
            if (mrsdetail != null)
            {
                this.xrLabelBeforepPackage.Text = mrsdetail.BeforePackageProduct == null ? string.Empty : (mrsdetail.BeforePackageProduct.IsCustomerProduct.HasValue && mrsdetail.BeforePackageProduct.IsCustomerProduct.Value ? mrsdetail.BeforePackageProduct.ProductName + "{" + mrsdetail.BeforePackageProduct.CustomerProductName + "}" : mrsdetail.BeforePackageProduct.ProductName);
            }
            else
            {
                this.xrLabelBeforepPackage.Text = string.Empty;
            }
            //生產通知
            this.xrLabelPronoteHeaderID.Text = this.pronoteHeader.PronoteHeaderID;
            this.xrLabelPronoteDte.Text      = this.pronoteHeader.PronoteDate.Value.ToString("yyyy-MM-dd");
            this.xrLabelMRP.Text             = this.pronoteHeader.MRSHeaderId;
            if (this.pronoteHeader.Employee0 != null && flag != 1)
            {
                this.xrLabelEmployee.Text = this.pronoteHeader.Employee0.EmployeeName;
            }
            this.xrLabel14.Text = this.pronoteHeader.AuditEmp == null ? "" : this.pronoteHeader.AuditEmp.EmployeeName;
            if (pronoteHeader.Product != null)
            {
                this.xrLabelProductName.Text = pronoteHeader.Product.ProductName;
                if (string.IsNullOrEmpty(pronoteHeader.Product.CustomerProductName))
                {
                    this.xrLabelCustomerProductName.Text = new Help().GetCustomerProductNameByPronoteHeaderId(pronoteHeader.PronoteHeaderID, pronoteHeader.ProductId);
                }
                else
                {
                    this.xrLabelCustomerProductName.Text = pronoteHeader.Product.CustomerProductName;
                }
                this.xrRichTextProDesc.Rtf = this.pronoteHeader.Product.ProductDescription;
            }
            Model.InvoiceXO xo = new BL.InvoiceXOManager().Get(this.pronoteHeader.InvoiceXOId);
            if (xo != null)
            {
                this.xrLabelCheckedStandard.Text = xo.xocustomer.CheckedStandard;
                this.xrLabelCustomer.Text        = xo.xocustomer.CustomerShortName;
                this.xrLabelCustomerXOId.Text    = xo.CustomerInvoiceXOId;
                if (flag != 0)
                {
                    this.xrLabelPiHao.Text = xo.CustomerLotNumber;

                    if (flag != 5)
                    {
                        this.xrLabelXOJHDate.Text = xo.InvoiceYjrq.Value.ToString("yyyy-MM-dd");   //生产加工单和加工指示单 不显示交期
                    }
                }

                if (xo.xocustomer != null && !string.IsNullOrEmpty(xo.xocustomer.CheckedStandard))
                {
                    if (xo.xocustomer.CheckedStandard.ToLower().Contains("jis") && xo.xocustomer.CustomerFullName.ToUpper().Contains("MIDORI"))
                    {
                        //CreateTagLable("JIS");

                        this.lbl_JIS.Text = "JIS";
                    }
                    else if (xo.xocustomer.CheckedStandard.ToLower().Contains("as"))
                    {
                        //CreateTagLable("AS");

                        this.lbl_JIS.Text = "AS";
                    }
                }
            }
            this.xrLabelCount.Text       = pronoteHeader.DetailsSum.ToString();
            this.xrLabelUnit.Text        = pronoteHeader.ProductUnit;
            this.xrLabelPronotedesc.Text = this.pronoteHeader.Pronotedesc;
            this.lbl_MaterialSum.Text    = this.pronoteHeader.Materialprocessum == null ? "" : this.pronoteHeader.Materialprocessum.ToString();
            //this.lblChakuang.Text = this.pronoteHeader.Chakuang;
            //this.lblPaihe.Text = this.pronoteHeader.Paihe;
            //this.lblMoshu.Text = this.pronoteHeader.Moshu;
            //if (this.pronoteHeader.DetailProcedures != null && this.pronoteHeader.DetailProcedures.Count > 0)
            //{
            //    this.pronoteHeader.DetailProcedures = this.pronoteHeader.DetailProcedures.OrderByDescending(p => p.PronoteProceduresDate).ToList();

            //    if (this.pronoteHeader.DetailProcedures.First().WorkHouse != null)
            //        this.xrLabelhouseId.Text = this.pronoteHeader.DetailProcedures.First().WorkHouse.Workhousename;
            //}


            this.xrSubreport1.ReportSource = new RO1();
            this.xrSubreport2.ReportSource = new RO2();
        }
コード例 #13
0
 public void Update(Model.MRSdetails e)
 {
     this.Update <Model.MRSdetails>(e);
 }
コード例 #14
0
 public void Insert(Model.MRSdetails e)
 {
     this.Insert <Model.MRSdetails>(e);
 }