示例#1
0
        //加工单查看
        private void repositoryItemHyperLinkEdit1_Click(object sender, EventArgs e)
        {
            string pronoteHeaderid = (this.bindingSource1.Current as Model.ProduceInDepotDetail).PronoteHeaderId;

            Model.PronoteHeader d = new BL.PronoteHeaderManager().Get(pronoteHeaderid);
            if (d != null)
            {
                PronoteHeader.EditForm f = new Book.UI.produceManager.PronoteHeader.EditForm(d);
                f.ShowDialog();
            }
        }
示例#2
0
        public RO(string produceMaterialExitId)
        {
            InitializeComponent();
            this.produceMaterialExit = this.produceMaterialExitManager.Get(produceMaterialExitId);

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

            this.produceMaterialExit.Detail = this.produceMaterialExitDetailManager.Select(this.produceMaterialExit);

            this.DataSource = this.produceMaterialExit.Detail;

            //CompanyInfo
            this.xrLabelCompanyInfoName.Text = BL.Settings.CompanyChineseName;
            this.xrLabelDataName.Text        = Properties.Resources.ProduceMaterialExitDetail;
            this.xrLabelDate.Text           += DateTime.Now.ToShortDateString();
            //生產退料
            this.xrLabelPronoteHeader.Text           = this.produceMaterialExit.PronoteHeaderID;
            this.xrLabelDepot.Text                   = this.produceMaterialExit.Depot == null ? string.Empty : this.produceMaterialExit.Depot.ToString();
            this.lblSupplier.Text                    = this.produceMaterialExit.Supplier == null ? string.Empty : this.produceMaterialExit.Supplier.ToString();
            this.xrLabelProduceExitMaterialId.Text   = this.produceMaterialExit.ProduceMaterialExitId;
            this.xrLabelProduceExitMaterialDate.Text = this.produceMaterialExit.ProduceExitMaterialDate.Value.ToString("yyyy-MM-dd");
            //客戶訂單編號
            this.xrLabelInvoiceCusXoId.Text = this.produceMaterialExit.CustomerInvoiceXOId;
            if (this.produceMaterialExit.Employee0 != null)
            {
                this.xrLabelEmployee0.Text = this.produceMaterialExit.Employee0.EmployeeName;
            }
            if (this.produceMaterialExit.WorkHouse != null)
            {
                this.xrLabelDepartment.Text = this.produceMaterialExit.WorkHouse.Workhousename;
            }
            this.xrLabelProduceExitMaterialDesc.Text = this.produceMaterialExit.ProduceExitMaterialDesc;
            if (!string.IsNullOrEmpty(this.produceMaterialExit.PronoteHeaderID))
            {
                Model.PronoteHeader mPH = new BL.PronoteHeaderManager().Get(this.produceMaterialExit.PronoteHeaderID);
                if (mPH != null)
                {
                    this.lblZhuJianProductName.Text = mPH.Product.ToString();
                }
            }

            //明细
            this.xrTableCell1ProductId.DataBindings.Add("Text", this.DataSource, Model.ProduceMaterialExitDetail.PRO_Inumber);
            this.xrTableproductName.DataBindings.Add("Text", this.DataSource, "Product." + Model.Product.PRO_ProductName);
            this.xrDepotPosi.DataBindings.Add("Text", this.DataSource, "DepotPosition." + Model.DepotPosition.PROPERTY_ID);
            this.xrUnit.DataBindings.Add("Text", this.DataSource, Model.ProduceMaterialExitDetail.PRO_ProductUnit);
            this.xrTableProduceQuantity.DataBindings.Add("Text", this.DataSource, Model.ProduceMaterialExitDetail.PRO_ProduceQuantity);
            this.xrTableGuiGe.DataBindings.Add("Text", this.DataSource, "Product." + Model.Product.PRO_ProductSpecification);
            this.xrProductioinBatch.DataBindings.Add("Text", this.DataSource, Model.ProduceMaterialExitDetail.PRO_ProductioinBatch);
        }
