예제 #1
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();
        }
예제 #2
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();
        }