示例#3
0
文件: XR.cs 项目: daobataotie/EDERP
        public XR(string ProduceStatisticsId)
        {
            InitializeComponent();
            this.produceStatistics = this.produceStatisticsManager.Get(ProduceStatisticsId);

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

            this.produceStatistics.Details = this.produceStatisticsdetailsManager.Select(this.produceStatistics);

            this.DataSource = this.produceStatistics.Details;

            this.xrLabelCompanyInfoName.Text = BL.Settings.CompanyChineseName;
            this.xrLabelDataName.Text        = Properties.Resources.ProduceNums;
            this.xrLabelPrintDate.Text      += DateTime.Now.ToShortDateString();



            this.xrLabelProduceStatisticsDate.Text = this.produceStatistics.ProduceStatisticsDate.Value.ToString("yyyy-MM-dd");
            this.xrLabelProduceStatisticsId.Text   = this.produceStatistics.ProduceStatisticsId;

            if (this.produceStatistics.Employee != null)
            {
                this.xrLabelEmployeeId.Text = this.produceStatistics.Employee.EmployeeName;
            }

            if (this.produceStatistics.WorkHouse != null)
            {
                this.xrLabelWorkHouseId.Text = this.produceStatistics.WorkHouse.Workhousename;
            }
            this.xrLabelPronoteHeaderID.Text = this.produceStatistics.PronoteHeaderID;

            if (!string.IsNullOrEmpty(this.produceStatistics.PronoteHeaderID))
            {
                Model.PronoteHeader pronoteHeader = new BL.PronoteHeaderManager().Get(this.produceStatistics.PronoteHeaderID);
                if (pronoteHeader != null)
                {
                    Model.InvoiceXO invoiceXO = new BL.InvoiceXOManager().Get(pronoteHeader.InvoiceXOId);
                    this.xrLabelCustomerXoId.Text = invoiceXO == null ? string.Empty : invoiceXO.CustomerInvoiceXOId;
                    if (pronoteHeader.Product != null)
                    {
                        this.xrLabelProductId.Text   = pronoteHeader.Product.Id;
                        this.xrLabelProductName.Text = pronoteHeader.Product.ProductName;
                        this.xrRichText3.Rtf         = pronoteHeader.Product.ProductDescription;
                    }
                }
            }
            else
            {
                this.xrLabelCustomerXoId.Text = string.Empty;
            }
            if (this.produceStatistics.Procedures != null)
            {
                this.xrLabelProceduresId.Text = this.produceStatistics.Procedures.Id;
                this.xrRichText1.Rtf          = this.produceStatistics.Procedures.Procedurename;
            }
            this.xrLabelDescription.Text = this.produceStatistics.Description;
            //Ã÷ϸ
            this.xrTableCellDate.DataBindings.Add("Text", this.DataSource, Model.ProduceStatisticsDetail.PRO_DetailDate, "{0:yyyy-MM-dd}");
            this.xrTableCellType.DataBindings.Add("Text", this.DataSource, Model.ProduceStatisticsDetail.PRO_BusinessHoursType);


            this.xrTableCellEllo.DataBindings.Add("Text", this.DataSource, "Employee0." + Model.Employee.PROPERTY_EMPLOYEENAME);
            this.xrTableCellElpple.DataBindings.Add("Text", this.DataSource, "Employee." + Model.Employee.PROPERTY_EMPLOYEENAME);
            this.xrTableCellPcount.DataBindings.Add("Text", this.DataSource, Model.ProduceStatisticsDetail.PRO_ProduceQuantity);
            this.xrTableCellHege.DataBindings.Add("Text", this.DataSource, Model.ProduceStatisticsDetail.PRO_HeGeQuantity);
            this.xrTableCellNoPcount.DataBindings.Add("Text", this.DataSource, Model.ProduceStatisticsDetail.PRO_RejectionRate);
            this.xrTableCelldescription.DataBindings.Add("Text", this.DataSource, Model.ProduceStatisticsDetail.PRO_Description);
            this.xrTableCellUpdatDate.DataBindings.Add("Text", this.DataSource, Model.ProduceStatisticsDetail.PRO_UpdateTime, "{0:yyyy-MM-dd}");


            this.xrTableCell25.DataBindings.Add("Text", this.DataSource, Model.ProduceStatisticsDetail.PRO_HeiDian);
            this.xrTableCell26.DataBindings.Add("Text", this.DataSource, Model.ProduceStatisticsDetail.PRO_Zazhi);
            this.xrTableCell27.DataBindings.Add("Text", this.DataSource, Model.ProduceStatisticsDetail.PRO_JingDian);
            this.xrTableCell28.DataBindings.Add("Text", this.DataSource, Model.ProduceStatisticsDetail.PRO_ChaShang);
            this.xrTableCell29.DataBindings.Add("Text", this.DataSource, Model.ProduceStatisticsDetail.PRO_FuMo);
            this.xrTableCell30.DataBindings.Add("Text", this.DataSource, Model.ProduceStatisticsDetail.PRO_SuoShui);
            this.xrTableCell31.DataBindings.Add("Text", this.DataSource, Model.ProduceStatisticsDetail.PRO_GuoHuo);
            this.xrTableCell32.DataBindings.Add("Text", this.DataSource, Model.ProduceStatisticsDetail.PRO_BaiYan);
            this.xrLabel2.DataBindings.Add("Text", this.DataSource, Model.ProduceStatisticsDetail.PRO_HeiYan);
            this.xrLabel4.DataBindings.Add("Text", this.DataSource, Model.ProduceStatisticsDetail.PRO_JieHeXian);
            this.xrLabel6.DataBindings.Add("Text", this.DataSource, Model.ProduceStatisticsDetail.PRO_HuiWen);
            this.xrLabel8.DataBindings.Add("Text", this.DataSource, Model.ProduceStatisticsDetail.PRO_QiPao);
            this.xrLabel10.DataBindings.Add("Text", this.DataSource, Model.ProduceStatisticsDetail.PRO_LengLiao);
            this.xrLabel12.DataBindings.Add("Text", this.DataSource, Model.ProduceStatisticsDetail.PRO_GuaiShouZhuangShang);
            this.xrLabel14.DataBindings.Add("Text", this.DataSource, Model.ProduceStatisticsDetail.PRO_ChaMoCiShu);
            this.xrLabel16.DataBindings.Add("Text", this.DataSource, Model.ProduceStatisticsDetail.PRO_LiaoDian);
        }
示例#4
0
        public override void Refresh()
        {
            if (this._pcdic == null)
            {
                this.AddNew();
                this.action = "insert";
            }
            else
            {
                if (this.action == "view")
                {
                    this._pcdic = this._pcdicManage.GetDetail(this._pcdic);
                }
            }
            //初始化控件
            this.txtPCDoubleImpactCheckID.Text = this._pcdic.PCDoubleImpactCheckID;
            //this.txtInvoiceCusXOId.Text = this._pcdic.InvoiceCusXOId;
            if (!string.IsNullOrEmpty(this._pcdic.PronoteHeaderId))
            {
                Model.PronoteHeader ph = new BL.PronoteHeaderManager().Get(this._pcdic.PronoteHeaderId);
                if (ph != null)
                {
                    this.txtInvoiceCusXOId.Text = (ph.InvoiceXO == null ? null : ph.InvoiceXO.CustomerInvoiceXOId);
                }
            }
            else
            {
                this.txtInvoiceCusXOId.Text = null;
            }
            this.txtPronoteHeaderId.Text              = this._pcdic.PronoteHeaderId;
            this.txtPCDoubleImpactCheckDesc.Text      = this._pcdic.PCDoubleImpactCheckDesc;
            this.DE_PCDoubleImpactCheckDate.EditValue = this._pcdic.PCDoubleImpactCheckDate.Value;
            this.BEProduct.EditValue     = this._pcdic.Product;
            this.nccEmployee0.EditValue  = this._pcdic.Employee;
            this.txtCheckedStandard.Text = this._pcdic.CheckStandard;
            this.calcPCDoubleImpactCheckCount.EditValue = this._pcdic.PCDoubleImpactCheckCount.HasValue ? this._pcdic.PCDoubleImpactCheckCount.Value : 0;
            this.ceInvoiceXOCount.EditValue             = this._pcdic.InvoiceXOQuantity.HasValue ? this._pcdic.InvoiceXOQuantity.Value : 0;
            this.newChooseContorlAuditEmp.EditValue     = this._pcdic.AuditEmp;
            this.txt_AuditState.EditValue         = this.GetAuditName(this._pcdic.AuditState);
            this.coBoxCJLD.Text                   = string.IsNullOrEmpty(this._pcdic.PowerImpact) ? this.coBoxCJLD.Text : this._pcdic.PowerImpact;
            this.comBox_ChongJICeShiJiaRe.Text    = string.IsNullOrEmpty(this._pcdic.JiaReWenDu) ? this.comBox_ChongJICeShiJiaRe.Text : this._pcdic.JiaReWenDu;
            this.comBox_ChongJICeShiLengDong.Text = string.IsNullOrEmpty(this._pcdic.LengDongWenDu) ? this.comBox_ChongJICeShiLengDong.Text : this._pcdic.LengDongWenDu;
            this.coBoxZQZL.Text                   = string.IsNullOrEmpty(this._pcdic.ZhuiQiuKG) ? this.coBoxZQZL.Text : this._pcdic.ZhuiQiuKG;
            this.coBoxLYBTXX.Text                 = string.IsNullOrEmpty(this._pcdic.PrintHeader) ? this.coBoxLYBTXX.Text : this._pcdic.PrintHeader;
            this.lookUpEditUnit.EditValue         = this._pcdic.ProductUnitId;

            #region LookUpEditor

            DataTable  dt  = new DataTable();
            DataColumn dc  = new DataColumn("id", typeof(string));
            DataColumn dc1 = new DataColumn("name", typeof(string));
            dt.Columns.Add(dc);
            dt.Columns.Add(dc1);
            DataRow dr;
            dr    = dt.NewRow();
            dr[0] = "-1";
            dr[1] = string.Empty;
            dt.Rows.Add(dr);
            dr    = dt.NewRow();
            dr[0] = "0";
            dr[1] = "√";
            dt.Rows.Add(dr);
            dr    = dt.NewRow();
            dr[0] = "1";
            dr[1] = "△";
            dt.Rows.Add(dr);
            dr    = dt.NewRow();
            dr[0] = "2";
            dr[1] = "X";
            dt.Rows.Add(dr);

            for (int i = 0; i < this.gridView1.Columns.Count; i++)
            {
                if (this.gridView1.Columns[i].ColumnEdit is DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit && this.gridView1.Columns[i].Name != "Employee")
                {
                    ((DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit) this.gridView1.Columns[i].ColumnEdit).DataSource = dt;
                    ((DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit) this.gridView1.Columns[i].ColumnEdit).Columns.Clear();
                    ((DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit) this.gridView1.Columns[i].ColumnEdit).Columns.AddRange(new DevExpress.XtraEditors.Controls.LookUpColumnInfo[] {
                        new DevExpress.XtraEditors.Controls.LookUpColumnInfo("name", 25, "标识"),
                    });
                    ((DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit) this.gridView1.Columns[i].ColumnEdit).DisplayMember = "name";
                    ((DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit) this.gridView1.Columns[i].ColumnEdit).ValueMember   = "id";
                }
            }

            #endregion

            this.GirdViewLookUpEditEmployee.DataSource = this.bsLUEemployees;

            this.bindingSource1.DataSource = this._pcdic.Detail;

            base.Refresh();
            switch (this.action)
            {
            case "insert":
                this.gridView1.OptionsBehavior.Editable = true;
                break;

            case "update":
                this.gridView1.OptionsBehavior.Editable = true;
                break;

            case "view":
                this.gridView1.OptionsBehavior.Editable = false;
                break;
            }

            //this.ceInvoiceXOCount.Enabled = false;
            this.txtPCDoubleImpactCheckID.Properties.ReadOnly = true;
            //this.nccEmployee0.Enabled = false;
        }
        //导出Excel
        private void btn_ExportExcel_Click(object sender, EventArgs e)
        {
            SetValue();

            IList <Book.Model.PronoteHeader> listPronoteHeader = new BL.PronoteHeaderManager().GetDataForExcel(condition.StartDate, condition.EndDate, condition.Customer, condition.CusXOId, condition.Product, condition.PronoteHeaderIdStart, condition.PronoteHeaderIdEnd, condition.SourceTpye, null, false, condition.ProNameKey, condition.ProCusNameKey, condition.PronoteHeaderIdKey, false, false, false, condition.HandbookId);

            if (listPronoteHeader == null || listPronoteHeader.Count == 0)
            {
                MessageBox.Show("无数据", "提示", MessageBoxButtons.OK);
                return;
            }

            //转换RTF的商品描述到普通String
            System.Windows.Forms.RichTextBox rtBox = new System.Windows.Forms.RichTextBox();

            foreach (var item in listPronoteHeader)
            {
                rtBox.Rtf        = item.ProductDesc;
                item.ProductDesc = rtBox.Text.Trim();

                //放在这里太耗性能,筛选完“保税”后,在查询 商品型号
                //if (string.IsNullOrEmpty(item.CustomerProductName))
                //{
                //    item.CustomerProductName = new produceManager.Help().GetCustomerProductNameByPronoteHeaderId(item, item.ProductId, item.HandbookProductId);
                //}
            }

            var listPronoteHeaderFilter = this.chk_Baoshui.Checked ? listPronoteHeader.Where(l => l.ProductDesc == "保税") : listPronoteHeader;

            foreach (var item in listPronoteHeaderFilter)
            {
                if (string.IsNullOrEmpty(item.CustomerProductName))
                {
                    item.CustomerProductName = CommonHelp.GetCustomerProductNameByPronoteHeaderId(item, item.ProductId, item.HandbookProductId);
                }
            }

            if (listPronoteHeaderFilter == null || listPronoteHeaderFilter.Count() == 0)
            {
                MessageBox.Show("无数据", "提示", MessageBoxButtons.OK);
                return;
            }


            //根据加工单号查询对应的领料单
            //var listPronoteHeaderIds = listPronoteHeaderFilter.GroupBy(l => l.PronoteHeaderID).Select(g => g.Key);
            //string pronoteHeaderIds = string.Empty;
            //foreach (var item in listPronoteHeaderIds)
            //{
            //    pronoteHeaderIds += "'" + item + "',";
            //}

            //pronoteHeaderIds = pronoteHeaderIds.TrimEnd(',');
            //IList<Model.ProduceMaterialdetails> listProduceMaterialdetails = new BL.ProduceMaterialdetailsManager().GetDataByPronoteHeaders(pronoteHeaderIds);


            try
            {
                Microsoft.Office.Interop.Excel.Application excel = new Microsoft.Office.Interop.Excel.Application();
                excel.Application.Workbooks.Add(true);

                #region 生产加工单

                Microsoft.Office.Interop.Excel.Worksheet sheet = (Microsoft.Office.Interop.Excel.Worksheet)excel.Worksheets[1];
                sheet.Name = "生产加工单";
                Microsoft.Office.Interop.Excel.Range r = sheet.get_Range(sheet.Cells[1, 1], sheet.Cells[1, 16]);
                r.MergeCells = true;

                sheet.Rows.AutoFit();
                sheet.Rows.WrapText       = true;
                sheet.Rows.RowHeight      = 15;
                sheet.Rows.Font.Size      = 9;
                sheet.Columns.ColumnWidth = 13;

                sheet.get_Range(sheet.Cells[2, 1], sheet.Cells[2, 16]).Interior.ColorIndex = 15;    //浅灰色
                sheet.get_Range(sheet.Cells[1, 1], sheet.Cells[2, 16]).HorizontalAlignment = -4108; //居中对齐
                sheet.get_Range(sheet.Cells[1, 1], sheet.Cells[listPronoteHeaderFilter.Count() + 2, 16]).Borders.Value = 1;
                sheet.get_Range(sheet.Cells[3, 4], sheet.Cells[listPronoteHeaderFilter.Count() + 2, 4]).NumberFormat   = "yyyy/MM/dd";
                sheet.get_Range(sheet.Cells[3, 2], sheet.Cells[listPronoteHeaderFilter.Count() + 2, 2]).NumberFormat   = "@";

                sheet.get_Range(sheet.Cells[2, 6], sheet.Cells[2, 6]).ColumnWidth   = 30;
                sheet.get_Range(sheet.Cells[2, 10], sheet.Cells[2, 10]).ColumnWidth = 30;

                sheet.Cells[1, 1] = "生产加工单明细表";

                sheet.Cells[2, 1]  = "客户订单编号";
                sheet.Cells[2, 2]  = "客户型号";
                sheet.Cells[2, 3]  = "加工单编号";
                sheet.Cells[2, 4]  = "通知日期";
                sheet.Cells[2, 5]  = "商品编号";
                sheet.Cells[2, 6]  = "商品名称";
                sheet.Cells[2, 7]  = "订单数量";
                sheet.Cells[2, 8]  = "生产数量";
                sheet.Cells[2, 9]  = "原料编号";
                sheet.Cells[2, 10] = "原料名称";
                sheet.Cells[2, 11] = "领料数量";
                sheet.Cells[2, 12] = "生产站";
                sheet.Cells[2, 13] = "手册号";
                sheet.Cells[2, 14] = "手册项号";
                sheet.Cells[2, 15] = "来源单据";
                sheet.Cells[2, 16] = "描述";

                int row = 3;
                foreach (var item in listPronoteHeaderFilter)
                {
                    sheet.Cells[row, 1]  = item.CustomerInvoiceXOId;
                    sheet.Cells[row, 2]  = item.CustomerProductName;
                    sheet.Cells[row, 3]  = item.PronoteHeaderID;
                    sheet.Cells[row, 4]  = item.PronoteDate;
                    sheet.Cells[row, 5]  = item.Id;
                    sheet.Cells[row, 6]  = item.ProductName;
                    sheet.Cells[row, 7]  = item.InvoiceXODetailQuantity;
                    sheet.Cells[row, 8]  = item.DetailsSum;
                    sheet.Cells[row, 9]  = item.MaterialId;
                    sheet.Cells[row, 10] = item.MaterialName;
                    sheet.Cells[row, 11] = item.MaterialQty;
                    sheet.Cells[row, 12] = item.Workhousename;
                    sheet.Cells[row, 13] = item.HandbookId;
                    sheet.Cells[row, 14] = item.HandbookProductId;
                    sheet.Cells[row, 15] = item.MRSHeaderId;
                    sheet.Cells[row, 16] = item.ProductDesc;


                    row++;
                }

                #endregion


                #region 生产领料

                //if (listProduceMaterialdetails != null && listProduceMaterialdetails.Count > 0)
                //{
                //    excel.Worksheets.Add(Missing.Value, sheet, Missing.Value, Missing.Value);
                //    Microsoft.Office.Interop.Excel.Worksheet sheet2 = (Microsoft.Office.Interop.Excel.Worksheet)excel.Worksheets[2];
                //    sheet2.Name = "生产领料";

                //    sheet2.Rows.AutoFit();
                //    sheet2.Rows.WrapText = true;
                //    sheet2.Rows.RowHeight = 15;
                //    sheet2.Rows.Font.Size = 9;
                //    sheet2.Columns.ColumnWidth = 13;

                //    sheet2.get_Range(sheet2.Cells[1, 1], sheet2.Cells[1, 14]).Interior.ColorIndex = 15;   //浅灰色
                //    sheet2.get_Range(sheet2.Cells[1, 1], sheet2.Cells[1, 14]).HorizontalAlignment = -4108;
                //    sheet2.get_Range(sheet2.Cells[1, 1], sheet2.Cells[listProduceMaterialdetails.Count + 1, 14]).Borders.Value = 1;
                //    sheet2.get_Range(sheet2.Cells[2, 2], sheet2.Cells[listProduceMaterialdetails.Count + 1, 2]).NumberFormat = "yyyy/MM/dd";
                //    sheet2.get_Range(sheet2.Cells[1, 4], sheet2.Cells[1, 4]).ColumnWidth = 30;

                //    sheet2.Cells[1, 1] = "编号";
                //    sheet2.Cells[1, 2] = "领料日期";
                //    sheet2.Cells[1, 3] = "商品编号";
                //    sheet2.Cells[1, 4] = "商品名称";
                //    sheet2.Cells[1, 5] = "客户型号";
                //    sheet2.Cells[1, 6] = "手册号";
                //    sheet2.Cells[1, 7] = "手册项号";
                //    sheet2.Cells[1, 8] = "数量";
                //    sheet2.Cells[1, 9] = "生产站";
                //    sheet2.Cells[1, 10] = "已分配量";
                //    sheet2.Cells[1, 11] = "客户订单编号";
                //    sheet2.Cells[1, 12] = "库存";
                //    sheet2.Cells[1, 13] = "描述";
                //    sheet2.Cells[1, 14] = "来源单据";


                //    int row2 = 2;
                //    foreach (var item in listProduceMaterialdetails)
                //    {
                //        sheet2.Cells[row2, 1] = item.ProduceMaterialID;
                //        sheet2.Cells[row2, 2] = item.ProduceMaterialDate;
                //        sheet2.Cells[row2, 3] = item.PID;
                //        sheet2.Cells[row2, 4] = item.ProductName;
                //        sheet2.Cells[row2, 5] = item.CustomerProductName;
                //        sheet2.Cells[row2, 6] = item.HandbookId;
                //        sheet2.Cells[row2, 7] = item.HandbookProductId;
                //        sheet2.Cells[row2, 8] = item.Materialprocessum;
                //        sheet2.Cells[row2, 9] = item.WorkhouseName;
                //        sheet2.Cells[row2, 10] = item.Distributioned;
                //        sheet2.Cells[row2, 11] = item.CusXOId;
                //        sheet2.Cells[row2, 12] = item.ProductStock;
                //        sheet2.Cells[row2, 13] = item.ProduceMaterialdesc;
                //        sheet2.Cells[row2, 14] = item.PronoteHeaderID;

                //        row2++;
                //    }
                //}

                #endregion


                excel.Visible     = true;//是否打开该Excel文件
                excel.WindowState = XlWindowState.xlMaximized;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Excel未生成完畢,請勿操作,并重新點擊按鈕生成數據!", "提示!", MessageBoxButtons.OK);
                return;
            }
        }
示例#6
0
文件: XR.cs 项目: daobataotie/EDERP
        public XR(string ProduceStatisticsCheckId)
        {
            InitializeComponent();
            this._ProduceStatisticsCheck = this.ProduceStatisticsCheckManager.Get(ProduceStatisticsCheckId);

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

            this._ProduceStatisticsCheck.Details = this.ProduceStatisticsCheckdetailsManager.Select(this._ProduceStatisticsCheck);

            this.DataSource = this._ProduceStatisticsCheck.Details;

            this.xrLabelCompanyInfoName.Text       = BL.Settings.CompanyChineseName;
            this.xrLabelDataName.Text              = Properties.Resources.ProduceCheck;
            this.xrLabelPrintDate.Text            += DateTime.Now.ToShortDateString();
            this.xrLabelProduceStatisticsDate.Text = this._ProduceStatisticsCheck.ProduceStatisticsCheckDate.Value.ToString("yyyy-MM-dd");
            this.xrLabelProduceStatisticsId.Text   = this._ProduceStatisticsCheck.ProduceStatisticsCheckId;

            if (this._ProduceStatisticsCheck.Employee0 != null)
            {
                this.xrLabelEmployeeId.Text = this._ProduceStatisticsCheck.Employee0.EmployeeName;
            }

            if (this._ProduceStatisticsCheck.Employee1 != null)
            {
                this.xrLabel4.Text = this._ProduceStatisticsCheck.Employee1.EmployeeName;
            }
            this.xrLabelPronoteHeaderID.Text = this._ProduceStatisticsCheck.PronoteHeaderID;

            if (!string.IsNullOrEmpty(this._ProduceStatisticsCheck.PronoteHeaderID))
            {
                Model.PronoteHeader pronoteHeader = new BL.PronoteHeaderManager().Get(this._ProduceStatisticsCheck.PronoteHeaderID);
                if (pronoteHeader != null)
                {
                    Model.InvoiceXO invoiceXO = new BL.InvoiceXOManager().Get(pronoteHeader.InvoiceXOId);
                    this.xrLabelCustomerXoId.Text = invoiceXO == null ? string.Empty : invoiceXO.CustomerInvoiceXOId;
                    if (pronoteHeader.Product != null)
                    {
                        this.xrLabelProductId.Text   = pronoteHeader.Product.Id;
                        this.xrLabelProductName.Text = pronoteHeader.Product.ProductName;
                        this.xrRichText3.Rtf         = pronoteHeader.Product.ProductDescription;
                    }
                }
            }
            else
            {
                this.xrLabelCustomerXoId.Text = string.Empty;
            }
            this.xrLabelDescription.Text = this._ProduceStatisticsCheck.Description;
            //Ã÷ϸ
            this.xrTableCellDetailDate.DataBindings.Add("Text", this.DataSource, Model.ProduceStatisticsCheckDetail.PRO_DetailDate, "{0:yyyy-MM-dd}");
            this.xrTableCellBusinessHoursType.DataBindings.Add("Text", this.DataSource, Model.ProduceStatisticsCheckDetail.PRO_BusinessHoursType);


            this.xrTableCellEmployee0Id.DataBindings.Add("Text", this.DataSource, "Employee0." + Model.Employee.PROPERTY_EMPLOYEENAME);
            this.xrTableCellEmployee1Id.DataBindings.Add("Text", this.DataSource, "Employee1." + Model.Employee.PROPERTY_EMPLOYEENAME);
            this.xrTableCellProduceQuantity.DataBindings.Add("Text", this.DataSource, Model.ProduceStatisticsCheckDetail.PRO_ProduceQuantity);
            this.xrTableCellAPian.DataBindings.Add("Text", this.DataSource, Model.ProduceStatisticsCheckDetail.PRO_APian);
            this.xrTableCellBPian.DataBindings.Add("Text", this.DataSource, Model.ProduceStatisticsCheckDetail.PRO_BPian);
            this.xrTableCellCPian.DataBindings.Add("Text", this.DataSource, Model.ProduceStatisticsCheckDetail.PRO_CPian);
            this.xrTableCellFractionDefective.DataBindings.Add("Text", this.DataSource, Model.ProduceStatisticsCheckDetail.PRO_FractionDefective);
        }
示例#7
0
        public RO1(Model.PCDoubleImpactCheck _pcdic)
        {
            InitializeComponent();
            if (_pcdic == null)
            {
                return;
            }

            details         = pcdicdManager.SelectByPCDoubleICId(_pcdic.PCDoubleImpactCheckID);
            this.DataSource = details;
            //this.DataSource = _pcdic.Detail;

            //CompanyInfo
            this.lblCompanyName.Text = BL.Settings.CompanyChineseName;
            switch (_pcdic.PCDoubleImpactCheckType)
            {
            case 0:
                this.lblDataName.Text = Properties.Resources.CSAcjcsd;
                //this.xtcHengWen.Visible = false;
                //this.xtcJiaRe.Visible = false;
                //this.TCattrHotL.Visible = false;
                //this.TCattrHotR.Visible = false;
                //this.TCattrCoolL.Visible = false;
                //this.TCattrCoolR.Visible = false;
                break;

            case 1:
                this.lblDataName.Text = Properties.Resources.BSENcjcsd;
                //this.xtcJIaoLian.Visible = false;
                //this.TCattrJiaoLianL.Visible = false;
                //this.TCattrJiaoLianR.Visible = false;
                break;

            case 2:
                this.lblDataName.Text = Properties.Resources.ASNZScjcsd;
                //this.xtcJIaoLian.Visible = false;
                //this.TCattrJiaoLianL.Visible = false;
                //this.TCattrJiaoLianR.Visible = false;
                //this.xtcHengWen.Visible = false;
                //this.xtcJiaRe.Visible = false;
                //this.TCattrHotL.Visible = false;
                //this.TCattrHotR.Visible = false;
                //this.TCattrCoolL.Visible = false;
                //this.TCattrCoolR.Visible = false;
                break;

            default:
                break;
            }
            this.lblPriteDate.Text += DateTime.Now.ToShortDateString();

            //Control
            this.lblANSIPCImpactCheckID.Text   = _pcdic.PCDoubleImpactCheckID;
            this.lblANSIPCImpactCheckDate.Text = _pcdic.PCDoubleImpactCheckDate.HasValue ? _pcdic.PCDoubleImpactCheckDate.Value.ToShortDateString() : "";
            //this.lblInvoiceCusXOId.Text = _pcdic.InvoiceCusXOId;
            if (!string.IsNullOrEmpty(_pcdic.PronoteHeaderId))
            {
                Model.PronoteHeader ph = new BL.PronoteHeaderManager().Get(_pcdic.PronoteHeaderId);
                if (ph != null)
                {
                    this.lblInvoiceCusXOId.Text = (ph.InvoiceXO == null ? null : ph.InvoiceXO.CustomerInvoiceXOId);
                }
            }
            this.lblPronoteHeaderId.Text          = _pcdic.PronoteHeaderId;
            this.lblProduct.Text                  = _pcdic.Product == null ? "" : _pcdic.Product.ToString();
            this.lblEmployee0.Text                = _pcdic.Employee == null ? "" : _pcdic.Employee.ToString();
            this.RTDescript.Text                  = _pcdic.PCDoubleImpactCheckDesc;
            this.lblCheckStandard.Text            = _pcdic.CheckStandard;
            this.lblChongJiLiDu.Text              = _pcdic.PowerImpact;
            this.lblInvoiceXOQuantity.Text        = _pcdic.InvoiceXOQuantity.HasValue ? _pcdic.InvoiceXOQuantity.ToString() : "";
            this.lblPCDoubleImpactCheckCount.Text = _pcdic.PCDoubleImpactCheckCount.HasValue ? _pcdic.PCDoubleImpactCheckCount.ToString() : "";
            this.lbl_ProductUnit.Text             = _pcdic.ProductUnit == null ? "" : _pcdic.ProductUnit.ToString();
            //Details
            #region 更改详细显示
            foreach (Model.PCDoubleImpactCheckDetail detail in details)
            {
                foreach (var a in detail.GetType().GetProperties())
                {
                    if (a.Name.IndexOf("attr") > -1)
                    {
                        if (a.GetValue(detail, null) != null)
                        {
                            switch (a.GetValue(detail, null).ToString())
                            {
                            case "0":
                                a.SetValue(detail, "√", null);
                                break;

                            case "1":
                                a.SetValue(detail, "△", null);
                                break;

                            case "2":
                                a.SetValue(detail, "X", null);
                                break;

                            case "-1":
                                a.SetValue(detail, " ", null);
                                break;

                            default:
                                break;
                            }
                        }
                    }
                }
            }
            #endregion
            this.TCPCDoubleImpactCheckDetailDate.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_PCDoubleImpactCheckDetailDate, "{0:yyyy-MM-dd}");
            this.TCattrJiaoLianL.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrJiaoLianL);
            this.TCattrJiaoLianR.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrJiaoLianR);
            //this.TCattrJPUpL.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrJPUpL);
            //this.TCattrJPUpR.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrJPUpR);
            //this.TCattrJPDownL.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrJPDownL);
            //this.TCattrJPDownR.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrJPDownR);
            //this.TCattrJPLeftL.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrJPLeftL);
            //this.TCattrJPLeftR.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrJPLeftR);
            //this.TCattrJPRightL.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrJPRightL);
            //this.TCattrJPRightR.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrJPRightR);
            this.TCattrBiZhong.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrBiZhong);
            this.TCattrShangLiangL.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrShangLiangL);
            this.TCattrShangLiangR.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrShangLiangR);
            this.TCattrJPZYL.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrJPZYL);
            this.TCattrJPZYR.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrJPZYR);
            this.TCattrS_SZhongL.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrS_SZhongL);
            this.TCattrS_SZhongR.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrS_SZhongR);
            this.TCattrS_SShangL.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrS_SShangL);
            this.TCattrS_SShangR.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrS_SShangR);
            this.TCattrS_SXiaL.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrS_SXiaL);
            this.TCattrS_SXiaR.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrS_SXiaR);
            //this.TCattrHotL.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrHotL);
            //this.TCattrHotR.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrHotR);
            //this.TCattrCoolL.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrCoolL);
            //this.TCattrCoolR.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrCoolR);
            //this.TCEmployee.DataBindings.Add("Text", this.DataSource, "Employee." + Model.Employee.PROPERTY_EMPLOYEENAME);
            this.TCNote.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.Pro_Note);
        }
示例#8
0
        public RO(string produceMaterialID)
        {
            InitializeComponent();
            this.produceMaterial = this.produceMaterialManager.Get(produceMaterialID);
            if (this.produceMaterial == null)
            {
                return;
            }
            if (this.produceMaterial.SourceType != 1)
            {
                Model.PronoteHeader pheader = ph.Get(produceMaterial.InvoiceId);
                if (pheader != null)
                {
                    this.xrLabelProduct.Text = string.IsNullOrEmpty(pheader.Product.CustomerProductName) ? pheader.Product.ProductName : pheader.Product.ProductName + "{" + pheader.Product.CustomerProductName + "}";
                }
            }
            this.produceMaterial.Details = this.produceMaterialdetailsManager.Select(this.produceMaterial);
            this.DataSource = this.produceMaterial.Details;
            //CompanyInfo
            this.xrLabelCompanyInfoName.Text = BL.Settings.CompanyChineseName;
            this.xrLabelDataName.Text        = Properties.Resources.ProduceMaterialdetails;
            //加工领料
            this.xrLabelProduceMaterialDate.Text = this.produceMaterial.ProduceMaterialDate.Value.ToString("yyyy-MM-dd");
            this.xrBarCodeProduceMaterialID.Text = this.produceMaterial.ProduceMaterialID;
            this.xrLabelInsertTime.Text          = DateTime.Now.ToString("yyyy-MM-dd");
            //if (this.produceMaterial.SourceType == 1)
            //{
            //    this.xrLabelSourceType.Text = "需求計劃";
            //}
            //else { this.xrLabelSourceType.Text = "生產加工"; }
            //this.xrLabelPronoteHeaderID.Text = this.produceMaterial.InvoiceId;
            // this.xrLabelMRP.Text=this.produceMaterial.


            //if (this.produceMaterial.Employee1 != null)
            //{
            //    this.xrLabelEmployee1.Text = this.produceMaterial.Employee1.EmployeeName;
            //}
            if (this.produceMaterial.Employee0 != null)
            {
                this.xrLabelEmployee0.Text = this.produceMaterial.Employee0.EmployeeName;
            }

            if (this.produceMaterial.Employee2 != null)
            {
                this.xrLabelEmployee2.Text = this.produceMaterial.Employee2.EmployeeName;
            }

            if (this.produceMaterial.WorkHouse != null)
            {
                this.xrLabelDepartment.Text = this.produceMaterial.WorkHouse.Workhousename;
            }
            this.xrLabel1ProduceMaterialdesc.Text = this.produceMaterial.ProduceMaterialdesc;
            this.xrLabelProduceMaterialId.Text    = this.produceMaterial.ProduceMaterialID;


            //if (this.produceMaterial.InvoiceXO != null)
            //{
            //    this.xrLabelXOId.Text = invoiceXoManager.Get(this.produceMaterial.InvoiceXO)==null?"":invoiceXoManager.Get(this.produceMaterial.InvoiceXO).CustomerInvoiceXOId;
            //}

            if (this.produceMaterial.SourceType != 1 && !string.IsNullOrEmpty(this.produceMaterial.InvoiceId))
            {
                Model.MRSdetails    mrsdetail     = new Book.Model.MRSdetails();
                Model.PronoteHeader pronoteHeader = new BL.PronoteHeaderManager().Get(this.produceMaterial.InvoiceId);
                if (pronoteHeader != null)
                {
                    mrsdetail = new BL.MRSdetailsManager().Get(pronoteHeader.MRSdetailsId);
                }
                Model.InvoiceXO invoiceXO = new BL.InvoiceXOManager().Get(produceMaterial.InvoiceXOId);
                if (invoiceXO != null)
                {
                    this.xrLabelPiHao.Text = invoiceXO.CustomerLotNumber;
                    foreach (Model.InvoiceXODetail detail in invoiceXO.Details)
                    {
                        if (mrsdetail != null && detail.ProductId == mrsdetail.MadeProductId)
                        {
                            this.xrLabelInvoiceSum.Text = detail.InvoiceXODetailQuantity.Value.ToString("F0");
                        }
                    }
                }
            }
            if (!string.IsNullOrEmpty(this.produceMaterial.InvoiceXOId))
            {
                Model.InvoiceXO invoiceXO = new BL.InvoiceXOManager().Get(produceMaterial.InvoiceXOId);
                if (invoiceXO != null)
                {
                    this.xrLabelXOId.Text = invoiceXO == null ? string.Empty : invoiceXO.CustomerInvoiceXOId;
                }
            }
            //明细

            this.xrTableCell5.DataBindings.Add("Text", this.DataSource, Model.ProduceMaterialdetails.PRO_Inumber);
            //this.xrTableCell1ProductId.DataBindings.Add("Text", this.DataSource, "Product." + Model.Product.PRO_Id);
            this.xrTableCellProductName.DataBindings.Add("Text", this.DataSource, "Product." + Model.Product.PRO_ProductName);

            this.xrTableCusProName.DataBindings.Add("Text", this.DataSource, Model.ProduceMaterialdetails.PRO_Pihao);//后来改批号

            this.xrTableCellQuantity.DataBindings.Add("Text", this.DataSource, Model.ProduceMaterialdetails.PRO_Materialprocessum);

            //this.xrTableHasOutDepot.DataBindings.Add("Text", this.DataSource, Model.ProduceMaterialdetails.PRO_Distributioned, "{0:0.####}");
            // this.xrTableMPSSum.DataBindings.Add("Text", this.DataSource, Model.ProduceMaterialdetails.PRO_MPSDetailsSum, "{0:0.####}");
            this.xrTableCellUnit.DataBindings.Add("Text", this.DataSource, "ProductUnit");
            //this.xrTableCellProductSpecification.DataBindings.Add("Text", this.DataSource, "Product." + Model.Product.PRO_StocksQuantity, "{0:0.####}");
            this.TCDepotStock.DataBindings.Add("Text", this.DataSource, Model.ProduceMaterialdetails.PRO_Pihao);
            // this.xrTableMRP.DataBindings.Add("Text", this.DataSource, Model.ProduceMaterialdetails.PRO_MRSHeaderId);
            // this.xrTableCusXOID.DataBindings.Add("Text", this.DataSource,  Model.ProduceMaterialdetails.PRO_CustomerInvoiceXOId);
            this.TCCustomerProduct.DataBindings.Add("Text", this.DataSource, "Product." + Model.Product.PRO_CustomerProductName);

            this.xrRichText1.DataBindings.Add("Rtf", this.DataSource, "ProductDescription");
            this.TCInvoiceId.DataBindings.Add("Text", this.DataSource, Model.ProduceMaterialdetails.PRO_InvoiceFrom);
            this.TCHandbookId.DataBindings.Add("Text", this.DataSource, Model.ProduceMaterialdetails.PRO_HandbookId);
            this.TCDepotStock.DataBindings.Add("Text", this.DataSource, Model.ProduceMaterialdetails.PRO_DepotStock);
            this.lblStockInvoiceId.DataBindings.Add("Text", this.DataSource, Model.ProduceMaterialdetails.PRO_StockInvoiceId);
        }