//protected override void gridWebGrid_ItemCommand(GridRecord row, string commandName) //{ // if (commandName == "Edit") // { // object obj = this.GetEditObject(row); // if (obj != null) // { // this.SetEditObject(obj); // this.buttonHelper.PageActionStatusHandle(PageActionType.Update); // } // } // else if (commandName == "LinkDetail") // { // string pickNo = row.Items.FindItemByKey("PickNo").Text.Trim(); // //string storageOut = row.Items.FindItemByKey("StorageOut").Text.Trim(); // Response.Redirect(this.MakeRedirectUrl("FCreatePickLineMP.aspx", new string[] { "ACT", "PickNo" }, new string[] { "LinkDetail", pickNo })); // } //} protected override void cmdExport_Click(object sender, EventArgs e) { BenQGuru.eMES.Material.WarehouseFacade _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider); List <string> ca = new List <string>(); XlsPackage xls = new XlsPackage(); IFont font = xls.Black; font.FontHeightInPoints = 10; ICellStyle style = xls.Normal; style.SetFont(font); xls.CreateSheet("盘点统计表"); xls.NewRow(0); xls.Cell(0, "库位", style); xls.Cell(1, "盘点次数", style); xls.Cell(2, "盘点准确率", style); int rowNum = 1; for (int i = 0; i < this.gridWebGrid.Rows.Count; i++) { xls.NewRow(rowNum); string STORAGECODE = this.gridWebGrid.Rows[i].Items.FindItemByKey("STORAGECODE").Text; xls.Cell(0, STORAGECODE, style); string CHECKCOUNT = this.gridWebGrid.Rows[i].Items.FindItemByKey("CHECKCOUNT").Text; xls.Cell(1, CHECKCOUNT, style); string PASSREAT = this.gridWebGrid.Rows[i].Items.FindItemByKey("PASSREAT").Text; xls.Cell(2, PASSREAT, style); rowNum++; } string filename = string.Format("Export_{0}_{1}.{2}", FormatHelper.TODateInt(System.DateTime.Now).ToString(), FormatHelper.TOTimeInt(System.DateTime.Now).ToString(), "xls"); string filepath = string.Format(@"{0}{1}", this.DownloadPhysicalPath, filename); FileStream file = new FileStream(filepath, FileMode.Create, FileAccess.ReadWrite); xls.Save(file); file.Close(); DownLoadFile1(filename); }
//protected override void gridWebGrid_ItemCommand(GridRecord row, string commandName) //{ // if (commandName == "Edit") // { // object obj = this.GetEditObject(row); // if (obj != null) // { // this.SetEditObject(obj); // this.buttonHelper.PageActionStatusHandle(PageActionType.Update); // } // } // else if (commandName == "LinkDetail") // { // string pickNo = row.Items.FindItemByKey("PickNo").Text.Trim(); // //string storageOut = row.Items.FindItemByKey("StorageOut").Text.Trim(); // Response.Redirect(this.MakeRedirectUrl("FCreatePickLineMP.aspx", new string[] { "ACT", "PickNo" }, new string[] { "LinkDetail", pickNo })); // } //} protected override void cmdExport_Click(object sender, EventArgs e) { BenQGuru.eMES.Material.WarehouseFacade _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider); List <string> ca = new List <string>(); XlsPackage xls = new XlsPackage(); IFont font = xls.Black; font.FontHeightInPoints = 10; ICellStyle style = xls.Normal; style.SetFont(font); xls.CreateSheet("到货拒收统计表"); xls.NewRow(0); xls.Cell(0, "入库指令号", style); xls.Cell(1, "SAP单据号", style); xls.Cell(2, "入库类型", style); xls.Cell(3, "供应商代码", style); xls.Cell(4, "供应商名称", style); xls.Cell(5, "库位", style); xls.Cell(6, "初检完成日期", style); xls.Cell(7, "拒收原因", style); int rowNum = 1; ReceiveRejectSummary[] rs = _WarehouseFacade.GetReceiveRejectSummarys(FormatHelper.TODateInt(dateInDateFromQuery.Text), FormatHelper.TODateInt(dateInDateToQuery.Text), this.drpStorageQuery.SelectedValue, this.drpStorageInTypeQuery.SelectedValue); for (int i = 0; i < rs.Length; i++) { xls.NewRow(rowNum); string stno = rs[i].STNO; xls.Cell(0, stno, style); string invNo = rs[i].INVNO; xls.Cell(1, invNo, style); string stType = rs[i].sttype; xls.Cell(2, stType, style); string vendorCode = rs[i].VENDORCODE; xls.Cell(3, vendorCode, style); string VendorName = rs[i].VENDORNAME; xls.Cell(4, VendorName, style); string storageCode = rs[i].STORAGECODE; xls.Cell(5, storageCode, style); string MDATE = FormatHelper.ToDateString(rs[i].MDATE); xls.Cell(6, MDATE, style); string PARAMDESC = rs[i].PARAMDESC; xls.Cell(7, PARAMDESC, style); rowNum++; } string filename = string.Format("Export_{0}_{1}.{2}", FormatHelper.TODateInt(System.DateTime.Now).ToString(), FormatHelper.TOTimeInt(System.DateTime.Now).ToString(), "xls"); string filepath = string.Format(@"{0}{1}", this.DownloadPhysicalPath, filename); FileStream file = new FileStream(filepath, FileMode.Create, FileAccess.ReadWrite); xls.Save(file); file.Close(); DownLoadFile1(filename); }
protected override void cmdExport_Click(object sender, EventArgs e) { BenQGuru.eMES.Material.WarehouseFacade _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider); List <string> ca = new List <string>(); XlsPackage xls = new XlsPackage(); IFont font = xls.Black; font.FontHeightInPoints = 10; ICellStyle style = xls.Normal; style.SetFont(font); xls.CreateSheet("拣货指令变更统计表"); xls.NewRow(0); xls.Cell(0, "拣货任务令号", style); xls.Cell(1, "SAP单据号", style); xls.Cell(2, "出库类型", style); xls.Cell(3, "出库库位", style); xls.Cell(4, "变更次数", style); xls.Cell(5, "下发时间", style); xls.Cell(6, "取消下发时间", style); xls.Cell(7, "创建人", style); int rowNum = 1; if (facade == null) { facade = new WarehouseFacade(base.DataProvider); } PickAlterRecord[] records = this.facade.QueryPickAlters( FormatHelper.TODateInt(dateInDateFromQuery.Text), FormatHelper.TODateInt(dateInDateToQuery.Text)); foreach (PickAlterRecord record in records) { xls.NewRow(rowNum); string pickNo = record.PICKNO; xls.Cell(0, pickNo, style); string invNo = record.INVNO; xls.Cell(1, invNo, style); string PICKTYPE = GetPickTypeName(record.PICKTYPE); xls.Cell(2, PICKTYPE, style); string StorageCode = record.StorageCode; xls.Cell(3, StorageCode, style); int cancelCount = record.CANCELCOUNT; xls.Cell(4, cancelCount, style); string downDate = FormatHelper.TODateTimeString(record.DownDate, record.DownTime); xls.Cell(5, downDate, style); string cancelDate = ShareLib.ShareKit.FormatDateTimeIntStr(record.CANCELDATE); xls.Cell(6, cancelDate, style); string cuser = record.CUSER; xls.Cell(7, cuser, style); rowNum++; } string filename = string.Format("Export_{0}_{1}.{2}", FormatHelper.TODateInt(System.DateTime.Now).ToString(), FormatHelper.TOTimeInt(System.DateTime.Now).ToString(), "xls"); string filepath = string.Format(@"{0}{1}", this.DownloadPhysicalPath, filename); FileStream file = new FileStream(filepath, FileMode.Create, FileAccess.ReadWrite); xls.Save(file); file.Close(); DownLoadFile1(filename); }
//protected override void gridWebGrid_ItemCommand(GridRecord row, string commandName) //{ // if (commandName == "Edit") // { // object obj = this.GetEditObject(row); // if (obj != null) // { // this.SetEditObject(obj); // this.buttonHelper.PageActionStatusHandle(PageActionType.Update); // } // } // else if (commandName == "LinkDetail") // { // string pickNo = row.Items.FindItemByKey("PickNo").Text.Trim(); // //string storageOut = row.Items.FindItemByKey("StorageOut").Text.Trim(); // Response.Redirect(this.MakeRedirectUrl("FCreatePickLineMP.aspx", new string[] { "ACT", "PickNo" }, new string[] { "LinkDetail", pickNo })); // } //} protected override void cmdExport_Click(object sender, EventArgs e) { BenQGuru.eMES.Material.WarehouseFacade _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider); List <string> ca = new List <string>(); XlsPackage xls = new XlsPackage(); IFont font = xls.Black; font.FontHeightInPoints = 10; ICellStyle style = xls.Normal; style.SetFont(font); this.gridHelper.AddColumn("AVERONSHELFPERIOD", "", null); this.gridHelper.AddColumn("ONSHELFVOLUMNTOTAL", "到货初检完成时间", null); this.gridHelper.AddColumn("AVERONSHELFPERIOD", "到货初检执行周期", null); xls.CreateSheet("入库统计表"); xls.NewRow(0); xls.Cell(0, "库位", style); xls.Cell(1, "创建ASN个数", style); xls.Cell(2, "下发ASN个数", style); xls.Cell(3, "平均入库执行周期", style); xls.Cell(4, "到货初检的ASN个数", style); xls.Cell(5, "到货初检总箱数", style); xls.Cell(6, "到货初检总重量", style); xls.Cell(7, "到货初检总体积", style); xls.Cell(8, "平均到货初检周期", style); xls.Cell(9, "平均IQC周期", style); xls.Cell(10, "上架的ASN个数", style); xls.Cell(11, "上架总箱数", style); xls.Cell(12, "上架总重量", style); xls.Cell(13, "上架总体积", style); xls.Cell(14, "平均上架周期", style); int rowNum = 1; for (int i = 0; i < this.gridWebGrid.Rows.Count; i++) { xls.NewRow(rowNum); string StorageCode = this.gridWebGrid.Rows[i].Items.FindItemByKey("StorageCode").Text; xls.Cell(0, StorageCode, style); string ASNCCOUNT = this.gridWebGrid.Rows[i].Items.FindItemByKey("ASNCCOUNT").Text; xls.Cell(1, ASNCCOUNT, style); string ASNDOWNCOUNT = this.gridWebGrid.Rows[i].Items.FindItemByKey("ASNDOWNCOUNT").Text; xls.Cell(2, ASNDOWNCOUNT, style); string AVERINSTORAGEPERIOD = this.gridWebGrid.Rows[i].Items.FindItemByKey("AVERINSTORAGEPERIOD").Text; xls.Cell(3, AVERINSTORAGEPERIOD, style); string ASNRECEIVECOUNT = this.gridWebGrid.Rows[i].Items.FindItemByKey("ASNRECEIVECOUNT").Text; xls.Cell(4, ASNRECEIVECOUNT, style); string RECEIVECARTONNOTOTAL = this.gridWebGrid.Rows[i].Items.FindItemByKey("RECEIVECARTONNOTOTAL").Text; xls.Cell(5, RECEIVECARTONNOTOTAL, style); string RECEIVETOTALWEIGHT = this.gridWebGrid.Rows[i].Items.FindItemByKey("RECEIVETOTALWEIGHT").Text; xls.Cell(6, RECEIVETOTALWEIGHT, style); string RECEIVETOTALVOLUMN = this.gridWebGrid.Rows[i].Items.FindItemByKey("RECEIVETOTALVOLUMN").Text; xls.Cell(7, RECEIVETOTALVOLUMN, style); string AVERRECEIVEPERIOD = this.gridWebGrid.Rows[i].Items.FindItemByKey("AVERRECEIVEPERIOD").Text; xls.Cell(8, AVERRECEIVEPERIOD, style); string AVERIQCPERIOD = this.gridWebGrid.Rows[i].Items.FindItemByKey("AVERIQCPERIOD").Text; xls.Cell(9, AVERIQCPERIOD, style); string ONSHELFASNCOUNT = this.gridWebGrid.Rows[i].Items.FindItemByKey("ONSHELFASNCOUNT").Text; xls.Cell(10, ONSHELFASNCOUNT, style); string ONSHELFCARTONNOTOTAL = this.gridWebGrid.Rows[i].Items.FindItemByKey("ONSHELFCARTONNOTOTAL").Text; xls.Cell(11, ONSHELFCARTONNOTOTAL, style); string ONSHELFWEIGHTTOTAL = this.gridWebGrid.Rows[i].Items.FindItemByKey("ONSHELFWEIGHTTOTAL").Text; xls.Cell(12, ONSHELFWEIGHTTOTAL, style); string ONSHELFVOLUMNTOTAL = this.gridWebGrid.Rows[i].Items.FindItemByKey("ONSHELFVOLUMNTOTAL").Text; xls.Cell(13, ONSHELFVOLUMNTOTAL, style); string AVERONSHELFPERIOD = this.gridWebGrid.Rows[i].Items.FindItemByKey("AVERONSHELFPERIOD").Text; xls.Cell(14, AVERONSHELFPERIOD, style); rowNum++; } string filename = string.Format("Export_{0}_{1}.{2}", FormatHelper.TODateInt(System.DateTime.Now).ToString(), FormatHelper.TOTimeInt(System.DateTime.Now).ToString(), "xls"); string filepath = string.Format(@"{0}{1}", this.DownloadPhysicalPath, filename); FileStream file = new FileStream(filepath, FileMode.Create, FileAccess.ReadWrite); xls.Save(file); file.Close(); DownLoadFile1(filename); }
//protected override void gridWebGrid_ItemCommand(GridRecord row, string commandName) //{ // if (commandName == "Edit") // { // object obj = this.GetEditObject(row); // if (obj != null) // { // this.SetEditObject(obj); // this.buttonHelper.PageActionStatusHandle(PageActionType.Update); // } // } // else if (commandName == "LinkDetail") // { // string pickNo = row.Items.FindItemByKey("PickNo").Text.Trim(); // //string storageOut = row.Items.FindItemByKey("StorageOut").Text.Trim(); // Response.Redirect(this.MakeRedirectUrl("FCreatePickLineMP.aspx", new string[] { "ACT", "PickNo" }, new string[] { "LinkDetail", pickNo })); // } //} protected override void cmdExport_Click(object sender, EventArgs e) { BenQGuru.eMES.Material.WarehouseFacade _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider); List <string> ca = new List <string>(); XlsPackage xls = new XlsPackage(); IFont font = xls.Black; font.FontHeightInPoints = 10; ICellStyle style = xls.Normal; style.SetFont(font); xls.CreateSheet("已超有效期物料报表"); xls.NewRow(0); xls.Cell(0, "库位", style); xls.Cell(1, "存储货位", style); xls.Cell(2, "所在箱号", style); xls.Cell(3, "鼎桥物料编码", style); xls.Cell(4, "部件编码", style); xls.Cell(5, "鼎桥物料描述", style); xls.Cell(6, "超期次数", style); xls.Cell(7, "超期数量", style); int rowNum = 1; StorageDetailValidity[] vs = _WarehouseFacade.QueryStorageDetails(this.txtStorageCodeQuery.Text, txtSupValidityCount.Text); foreach (StorageDetailValidity v in vs) { xls.NewRow(rowNum); string StorageCode = v.StorageCode; xls.Cell(0, StorageCode, style); string LocationCode = v.LocationCode; xls.Cell(1, LocationCode, style); string Cartonno = v.CartonNo; xls.Cell(2, Cartonno, style); string DQMCode = v.DQMCode; xls.Cell(3, DQMCode, style); string DHCode = string.Empty; xls.Cell(4, DHCode, style); string MDESC = v.MDesc; xls.Cell(5, MDESC, style); string ValidityCount = v.ValidityCount.ToString(); xls.Cell(6, ValidityCount, style); string ValidityQTY = v.StorageQty.ToString(); xls.Cell(7, ValidityQTY, style); rowNum++; } string filename = string.Format("Export_{0}_{1}.{2}", FormatHelper.TODateInt(System.DateTime.Now).ToString(), FormatHelper.TOTimeInt(System.DateTime.Now).ToString(), "xls"); string filepath = string.Format(@"{0}{1}", this.DownloadPhysicalPath, filename); FileStream file = new FileStream(filepath, FileMode.Create, FileAccess.ReadWrite); xls.Save(file); file.Close(); DownLoadFile1(filename); }
//protected override void gridWebGrid_ItemCommand(GridRecord row, string commandName) //{ // if (commandName == "Edit") // { // object obj = this.GetEditObject(row); // if (obj != null) // { // this.SetEditObject(obj); // this.buttonHelper.PageActionStatusHandle(PageActionType.Update); // } // } // else if (commandName == "LinkDetail") // { // string pickNo = row.Items.FindItemByKey("PickNo").Text.Trim(); // //string storageOut = row.Items.FindItemByKey("StorageOut").Text.Trim(); // Response.Redirect(this.MakeRedirectUrl("FCreatePickLineMP.aspx", new string[] { "ACT", "PickNo" }, new string[] { "LinkDetail", pickNo })); // } //} protected override void cmdExport_Click(object sender, EventArgs e) { BenQGuru.eMES.Material.WarehouseFacade _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider); List <string> ca = new List <string>(); XlsPackage xls = new XlsPackage(); IFont font = xls.Black; font.FontHeightInPoints = 10; ICellStyle style = xls.Normal; style.SetFont(font); xls.CreateSheet("入库明细表"); xls.NewRow(0); xls.Cell(0, "入库指令号", style); xls.Cell(1, "SAP单据号", style); xls.Cell(2, "入库类型", style); xls.Cell(3, "库位", style); xls.Cell(4, "供应商代码", style); xls.Cell(5, "供应商名称", style); xls.Cell(6, "ASN创建时间", style); xls.Cell(7, "箱数", style); xls.Cell(8, "重量", style); xls.Cell(9, "体积", style); xls.Cell(10, "下发时间", style); xls.Cell(11, "入库执行周期", style); xls.Cell(12, "到货初检开始时间", style); xls.Cell(13, "到货初检完成时间", style); xls.Cell(14, "到货初检执行周期", style); xls.Cell(15, "IQC开始时间", style); xls.Cell(16, "IQC结束时间", style); xls.Cell(17, "IQC执行周期", style); xls.Cell(18, "上架开始时间", style); xls.Cell(19, "上架完成时间", style); xls.Cell(20, "上架执行周期", style); if (facade == null) { facade = new WarehouseFacade(base.DataProvider); } InStorageDetailRecord[] ins = facade.QueryInStorageDetails(txtStorageInASNQuery.Text, txtInvNoQuery.Text, this.txtStorageCodeQuery.Text, this.txtVendorCodeQuery.Text, this.drpStorageInTypeQuery.SelectedValue, FormatHelper.TODateInt(dateInDateFromQuery.Text), FormatHelper.TODateInt(dateInDateToQuery.Text)); int rowNum = 1; for (int i = 0; i < ins.Length; i++) { xls.NewRow(rowNum); string STNO = ins[i].STNO; xls.Cell(0, STNO, style); string invNo = ins[i].INVNO; xls.Cell(1, invNo, style); string stType = ins[i].STTYPE; xls.Cell(2, stType, style); string StorageCode = ins[i].StorageCode; xls.Cell(3, StorageCode, style); string VENDORCODE = ins[i].VENDORCODE; xls.Cell(4, VENDORCODE, style); string VendorName = ins[i].VendorName; xls.Cell(5, VendorName, style); string ASNCDATE = FormatHelper.TODateTimeString(ins[i].ASNCDATE, ins[i].ASNCTIME); xls.Cell(6, ASNCDATE, style); string CARTONNOS = ins[i].CARTONNOCount.ToString(); xls.Cell(7, CARTONNOS, style); string GROSSWEIGHT = ins[i].GROSS_WEIGHT.ToString(); xls.Cell(8, GROSSWEIGHT, style); string VOLUME = ins[i].VOLUME; xls.Cell(9, VOLUME, style); string ISSUEDATE1 = FormatHelper.TODateTimeString(ins[i].IssueDateInt, ins[i].IssueTimeInt); xls.Cell(10, ISSUEDATE1, style); decimal receiveRange = facade.Totalday(ins[i].ReceiveEndDateInt, ins[i].ReceiveEndTimeInt, ins[i].ReceiveBeginDateInt, ins[i].ReceiveBeginTimeInt); if (receiveRange < 0) { receiveRange = 0; } decimal iqcRange = facade.Totalday(ins[i].IQCDateInt, ins[i].IQCTimeInt, ins[i].CDateInt, ins[i].CTimeInt); if (iqcRange < 0) { iqcRange = 0; } decimal instorageRange = facade.Totalday(ins[i].InStoraeeDateInt, ins[i].InStoraeeTimeInt, ins[i].ReceiveBeginDateInt, ins[i].ReceiveBeginTimeInt); if (instorageRange < 0) { instorageRange = 0; } decimal instorageRange1 = facade.Totalday(ins[i].InStoraeeDateInt, ins[i].InStoraeeTimeInt, ins[i].IQCDateInt, ins[i].IQCTimeInt); if (instorageRange1 < 0) { instorageRange1 = 0; } string INSTORAGERange = string.Empty; INSTORAGERange = (instorageRange).ToString(); xls.Cell(11, INSTORAGERange, style); string RECEIVEBEGIN = FormatHelper.TODateTimeString(ins[i].ReceiveBeginDateInt, ins[i].ReceiveBeginTimeInt); xls.Cell(12, RECEIVEBEGIN, style); string RECEIVEEND = FormatHelper.TODateTimeString(ins[i].ReceiveEndDateInt, ins[i].ReceiveEndTimeInt); xls.Cell(13, RECEIVEEND, style); string RECEIVERANGE = string.Empty; RECEIVERANGE = receiveRange.ToString(); xls.Cell(14, RECEIVERANGE, style); string IQCCDATE = string.Empty; if (ins[i].IQCDate != null) { IQCCDATE = FormatHelper.TODateTimeString(ins[i].CDateInt, ins[i].CTimeInt); } xls.Cell(15, IQCCDATE, style); string IQCENDDATE = string.Empty; if (ins[i].IQCDate != null) { IQCENDDATE = FormatHelper.TODateTimeString(ins[i].IQCDateInt, ins[i].IQCTimeInt); } xls.Cell(16, IQCENDDATE, style); string IQCRANGE = string.Empty; IQCRANGE = iqcRange.ToString(); xls.Cell(17, IQCRANGE, style); string INSTORAGEBEGIN = string.Empty; string INSTORAGEEND = string.Empty; string INSTORAGERANGE = string.Empty; INSTORAGEBEGIN = FormatHelper.TODateTimeString(ins[i].InStoraeeBeginDateInt, ins[i].InStoraeeBeginTimeInt); INSTORAGEEND = FormatHelper.TODateTimeString(ins[i].InStoraeeDateInt, ins[i].InStoraeeTimeInt); INSTORAGERANGE = instorageRange.ToString(); xls.Cell(18, INSTORAGEBEGIN, style); xls.Cell(19, INSTORAGEEND, style); xls.Cell(20, instorageRange1.ToString(), style); rowNum++; } string filename = string.Format("Export_{0}_{1}.{2}", FormatHelper.TODateInt(System.DateTime.Now).ToString(), FormatHelper.TOTimeInt(System.DateTime.Now).ToString(), "xls"); string filepath = string.Format(@"{0}{1}", this.DownloadPhysicalPath, filename); FileStream file = new FileStream(filepath, FileMode.Create, FileAccess.ReadWrite); xls.Save(file); file.Close(); DownLoadFile1(filename); }
//protected override void gridWebGrid_ItemCommand(GridRecord row, string commandName) //{ // if (commandName == "Edit") // { // object obj = this.GetEditObject(row); // if (obj != null) // { // this.SetEditObject(obj); // this.buttonHelper.PageActionStatusHandle(PageActionType.Update); // } // } // else if (commandName == "LinkDetail") // { // string pickNo = row.Items.FindItemByKey("PickNo").Text.Trim(); // //string storageOut = row.Items.FindItemByKey("StorageOut").Text.Trim(); // Response.Redirect(this.MakeRedirectUrl("FCreatePickLineMP.aspx", new string[] { "ACT", "PickNo" }, new string[] { "LinkDetail", pickNo })); // } //} protected override void cmdExport_Click(object sender, EventArgs e) { BenQGuru.eMES.Material.WarehouseFacade _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider); List <string> ca = new List <string>(); XlsPackage xls = new XlsPackage(); IFont font = xls.Black; font.FontHeightInPoints = 10; ICellStyle style = xls.Normal; style.SetFont(font); xls.CreateSheet("到货拒收统计-BUYER"); xls.NewRow(0); xls.Cell(0, "鼎桥物料编码", style); xls.Cell(1, "鼎桥物料描述", style); xls.Cell(2, "供应商代码", style); xls.Cell(3, "供应商名称", style); xls.Cell(4, "来料数量", style); xls.Cell(5, "拒收数量", style); xls.Cell(6, "拒收率", style); int rowNum = 1; ReceiveRejectSummaryBuyer[] rs = _WarehouseFacade.GetReceiveRejectSummarysBuyer( FormatHelper.TODateInt(dateInDateFromQuery.Text), FormatHelper.TODateInt(dateInDateToQuery.Text), txtDQMCodeQuery.Text, txtDQMDESCQuery.Text, txtVendorCodeQuery.Text, txtVendorNameQuery.Text); for (int i = 0; i < rs.Length; i++) { xls.NewRow(rowNum); string DQMCODE = rs[i].DQMCODE; xls.Cell(0, DQMCODE, style); string MDESC = rs[i].MDESC; xls.Cell(1, MDESC, style); string VENDORCODE = rs[i].VENDORCODE; xls.Cell(2, VENDORCODE, style); string VENDORNAME = rs[i].VENDORNAME; xls.Cell(3, VENDORNAME, style); string QTY = rs[i].QTY.ToString(); xls.Cell(4, QTY, style); string N = rs[i].N.ToString(); xls.Cell(5, N, style); string L = rs[i].L; xls.Cell(6, L, style); rowNum++; } string filename = string.Format("Export_{0}_{1}.{2}", FormatHelper.TODateInt(System.DateTime.Now).ToString(), FormatHelper.TOTimeInt(System.DateTime.Now).ToString(), "xls"); string filepath = string.Format(@"{0}{1}", this.DownloadPhysicalPath, filename); FileStream file = new FileStream(filepath, FileMode.Create, FileAccess.ReadWrite); xls.Save(file); file.Close(); DownLoadFile1(filename); }
//protected override void gridWebGrid_ItemCommand(GridRecord row, string commandName) //{ // if (commandName == "Edit") // { // object obj = this.GetEditObject(row); // if (obj != null) // { // this.SetEditObject(obj); // this.buttonHelper.PageActionStatusHandle(PageActionType.Update); // } // } // else if (commandName == "LinkDetail") // { // string pickNo = row.Items.FindItemByKey("PickNo").Text.Trim(); // //string storageOut = row.Items.FindItemByKey("StorageOut").Text.Trim(); // Response.Redirect(this.MakeRedirectUrl("FCreatePickLineMP.aspx", new string[] { "ACT", "PickNo" }, new string[] { "LinkDetail", pickNo })); // } //} protected override void cmdExport_Click(object sender, EventArgs e) { BenQGuru.eMES.Material.WarehouseFacade _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider); List <string> ca = new List <string>(); XlsPackage xls = new XlsPackage(); IFont font = xls.Black; font.FontHeightInPoints = 10; ICellStyle style = xls.Normal; style.SetFont(font); xls.CreateSheet("ASN变更统计表"); xls.NewRow(0); xls.Cell(0, "入库指令号", style); xls.Cell(1, "SAP单据号", style); xls.Cell(2, "入库类型", style); xls.Cell(3, "库位", style); xls.Cell(4, "供应商代码", style); xls.Cell(5, "供应商名称", style); xls.Cell(6, "变更次数", style); xls.Cell(7, "ASN创建人", style); xls.Cell(8, "ASN创建时间", style); xls.Cell(9, "ASN下发时间", style); xls.Cell(10, "ASN取消下发时间", style); int rowNum = 1; if (facade == null) { facade = new WarehouseFacade(base.DataProvider); } AsnIssueCancelRecord[] records = this.facade.QueryAsnIssueCancels( FormatHelper.TODateInt(dateInDateFromQuery.Text), FormatHelper.TODateInt(dateInDateToQuery.Text)); foreach (AsnIssueCancelRecord record in records) { xls.NewRow(rowNum); string STNO = record.STNO; xls.Cell(0, STNO, style); string invNo = record.INVNO; xls.Cell(1, invNo, style); string stType = this.GetInvInName(record.STTYPE); xls.Cell(2, stType, style); string StorageCode = record.StorageCode; xls.Cell(3, StorageCode, style); string VENDORCODE = record.VENDORCODE; xls.Cell(4, VENDORCODE, style); string VendorName = record.VendorName; xls.Cell(5, VendorName, style); int changeCount = record.CANCELCOUNT; xls.Cell(6, changeCount, style); string cuser = record.CUSER; xls.Cell(7, cuser, style); string ASNCDATE = FormatHelper.TODateTimeString(record.CDATE, record.CTIME); xls.Cell(8, ASNCDATE, style); string issueDate = ShareLib.ShareKit.FormatDateTimeIntStr(record.ISSUEDATE); xls.Cell(9, issueDate, style); string cancelIssueDate = ShareLib.ShareKit.FormatDateTimeIntStr(record.CancelISSUEDATE); xls.Cell(10, cancelIssueDate, style); rowNum++; } string filename = string.Format("Export_{0}_{1}.{2}", FormatHelper.TODateInt(System.DateTime.Now).ToString(), FormatHelper.TOTimeInt(System.DateTime.Now).ToString(), "xls"); string filepath = string.Format(@"{0}{1}", this.DownloadPhysicalPath, filename); FileStream file = new FileStream(filepath, FileMode.Create, FileAccess.ReadWrite); xls.Save(file); file.Close(); DownLoadFile1(filename); }
protected override void cmdExport_Click(object sender, EventArgs e) { BenQGuru.eMES.Material.WarehouseFacade _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider); List <string> ca = new List <string>(); XlsPackage xls = new XlsPackage(); IFont font = xls.Black; font.FontHeightInPoints = 10; ICellStyle style = xls.Normal; style.SetFont(font); xls.CreateSheet("库龄报表"); xls.NewRow(0); xls.Cell(0, "物料编码", style); xls.Cell(1, "鼎桥物料编码", style); xls.Cell(2, "物料描述", style); xls.Cell(3, "库位", style); xls.Cell(4, "总库存数量", style); xls.Cell(5, "单位", style); xls.Cell(6, "<=3个月", style); xls.Cell(7, "<=6个月", style); xls.Cell(8, "<=12个月", style); xls.Cell(9, "<=18个月", style); xls.Cell(10, "<=24个月", style); xls.Cell(11, "<=30个月", style); xls.Cell(12, "<=36个月", style); xls.Cell(13, ">36个月", style); int startDateInt = FormatHelper.TODateInt(DateTime.Now); if (!string.IsNullOrEmpty(dateStartDateQuery.Text)) { startDateInt = FormatHelper.TODateInt(dateStartDateQuery.Text); } BenQGuru.eMES.Domain.Warehouse.StorageDetail[] details = _WarehouseFacade.QueryStorageAges(this.txtMCODEQuery.Text, this.txtDQMCODEQuery.Text, txtStorageCodeQuery.Text); int rowNum = 1; for (int i = 0; i < details.Length; i++) { xls.NewRow(rowNum); string MCODE = details[i].MCode; xls.Cell(0, MCODE, style); string DQMCODE = details[i].DQMCode; xls.Cell(1, DQMCODE, style); string MDESC = details[i].MDesc; xls.Cell(2, MDESC, style); string StorageCode = details[i].StorageCode; xls.Cell(3, StorageCode, style); string SUMQTY = details[i].StorageQty.ToString(); xls.Cell(4, SUMQTY, style); string UNIT = details[i].Unit; xls.Cell(5, UNIT, style); int les3monthQty = _WarehouseFacade.QueryStorageLE3MonthAgesQty(startDateInt, details[i].MCode, details[i].StorageCode); int les6monthQty = _WarehouseFacade.QueryStorageLE6MonthAgesQty(startDateInt, details[i].MCode, details[i].StorageCode); int les12monthQty = _WarehouseFacade.QueryStorageLE12MonthAgesQty(startDateInt, details[i].MCode, details[i].StorageCode); int les18monthQty = _WarehouseFacade.QueryStorageLE18MonthAgesQty(startDateInt, details[i].MCode, details[i].StorageCode); int les24monthQty = _WarehouseFacade.QueryStorageLE24MonthAgesQty(startDateInt, details[i].MCode, details[i].StorageCode); int les30monthQty = _WarehouseFacade.QueryStorageLE30MonthAgesQty(startDateInt, details[i].MCode, details[i].StorageCode); int les36monthQty = _WarehouseFacade.QueryStorageLE36MonthAgesQty(startDateInt, details[i].MCode, details[i].StorageCode); string LE6MONTH = (les6monthQty - les3monthQty).ToString(); string LE12MONTH = (les12monthQty - les6monthQty).ToString(); string LE18MONTH = (les18monthQty - les12monthQty).ToString(); string LE24MONTH = (les24monthQty - les18monthQty).ToString(); string LE30MONTH = (les30monthQty - les24monthQty).ToString(); string LE36MONTH = (les36monthQty - les30monthQty).ToString(); string GE36MONTH = (details[i].StorageQty - les36monthQty).ToString(); string LE3MONTH = les3monthQty.ToString(); xls.Cell(6, LE3MONTH, style); xls.Cell(7, LE6MONTH, style); xls.Cell(8, LE12MONTH, style); xls.Cell(9, LE18MONTH, style); xls.Cell(10, LE24MONTH, style); xls.Cell(11, LE30MONTH, style); xls.Cell(12, LE36MONTH, style); xls.Cell(13, GE36MONTH, style); rowNum++; } string filename = string.Format("Export_{0}_{1}.{2}", FormatHelper.TODateInt(System.DateTime.Now).ToString(), FormatHelper.TOTimeInt(System.DateTime.Now).ToString(), "xls"); string filepath = string.Format(@"{0}{1}", this.DownloadPhysicalPath, filename); FileStream file = new FileStream(filepath, FileMode.Create, FileAccess.ReadWrite); xls.Save(file); file.Close(); DownLoadFile1(filename); }
//protected override void gridWebGrid_ItemCommand(GridRecord row, string commandName) //{ // if (commandName == "Edit") // { // object obj = this.GetEditObject(row); // if (obj != null) // { // this.SetEditObject(obj); // this.buttonHelper.PageActionStatusHandle(PageActionType.Update); // } // } // else if (commandName == "LinkDetail") // { // string pickNo = row.Items.FindItemByKey("PickNo").Text.Trim(); // //string storageOut = row.Items.FindItemByKey("StorageOut").Text.Trim(); // Response.Redirect(this.MakeRedirectUrl("FCreatePickLineMP.aspx", new string[] { "ACT", "PickNo" }, new string[] { "LinkDetail", pickNo })); // } //} protected override void cmdExport_Click(object sender, EventArgs e) { BenQGuru.eMES.Material.WarehouseFacade _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider); List <string> ca = new List <string>(); OutStorageSummary[] summarys = _WarehouseFacade.QueryOutStorageSummarys(txtStorageCodeQuery.Text, drpPickTypeQuery.SelectedValue, FormatHelper.TODateInt(dateInDateFromQuery.Text), FormatHelper.TODateInt(dateInDateToQuery.Text)); XlsPackage xls = new XlsPackage(); IFont font = xls.Black; font.FontHeightInPoints = 10; ICellStyle style = xls.Normal; style.SetFont(font); xls.CreateSheet("出库统计表"); xls.NewRow(0); xls.Cell(0, "库位", style); xls.Cell(1, "创建拣货任务令个数", style); xls.Cell(2, "下发拣货任务令个数", style); xls.Cell(3, "平均出库执行周期", style); xls.Cell(4, "平均库房操作周期", style); xls.Cell(5, "平均下发执行周期", style); xls.Cell(6, "完成拣料个数", style); xls.Cell(7, "平均每个拣货任务令的拣料周期", style); xls.Cell(8, "平均每个ORDERLINE的拣料周期", style); xls.Cell(9, "完成包装个数", style); xls.Cell(10, "平均每个ORDERLINE的包装周期", style); xls.Cell(11, "平均每个拣货任务令的包装周期", style); xls.Cell(12, "平均每个拣货任务令的OQC周期", style); xls.Cell(13, "完成箱单个数", style); xls.Cell(14, "平均每个拣货任务令的箱单制作周期", style); xls.Cell(15, "平均每个ORDERLINE的箱单制作周期", style); xls.Cell(16, "完成发货个数", style); xls.Cell(17, "平均发货周期", style); xls.Cell(18, "总箱数", style); xls.Cell(19, "总重量", style); xls.Cell(20, "总体积", style); xls.Cell(21, "总Orderline行数", style); int rowNum = 1; for (int i = 0; i < summarys.Length; i++) { xls.NewRow(rowNum); xls.Cell(0, summarys[i].StorageCode, style); xls.Cell(1, summarys[i].picktotal.ToString(), style); xls.Cell(2, summarys[i].ISSUECOUNT.ToString(), style); decimal averPick = _WarehouseFacade.averPickPeriod(summarys[i].StorageCode, drpPickTypeQuery.SelectedValue, FormatHelper.TODateInt(dateInDateFromQuery.Text), FormatHelper.TODateInt(dateInDateToQuery.Text)); decimal averPack = _WarehouseFacade.averPackPeriod(summarys[i].StorageCode, drpPickTypeQuery.SelectedValue, FormatHelper.TODateInt(dateInDateFromQuery.Text), FormatHelper.TODateInt(dateInDateToQuery.Text)); decimal averOQC = _WarehouseFacade.averOQCPeriod(summarys[i].StorageCode, drpPickTypeQuery.SelectedValue, FormatHelper.TODateInt(dateInDateFromQuery.Text), FormatHelper.TODateInt(dateInDateToQuery.Text)); decimal averClosePackList = _WarehouseFacade.averCARTONNOPeriod(summarys[i].StorageCode, drpPickTypeQuery.SelectedValue, FormatHelper.TODateInt(dateInDateFromQuery.Text), FormatHelper.TODateInt(dateInDateToQuery.Text)); decimal averWare = (averPick + averPack + averOQC + averClosePackList); decimal averDown = _WarehouseFacade.averDownPeriod(summarys[i].StorageCode, drpPickTypeQuery.SelectedValue, FormatHelper.TODateInt(dateInDateFromQuery.Text), FormatHelper.TODateInt(dateInDateToQuery.Text)); decimal averDeliery = _WarehouseFacade.averDeliveryPeriod(summarys[i].StorageCode, drpPickTypeQuery.SelectedValue, FormatHelper.TODateInt(dateInDateFromQuery.Text), FormatHelper.TODateInt(dateInDateToQuery.Text)); xls.Cell(3, (averWare + averDown + averDeliery).ToString(), style); xls.Cell(4, averWare.ToString(), style); xls.Cell(5, averDown.ToString(), style); xls.Cell(6, summarys[i].PICKCOUNT, style); xls.Cell(7, averPick.ToString(), style); xls.Cell(8, _WarehouseFacade.averPickOrderLinePeriod(summarys[i].StorageCode, drpPickTypeQuery.SelectedValue, FormatHelper.TODateInt(dateInDateFromQuery.Text), FormatHelper.TODateInt(dateInDateToQuery.Text)).ToString(), style); xls.Cell(9, summarys[i].PACKCOUNT, style); xls.Cell(10, _WarehouseFacade.averPackOrderLinePeriod(summarys[i].StorageCode, drpPickTypeQuery.SelectedValue, FormatHelper.TODateInt(dateInDateFromQuery.Text), FormatHelper.TODateInt(dateInDateToQuery.Text)).ToString(), style); xls.Cell(11, averPack.ToString(), style); xls.Cell(12, averOQC.ToString(), style); xls.Cell(13, summarys[i].FINISHCARTONNOCOUNT.ToString(), style); xls.Cell(14, averClosePackList.ToString(), style); xls.Cell(15, _WarehouseFacade.averCARTONNOOrderLinesPeriod(summarys[i].StorageCode, drpPickTypeQuery.SelectedValue == "DNZC" ? "DNC" : drpPickTypeQuery.SelectedValue, FormatHelper.TODateInt(dateInDateFromQuery.Text), FormatHelper.TODateInt(dateInDateToQuery.Text)).ToString(), style); xls.Cell(16, summarys[i].FINISHCARTONNOCOUNT.ToString(), style); xls.Cell(17, averDeliery.ToString(), style); xls.Cell(18, summarys[i].CARTONNOS, style); xls.Cell(19, summarys[i].GROSS_WEIGHT.ToString(), style); xls.Cell(20, summarys[i].VOLUME.ToString(), style); xls.Cell(21, _WarehouseFacade.SumOrderLines(summarys[i].StorageCode, drpPickTypeQuery.SelectedValue, FormatHelper.TODateInt(dateInDateFromQuery.Text), FormatHelper.TODateInt(dateInDateToQuery.Text)).ToString(), style); rowNum++; } string filename = string.Format("Export_{0}_{1}.{2}", FormatHelper.TODateInt(System.DateTime.Now).ToString(), FormatHelper.TOTimeInt(System.DateTime.Now).ToString(), "xls"); string filepath = string.Format(@"{0}{1}", this.DownloadPhysicalPath, filename); FileStream file = new FileStream(filepath, FileMode.Create, FileAccess.ReadWrite); xls.Save(file); file.Close(); DownLoadFile1(filename); }
protected override void cmdExport_Click(object sender, EventArgs e) { BenQGuru.eMES.Material.WarehouseFacade _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider); List <string> ca = new List <string>(); XlsPackage xls = new XlsPackage(); IFont font = xls.Black; font.FontHeightInPoints = 10; ICellStyle style = xls.Normal; style.SetFont(font); xls.CreateSheet("产品入库记录表"); xls.NewRow(0); xls.Cell(0, "入库指令号", style); xls.Cell(1, "SAP单据号", style); xls.Cell(2, "入库类型", style); xls.Cell(3, "首次入库时间", style); xls.Cell(4, "最后入库时间", style); xls.Cell(5, "供应商代码", style); xls.Cell(6, "供应商名称", style); xls.Cell(7, "鼎桥物料编码", style); xls.Cell(8, "鼎桥物料编码描述", style); xls.Cell(9, "数量", style); xls.Cell(10, "SN", style); xls.Cell(11, "供应商批次号", style); int rowNum = 1; if (facade == null) { facade = new WarehouseFacade(base.DataProvider); } ProductInstorageRecord[] records = this.facade.QueryProductInstorages(txtInvNoQuery.Text, FormatHelper.TODateInt(dateInDateFromQuery.Text), FormatHelper.TODateInt(dateInDateToQuery.Text), txtVendorCodeQuery.Text, txtDQMCodeQuery.Text, txtDQMDESCQuery.Text, txtSNQuery.Text, txtSupplierLotNoQuery.Text); foreach (ProductInstorageRecord record in records) { xls.NewRow(rowNum); string stno = record.STNO; xls.Cell(0, stno, style); string invNo = record.INVNO; xls.Cell(1, invNo, style); string stType = record.STTYPE; xls.Cell(2, stType, style); string StorageAgeDate = FormatHelper.ToDateString(record.StorageAgeDate); xls.Cell(3, StorageAgeDate, style); string lastStorageAgeDate = FormatHelper.ToDateString(record.LastStorageAgeDate); xls.Cell(4, lastStorageAgeDate, style); string vendorCode = record.VendorCode; xls.Cell(5, vendorCode, style); string vendorName = record.VendorName; xls.Cell(6, vendorName, style); string DQMCODE = record.DQMCODE; xls.Cell(7, DQMCODE, style); string MDESC = record.MDESC; xls.Cell(8, MDESC, style); int STORAGEQTY = record.STORAGEQTY; xls.Cell(9, STORAGEQTY, style); string SN = record.SN; xls.Cell(10, SN, style); string supplierLotNo = record.Supplier_LotNo; xls.Cell(11, supplierLotNo, style); rowNum++; } string filename = string.Format("Export_{0}_{1}.{2}", FormatHelper.TODateInt(System.DateTime.Now).ToString(), FormatHelper.TOTimeInt(System.DateTime.Now).ToString(), "xls"); string filepath = string.Format(@"{0}{1}", this.DownloadPhysicalPath, filename); FileStream file = new FileStream(filepath, FileMode.Create, FileAccess.ReadWrite); xls.Save(file); file.Close(); DownLoadFile1(filename); }
//protected override void gridWebGrid_ItemCommand(GridRecord row, string commandName) //{ // if (commandName == "Edit") // { // object obj = this.GetEditObject(row); // if (obj != null) // { // this.SetEditObject(obj); // this.buttonHelper.PageActionStatusHandle(PageActionType.Update); // } // } // else if (commandName == "LinkDetail") // { // string pickNo = row.Items.FindItemByKey("PickNo").Text.Trim(); // //string storageOut = row.Items.FindItemByKey("StorageOut").Text.Trim(); // Response.Redirect(this.MakeRedirectUrl("FCreatePickLineMP.aspx", new string[] { "ACT", "PickNo" }, new string[] { "LinkDetail", pickNo })); // } //} protected override void cmdExport_Click(object sender, EventArgs e) { BenQGuru.eMES.Material.WarehouseFacade _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider); List <string> ca = new List <string>(); XlsPackage xls = new XlsPackage(); IFont font = xls.Black; font.FontHeightInPoints = 10; ICellStyle style = xls.Normal; style.SetFont(font); xls.CreateSheet("入库操作记录"); xls.NewRow(0); xls.Cell(0, "库位", style); xls.Cell(1, "入库指令号", style); xls.Cell(2, "SAP单据号", style); xls.Cell(3, "到货初检人", style); xls.Cell(4, "到货初检日期", style); xls.Cell(5, "IQC操作人", style); xls.Cell(6, "IQC日期", style); xls.Cell(7, "SQE操作人", style); xls.Cell(8, "SQE判定日期", style); xls.Cell(9, "上架人", style); xls.Cell(10, "上架日期", style); int rowNum = 1; for (int i = 0; i < this.gridWebGrid.Rows.Count; i++) { xls.NewRow(rowNum); string storageCode = this.gridWebGrid.Rows[i].Items.FindItemByKey("STORAGECODE").Text; xls.Cell(0, storageCode, style); string stno = this.gridWebGrid.Rows[i].Items.FindItemByKey("STNO").Text; xls.Cell(1, stno, style); string invno = this.gridWebGrid.Rows[i].Items.FindItemByKey("INVNO").Text; xls.Cell(2, invno, style); string receiveUser = this.gridWebGrid.Rows[i].Items.FindItemByKey("ReceiveUSER").Text; xls.Cell(3, receiveUser, style); string receiveDate = this.gridWebGrid.Rows[i].Items.FindItemByKey("ReceiveDate").Text; xls.Cell(4, receiveDate, style); string iqcUser = this.gridWebGrid.Rows[i].Items.FindItemByKey("IQCUser").Text; xls.Cell(5, iqcUser, style); string iqcDate = this.gridWebGrid.Rows[i].Items.FindItemByKey("IQCDate").Text; xls.Cell(6, iqcDate, style); string sqeUser = this.gridWebGrid.Rows[i].Items.FindItemByKey("SQEUser").Text; xls.Cell(7, sqeUser, style); string sqeDate = this.gridWebGrid.Rows[i].Items.FindItemByKey("SQEDate").Text; xls.Cell(8, sqeDate, style); string inUser = this.gridWebGrid.Rows[i].Items.FindItemByKey("INSTORAGEUser").Text; xls.Cell(9, inUser, style); string inDate = this.gridWebGrid.Rows[i].Items.FindItemByKey("INSTORAGEDate").Text; xls.Cell(10, inDate, style); rowNum++; } string filename = string.Format("Export_{0}_{1}.{2}", FormatHelper.TODateInt(System.DateTime.Now).ToString(), FormatHelper.TOTimeInt(System.DateTime.Now).ToString(), "xls"); string filepath = string.Format(@"{0}{1}", this.DownloadPhysicalPath, filename); FileStream file = new FileStream(filepath, FileMode.Create, FileAccess.ReadWrite); xls.Save(file); file.Close(); DownLoadFile1(filename); }
//protected override void gridWebGrid_ItemCommand(GridRecord row, string commandName) //{ // if (commandName == "Edit") // { // object obj = this.GetEditObject(row); // if (obj != null) // { // this.SetEditObject(obj); // this.buttonHelper.PageActionStatusHandle(PageActionType.Update); // } // } // else if (commandName == "LinkDetail") // { // string pickNo = row.Items.FindItemByKey("PickNo").Text.Trim(); // //string storageOut = row.Items.FindItemByKey("StorageOut").Text.Trim(); // Response.Redirect(this.MakeRedirectUrl("FCreatePickLineMP.aspx", new string[] { "ACT", "PickNo" }, new string[] { "LinkDetail", pickNo })); // } //} protected override void cmdExport_Click(object sender, EventArgs e) { BenQGuru.eMES.Material.WarehouseFacade _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider); List <string> ca = new List <string>(); XlsPackage xls = new XlsPackage(); IFont font = xls.Black; font.FontHeightInPoints = 10; ICellStyle style = xls.Normal; style.SetFont(font); xls.CreateSheet("IQC明细表"); xls.NewRow(0); xls.Cell(0, "IQC单号", style); xls.Cell(1, "SAP单据号", style); //xls.Cell(2, "SAP单据号", style); xls.Cell(2, "入库类型", style); xls.Cell(3, "库位", style); xls.Cell(4, "供应商代码", style); xls.Cell(5, "供应商名称", style); xls.Cell(6, "鼎桥物料编码", style); xls.Cell(7, "供应商物料编码", style); xls.Cell(8, "鼎桥物料描述", style); xls.Cell(9, "检验方式", style); xls.Cell(10, "AQL标准", style); xls.Cell(11, "来料数量", style); xls.Cell(12, "样本数量", style); xls.Cell(13, "缺陷品数", style); xls.Cell(14, "退换货数量", style); xls.Cell(15, "现场整改数量", style); xls.Cell(16, "让步接收数量", style); xls.Cell(17, "特采放行数量", style); int cellNum = 18; SystemSettingFacade _SystemSettingFacade = new SystemSettingFacade(base.DataProvider); object[] objs = _SystemSettingFacade.GetErrorGroupcode(); if (objs != null && objs.Length > 0) { foreach (ErrorCodeGroupA ecg in objs) { xls.Cell(cellNum, ecg.ErrorCodeGroupDescription, style); cellNum++; } } xls.Cell(cellNum++, "创建时间", style); xls.Cell(cellNum++, "QC检验完成时间", style); xls.Cell(cellNum++, "SQE判定完成时间", style); xls.Cell(cellNum++, "IQC检验完成时间", style); xls.Cell(cellNum++, "QC检验执行时间", style); xls.Cell(cellNum++, "SQE判定执行时间", style); xls.Cell(cellNum++, "IQC检验执行时间", style); int rowNum = 1; IQCDetailRecord[] iqcs = _WarehouseFacade.QueryIQCs(this.txtStorageCodeQuery.Text, this.txtVendorCodeQuery.Text, this.drpStorageInTypeQuery.SelectedValue, FormatHelper.TODateInt(dateInDateFromQuery.Text), FormatHelper.TODateInt(dateInDateToQuery.Text)); InventoryFacade _InventoryFacade = new InventoryFacade(base.DataProvider); for (int i = 0; i < iqcs.Length; i++) { xls.NewRow(rowNum); string iqcNO = iqcs[i].IQCNO; xls.Cell(0, iqcNO, style); string invNo = iqcs[i].INVNO; xls.Cell(1, invNo, style); string stType = iqcs[i].STTYPE; xls.Cell(2, stType, style); string StorageCode = iqcs[i].StorageCode; xls.Cell(3, StorageCode, style); string VENDORCODE = iqcs[i].VENDORCODE; xls.Cell(4, VENDORCODE, style); string VendorName = iqcs[i].VendorName; xls.Cell(5, VendorName, style); string DQMCODE = iqcs[i].DQMCODE; xls.Cell(6, DQMCODE, style); string VENDORMCODE = iqcs[i].VENDORMCODE; xls.Cell(7, VENDORMCODE, style); Domain.MOModel.Material m = (Domain.MOModel.Material)_InventoryFacade.GetMaterialByDQMCode(iqcs[i].DQMCODE); string MDESC = m.MchlongDesc; xls.Cell(8, MDESC, style); string IQCTYPE = iqcs[i].IQCTYPE; xls.Cell(9, IQCTYPE, style); string AQLLEVEL = iqcs[i].AQLLEVEL; xls.Cell(10, AQLLEVEL, style); string QTY = iqcs[i].QTY.ToString(); xls.Cell(11, QTY, style); string IQCQTY = iqcs[i].SAMPLESIZE.ToString(); xls.Cell(12, IQCQTY, style); string NGQTY = iqcs[i].NGQTY.ToString(); xls.Cell(13, NGQTY, style); string RETURNQTY = iqcs[i].RETURNQTY.ToString(); xls.Cell(14, RETURNQTY, style); string ReformQTY = iqcs[i].ReformQTY.ToString(); xls.Cell(15, ReformQTY, style); string GiveQTY = iqcs[i].GiveQTY.ToString(); xls.Cell(16, GiveQTY, style); string AcceptQTY = iqcs[i].AcceptQTY.ToString(); xls.Cell(17, AcceptQTY, style); int cellNum2 = 18; if (objs != null && objs.Length > 0) { foreach (ErrorCodeGroupA ecg in objs) { int num = _WarehouseFacade.GetErrorGroupNum(iqcs[i].IQCNO, ecg.ErrorCodeGroup); xls.Cell(cellNum2, num, style); cellNum2++; } } string CDATE = iqcs[i].CDATE.ToString(); xls.Cell(cellNum2++, CDATE, style); InvInOutTrans OCFinishInv = _WarehouseFacade.QCFinishDateTimeTrans(iqcs[i].IQCNO); InvInOutTrans SQEFinishInv = _WarehouseFacade.SQEFinishDateTimeTrans(iqcs[i].IQCNO); InvInOutTrans IQCFinishInv = SQEFinishInv ?? (OCFinishInv ?? null); string QCFINISHDATEStr = OCFinishInv != null?FormatHelper.ToDateString(OCFinishInv.MaintainDate) : string.Empty; string SEQFINISHDATEStr = SQEFinishInv != null?FormatHelper.ToDateString(SQEFinishInv.MaintainDate) : string.Empty; string IQCFINISHDATEStr = IQCFinishInv != null?FormatHelper.ToDateString(IQCFinishInv.MaintainDate) : string.Empty; decimal QCDATERANGE = OCFinishInv != null?Common.Totalday(OCFinishInv.MaintainDate, OCFinishInv.MaintainTime, iqcs[i].CDATE, iqcs[i].CTIME) : (decimal)0; string IQCSEQDATERANGE = string.Empty; string IQCDATERANGEStr = string.Empty; if (OCFinishInv != null && SQEFinishInv != null) { IQCSEQDATERANGE = Common.Totalday(SQEFinishInv.MaintainDate, SQEFinishInv.MaintainTime, OCFinishInv.MaintainDate, OCFinishInv.MaintainTime).ToString(); } if (IQCFinishInv != null) { IQCDATERANGEStr = Common.Totalday(IQCFinishInv.MaintainDate, IQCFinishInv.MaintainTime, iqcs[i].CDATE, iqcs[i].CTIME).ToString(); } xls.Cell(cellNum2++, QCFINISHDATEStr, style); xls.Cell(cellNum2++, SEQFINISHDATEStr, style); xls.Cell(cellNum2++, IQCFINISHDATEStr, style); xls.Cell(cellNum2++, QCDATERANGE.ToString(), style); xls.Cell(cellNum2++, IQCSEQDATERANGE, style); xls.Cell(cellNum2++, IQCDATERANGEStr, style); rowNum++; } string filename = string.Format("Export_{0}_{1}.{2}", FormatHelper.TODateInt(System.DateTime.Now).ToString(), FormatHelper.TOTimeInt(System.DateTime.Now).ToString(), "xls"); string filepath = string.Format(@"{0}{1}", this.DownloadPhysicalPath, filename); FileStream file = new FileStream(filepath, FileMode.Create, FileAccess.ReadWrite); xls.Save(file); file.Close(); DownLoadFile1(filename); }
protected override void cmdExport_Click(object sender, EventArgs e) { BenQGuru.eMES.Material.WarehouseFacade _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider); List <string> ca = new List <string>(); XlsPackage xls = new XlsPackage(); IFont font = xls.Black; font.FontHeightInPoints = 10; ICellStyle style = xls.Normal; style.SetFont(font); xls.CreateSheet("产品出库记录表"); xls.NewRow(0); xls.Cell(0, "拣货任务令号", style); xls.Cell(1, "SAP单据号", style); xls.Cell(2, "箱单号", style); xls.Cell(3, "出库类型", style); xls.Cell(4, "出库日期", style); xls.Cell(5, "鼎桥物料编码", style); xls.Cell(6, "鼎桥物料编码描述", style); xls.Cell(7, "数量", style); xls.Cell(8, "SN", style); xls.Cell(9, "供应商代码", style); xls.Cell(10, "供应商批次号", style); xls.Cell(11, "项目名称", style); xls.Cell(12, "合同号", style); xls.Cell(13, "客户订单号", style); xls.Cell(14, "收货地址", style); xls.Cell(15, "客户代码", style); int rowNum = 1; if (facade == null) { facade = new WarehouseFacade(base.DataProvider); } ProductOutstorageRecord[] records = this.facade.QueryProductOutstorages( FormatHelper.TODateInt(dateInDateFromQuery.Text), FormatHelper.TODateInt(dateInDateToQuery.Text), txtDQMCodeQuery.Text, txtDQMDESCQuery.Text, txtSNQuery.Text, txtSupplierLotNoQuery.Text, txtProjectNameQuery.Text, txtORDERNOQuery.Text, txtCustOrderQuery.Text ); foreach (ProductOutstorageRecord record in records) { xls.NewRow(rowNum); string PICKNO = record.PICKNO; xls.Cell(0, PICKNO, style); string invNo = record.INVNO; xls.Cell(1, invNo, style); string CARINVNO = record.CARINVNO; xls.Cell(2, CARINVNO, style); string PICKTYPE = record.PICKTYPE; xls.Cell(3, PICKTYPE, style); string DeliveryDate = FormatHelper.ToDateString(record.DeliveryDate); xls.Cell(4, DeliveryDate, style); string DQMCODE = record.DQMCODE; xls.Cell(5, DQMCODE, style); string MDESC = record.MDESC; xls.Cell(6, MDESC, style); decimal PQTY = record.PQTY; xls.Cell(7, (int)PQTY, style); string SN = record.SN; xls.Cell(8, SN, style); string VENDORCODE = record.VENDORCODE; xls.Cell(9, VENDORCODE, style); string Supplier_LotNo = record.Supplier_LotNo; xls.Cell(10, Supplier_LotNo, style); string ProjectName = record.ProjectName; xls.Cell(11, ProjectName, style); string ORDERNO = record.ORDERNO; xls.Cell(12, ORDERNO, style); string CUSORDERNO = record.CUSORDERNO; xls.Cell(13, CUSORDERNO, style); string ReceiverAddr = record.ReceiverAddr; xls.Cell(14, ReceiverAddr, style); string SHIPTOPARTY = record.SHIPTOPARTY; xls.Cell(15, SHIPTOPARTY, style); rowNum++; } string filename = string.Format("Export_{0}_{1}.{2}", FormatHelper.TODateInt(System.DateTime.Now).ToString(), FormatHelper.TOTimeInt(System.DateTime.Now).ToString(), "xls"); string filepath = string.Format(@"{0}{1}", this.DownloadPhysicalPath, filename); FileStream file = new FileStream(filepath, FileMode.Create, FileAccess.ReadWrite); xls.Save(file); file.Close(); DownLoadFile1(filename); }
//protected override void gridWebGrid_ItemCommand(GridRecord row, string commandName) //{ // if (commandName == "Edit") // { // object obj = this.GetEditObject(row); // if (obj != null) // { // this.SetEditObject(obj); // this.buttonHelper.PageActionStatusHandle(PageActionType.Update); // } // } // else if (commandName == "LinkDetail") // { // string pickNo = row.Items.FindItemByKey("PickNo").Text.Trim(); // //string storageOut = row.Items.FindItemByKey("StorageOut").Text.Trim(); // Response.Redirect(this.MakeRedirectUrl("FCreatePickLineMP.aspx", new string[] { "ACT", "PickNo" }, new string[] { "LinkDetail", pickNo })); // } //} protected override void cmdExport_Click(object sender, EventArgs e) { BenQGuru.eMES.Material.WarehouseFacade _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider); List <string> ca = new List <string>(); XlsPackage xls = new XlsPackage(); IFont font = xls.Black; font.FontHeightInPoints = 10; ICellStyle style = xls.Normal; style.SetFont(font); xls.CreateSheet("IQC执行情况-BUYER "); xls.NewRow(0); xls.Cell(0, "鼎桥物料编码", style); xls.Cell(1, "鼎桥物料描述", style); xls.Cell(2, "供应商代码", style); xls.Cell(3, "供应商名称", style); xls.Cell(4, "来料数量", style); xls.Cell(5, "样本数量", style); xls.Cell(6, "缺陷品数", style); xls.Cell(7, "缺陷率", style); xls.Cell(8, "退换货数量", style); xls.Cell(9, "现场整改数量", style); xls.Cell(10, "让步接收数量", style); xls.Cell(11, "特采放行数量", style); int rowNum = 1; IQCExecSummaryBuyer[] rs = _WarehouseFacade.GetIQCExecBuyerSummary( FormatHelper.TODateInt(dateInDateFromQuery.Text), FormatHelper.TODateInt(dateInDateToQuery.Text), txtDQMCodeQuery.Text, txtDQMDESCQuery.Text, txtVendorCodeQuery.Text, txtVendorNameQuery.Text); for (int i = 0; i < rs.Length; i++) { xls.NewRow(rowNum); string DQMCODE = rs[i].DQMCODE; xls.Cell(0, DQMCODE, style); string MDESC = rs[i].MDESC; xls.Cell(1, MDESC, style); string VENDORCODE = rs[i].VENDORCODE; xls.Cell(2, VENDORCODE, style); string VENDORNAME = rs[i].VENDORNAME; xls.Cell(3, VENDORNAME, style); string QTY = rs[i].QTY.ToString(); xls.Cell(4, QTY, style); string SAMPLESIZE = rs[i].SAMPLESIZE.ToString(); xls.Cell(5, SAMPLESIZE, style); string NGQTY = rs[i].NGQTY.ToString(); xls.Cell(6, NGQTY, style); string NGPER = rs[i].NGPER; xls.Cell(7, NGPER, style); string ReturnQTY = rs[i].ReturnQTY.ToString(); xls.Cell(8, ReturnQTY, style); string ReformQTY = rs[i].ReformQTY.ToString(); xls.Cell(9, ReformQTY, style); string GiveQTY = rs[i].GiveQTY.ToString(); xls.Cell(10, GiveQTY, style); string AcceptQTY = rs[i].AcceptQTY.ToString(); xls.Cell(11, AcceptQTY, style); rowNum++; } string filename = string.Format("Export_{0}_{1}.{2}", FormatHelper.TODateInt(System.DateTime.Now).ToString(), FormatHelper.TOTimeInt(System.DateTime.Now).ToString(), "xls"); string filepath = string.Format(@"{0}{1}", this.DownloadPhysicalPath, filename); FileStream file = new FileStream(filepath, FileMode.Create, FileAccess.ReadWrite); xls.Save(file); file.Close(); DownLoadFile1(filename); }
//protected override void gridWebGrid_ItemCommand(GridRecord row, string commandName) //{ // if (commandName == "Edit") // { // object obj = this.GetEditObject(row); // if (obj != null) // { // this.SetEditObject(obj); // this.buttonHelper.PageActionStatusHandle(PageActionType.Update); // } // } // else if (commandName == "LinkDetail") // { // string pickNo = row.Items.FindItemByKey("PickNo").Text.Trim(); // //string storageOut = row.Items.FindItemByKey("StorageOut").Text.Trim(); // Response.Redirect(this.MakeRedirectUrl("FCreatePickLineMP.aspx", new string[] { "ACT", "PickNo" }, new string[] { "LinkDetail", pickNo })); // } //} protected override void cmdExport_Click(object sender, EventArgs e) { BenQGuru.eMES.Material.WarehouseFacade _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider); List <string> ca = new List <string>(); XlsPackage xls = new XlsPackage(); IFont font = xls.Black; font.FontHeightInPoints = 10; ICellStyle style = xls.Normal; style.SetFont(font); xls.CreateSheet("IQC统计表"); xls.NewRow(0); xls.Cell(0, "创建OQC个数", style); xls.Cell(1, "QC检验个数", style); xls.Cell(2, "SQE判定个数", style); xls.Cell(3, "平均QC检验时间", style); xls.Cell(4, "平均SQE判定时间", style); xls.Cell(5, "平均IQC执行时间", style); xls.Cell(6, "来料总数", style); xls.Cell(7, "样本总数", style); xls.Cell(8, "缺陷品总数", style); xls.Cell(9, "退换货数量", style); xls.Cell(10, "现场整改数量", style); xls.Cell(11, "让步接收数量", style); xls.Cell(12, "特采放行数量", style); int cellNum = 13; SystemSettingFacade _SystemSettingFacade = new SystemSettingFacade(base.DataProvider); object[] objs = _SystemSettingFacade.GetErrorGroupcode(); if (objs != null && objs.Length > 0) { foreach (ErrorCodeGroupA ecg in objs) { xls.Cell(cellNum, ecg.ErrorCodeGroupDescription, style); cellNum++; } } int rowNum = 1; for (int i = 0; i < this.gridWebGrid.Rows.Count; i++) { xls.NewRow(rowNum); string IQCCCOUNT = this.gridWebGrid.Rows[i].Items.FindItemByKey("IQCCCOUNT").Text; xls.Cell(0, IQCCCOUNT, style); string QCCOUNT = this.gridWebGrid.Rows[i].Items.FindItemByKey("QCCOUNT").Text; xls.Cell(1, QCCOUNT, style); string SQECOUNT = this.gridWebGrid.Rows[i].Items.FindItemByKey("SQECOUNT").Text; xls.Cell(2, SQECOUNT, style); string AVERQCTIME = this.gridWebGrid.Rows[i].Items.FindItemByKey("AVERQCTIME").Text; xls.Cell(3, AVERQCTIME, style); string AVERSQETIME = this.gridWebGrid.Rows[i].Items.FindItemByKey("AVERSQETIME").Text; xls.Cell(4, AVERSQETIME, style); string AVERIQCTIME = this.gridWebGrid.Rows[i].Items.FindItemByKey("AVERIQCTIME").Text; xls.Cell(5, AVERIQCTIME, style); string QTY = this.gridWebGrid.Rows[i].Items.FindItemByKey("QTY").Text; xls.Cell(6, QTY, style); string SAMPLECOUNT = this.gridWebGrid.Rows[i].Items.FindItemByKey("SAMPLECOUNT").Text; xls.Cell(7, SAMPLECOUNT, style); string NGQTY = this.gridWebGrid.Rows[i].Items.FindItemByKey("NGQTY").Text; xls.Cell(8, NGQTY, style); string RETURNQTY = this.gridWebGrid.Rows[i].Items.FindItemByKey("RETURNQTY").Text; xls.Cell(9, RETURNQTY, style); string REFORMQTY = this.gridWebGrid.Rows[i].Items.FindItemByKey("REFORMQTY").Text; xls.Cell(10, REFORMQTY, style); string GIVEQTY = this.gridWebGrid.Rows[i].Items.FindItemByKey("GIVEQTY").Text; xls.Cell(11, GIVEQTY, style); string ACCEPTQTY = this.gridWebGrid.Rows[i].Items.FindItemByKey("ACCEPTQTY").Text; xls.Cell(12, ACCEPTQTY, style); int cellNum2 = 13; if (objs != null && objs.Length > 0) { foreach (ErrorCodeGroupA ecg in objs) { string ngStr = this.gridWebGrid.Rows[i].Items.FindItemByKey(ecg.ErrorCodeGroup).Text; xls.Cell(cellNum2, ngStr, style); cellNum2++; } } rowNum++; } string filename = string.Format("Export_{0}_{1}.{2}", FormatHelper.TODateInt(System.DateTime.Now).ToString(), FormatHelper.TOTimeInt(System.DateTime.Now).ToString(), "xls"); string filepath = string.Format(@"{0}{1}", this.DownloadPhysicalPath, filename); FileStream file = new FileStream(filepath, FileMode.Create, FileAccess.ReadWrite); xls.Save(file); file.Close(); DownLoadFile1(filename); }
//protected override void gridWebGrid_ItemCommand(GridRecord row, string commandName) //{ // if (commandName == "Edit") // { // object obj = this.GetEditObject(row); // if (obj != null) // { // this.SetEditObject(obj); // this.buttonHelper.PageActionStatusHandle(PageActionType.Update); // } // } // else if (commandName == "LinkDetail") // { // string pickNo = row.Items.FindItemByKey("PickNo").Text.Trim(); // //string storageOut = row.Items.FindItemByKey("StorageOut").Text.Trim(); // Response.Redirect(this.MakeRedirectUrl("FCreatePickLineMP.aspx", new string[] { "ACT", "PickNo" }, new string[] { "LinkDetail", pickNo })); // } //} protected override void cmdExport_Click(object sender, EventArgs e) { BenQGuru.eMES.Material.WarehouseFacade _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider); List <string> ca = new List <string>(); XlsPackage xls = new XlsPackage(); IFont font = xls.Black; font.FontHeightInPoints = 10; ICellStyle style = xls.Normal; style.SetFont(font); xls.CreateSheet("出库明细表"); xls.NewRow(0); xls.Cell(0, "拣货任务令号", style); xls.Cell(1, "SAP单据号", style); xls.Cell(2, "出库类型", style); xls.Cell(3, "库位", style); xls.Cell(4, "创建时间", style); xls.Cell(5, "出库执行周期", style); xls.Cell(6, "库房操作周期", style); xls.Cell(7, "下发时间", style); xls.Cell(8, "下发执行周期", style); xls.Cell(9, "拣料开始时间", style); xls.Cell(10, "拣料完成时间", style); xls.Cell(11, "拣料执行周期", style); xls.Cell(12, "包装开始时间", style); xls.Cell(13, "包装完成时间", style); xls.Cell(14, "包装执行周期", style); xls.Cell(15, "OQC开始时间", style); xls.Cell(16, "OQC完成时间", style); xls.Cell(17, "OQC执行周期", style); xls.Cell(18, "箱单开始时间", style); xls.Cell(19, "箱单完成时间", style); xls.Cell(20, "制作箱单周期", style); xls.Cell(21, "发货时间", style); xls.Cell(22, "发货执行周期", style); xls.Cell(23, "箱数", style); xls.Cell(24, "重量", style); xls.Cell(25, "体积", style); xls.Cell(26, "Orderline行数", style); OutStorageDetail[] details = _WarehouseFacade.QueryOutStorageDetails(this.txtStorageCodeQuery.Text, this.drpPickTypeQuery.SelectedValue, FormatHelper.TODateInt(dateInDateFromQuery.Text), FormatHelper.TODateInt(dateInDateToQuery.Text)); int rowNum = 1; for (int i = 0; i < details.Length; i++) { xls.NewRow(rowNum); string PICKNO = details[i].PICKNO; xls.Cell(0, PICKNO, style); string INVNO = details[i].INVNO; xls.Cell(1, INVNO, style); string PICKTYPE = details[i].PICKTYPE; xls.Cell(2, PICKTYPE, style); string StorageCode = details[i].STORAGECODE; xls.Cell(3, StorageCode, style); string CDATE = FormatHelper.TODateTimeString(details[i].CDATE, details[i].CTIME); xls.Cell(4, CDATE, style); decimal periodOutDec = _WarehouseFacade.Totalday(details[i].Delivery_Date, details[i].Delivery_Time, details[i].CDATE, details[i].CTIME); string OUTSTORAGEPERIOD = string.Empty; if (periodOutDec >= 0) { OUTSTORAGEPERIOD = periodOutDec.ToString(); } xls.Cell(5, OUTSTORAGEPERIOD, style); DateWithTime pickBeginTime = _WarehouseFacade.StrToDateWithTime(details[i].MINPICK, '-'); decimal warePeriod = _WarehouseFacade.Totalday(details[i].Delivery_Date, details[i].Delivery_Time, pickBeginTime.Date, pickBeginTime.Time); string WAREPERIOD = string.Empty; if (warePeriod >= 0) { WAREPERIOD = warePeriod.ToString(); } xls.Cell(6, WAREPERIOD, style); string DOWNDATE = FormatHelper.TODateTimeString(details[i].Down_Date, details[i].Down_Time); xls.Cell(7, DOWNDATE, style); string downPeriod = string.Empty; decimal downPeriodDec = _WarehouseFacade.Totalday(details[i].Down_Date, details[i].Down_Time, details[i].CDATE, details[i].CTIME); if (downPeriodDec >= 0) { downPeriod = downPeriodDec.ToString(); } xls.Cell(8, downPeriod, style); string PICKBEGINTIME = FormatHelper.TODateTimeString(pickBeginTime.Date, pickBeginTime.Time); xls.Cell(9, PICKBEGINTIME, style); DateWithTime pickEndTime = _WarehouseFacade.StrToDateWithTime(details[i].MAXPICK, '-'); string PICKENDTIME = FormatHelper.TODateTimeString(pickEndTime.Date, pickEndTime.Time); xls.Cell(10, PICKENDTIME, style); decimal pickPeriod = _WarehouseFacade.Totalday(pickEndTime.Date, pickEndTime.Time, pickBeginTime.Date, pickBeginTime.Time); string pickPeriodStr = string.Empty; if (pickPeriod >= 0) { pickPeriodStr = pickPeriod.ToString(); } xls.Cell(11, pickPeriodStr, style); //DateWithTime packBeginTime = _WarehouseFacade.StrToDateWithTime(details[i].MINPACK, '-'); DateWithTime packBeginTime = pickEndTime; DateWithTime packEndTime = _WarehouseFacade.StrToDateWithTime(details[i].MAXPACK, '-'); string PACKBEGINTIME = FormatHelper.TODateTimeString(packBeginTime.Date, packBeginTime.Time); xls.Cell(12, PACKBEGINTIME, style); string PACKENDTIME = FormatHelper.TODateTimeString(packEndTime.Date, packEndTime.Time); xls.Cell(13, PACKENDTIME, style); decimal packPeriod = _WarehouseFacade.Totalday(packEndTime.Date, packEndTime.Time, packBeginTime.Date, packBeginTime.Time); string packPeriodStr = string.Empty; if (packPeriod >= 0) { packPeriodStr = packPeriod.ToString(); } xls.Cell(14, packPeriodStr, style); //DateWithTime oqcBeginTime = _WarehouseFacade.StrToDateWithTime(details[i].OQCCDATE, '-'); DateWithTime oqcBeginTime = packEndTime; string OQCBEGINTIME = FormatHelper.TODateTimeString(oqcBeginTime.Date, oqcBeginTime.Time); xls.Cell(15, OQCBEGINTIME, style); DateWithTime oqcEndTime = _WarehouseFacade.StrToDateWithTime(details[i].OQCDATE, '-'); string OQCENDTIME = FormatHelper.TODateTimeString(oqcEndTime.Date, oqcEndTime.Time); xls.Cell(16, OQCENDTIME, style); decimal oqcPeriod = _WarehouseFacade.Totalday(oqcEndTime.Date, oqcEndTime.Time, oqcBeginTime.Date, oqcBeginTime.Time); string oqcPeriodStr = string.Empty; if (oqcPeriod >= 0) { oqcPeriodStr = oqcPeriod.ToString(); } xls.Cell(17, oqcPeriodStr, style); //DateWithTime cartonnoBeginTime = _WarehouseFacade.StrToDateWithTime(details[i].CDATETIME, '-'); DateWithTime cartonnoBeginTime = oqcEndTime; string CARINVNOBEGINTIME = FormatHelper.TODateTimeString(cartonnoBeginTime.Date, cartonnoBeginTime.Time); xls.Cell(18, CARINVNOBEGINTIME, style); string CARINVNOENDTIME = FormatHelper.TODateTimeString(details[i].Packing_List_Date, details[i].Packing_List_Time); xls.Cell(19, CARINVNOENDTIME, style); decimal carinvnoPeriod = _WarehouseFacade.Totalday(details[i].Packing_List_Date, details[i].Packing_List_Time, cartonnoBeginTime.Date, cartonnoBeginTime.Time); string carinvnoPeriodStr = string.Empty; if (carinvnoPeriod >= 0) { carinvnoPeriodStr = carinvnoPeriod.ToString(); } xls.Cell(20, carinvnoPeriodStr, style); string OUTSTORAGETIME = FormatHelper.TODateTimeString(details[i].Delivery_Date, details[i].Delivery_Time); xls.Cell(21, OUTSTORAGETIME, style); decimal outStoragePeriod1 = _WarehouseFacade.Totalday(details[i].Delivery_Date, details[i].Delivery_Time, details[i].Packing_List_Date, details[i].Packing_List_Time); string outStoragePeriod1Str = string.Empty; if (outStoragePeriod1 >= 0) { outStoragePeriod1Str = outStoragePeriod1.ToString(); } xls.Cell(22, outStoragePeriod1Str, style); string CARTONNOS = details[i].CARTONNOS.ToString(); xls.Cell(23, CARTONNOS, style); string WEIGHT = details[i].GROSS_WEIGHT.ToString(); xls.Cell(24, WEIGHT, style); string VOLUME = details[i].VOLUMN.ToString(); xls.Cell(25, VOLUME, style); string ORDERLINES = _WarehouseFacade.QueryOrderLines(details[i].PICKNO).ToString(); xls.Cell(26, ORDERLINES, style); rowNum++; } string filename = string.Format("Export_{0}_{1}.{2}", FormatHelper.TODateInt(System.DateTime.Now).ToString(), FormatHelper.TOTimeInt(System.DateTime.Now).ToString(), "xls"); string filepath = string.Format(@"{0}{1}", this.DownloadPhysicalPath, filename); FileStream file = new FileStream(filepath, FileMode.Create, FileAccess.ReadWrite); xls.Save(file); file.Close(); DownLoadFile1(filename); }
protected void cmdLoadCheckResult_click(object sender, EventArgs e) { if (_WarehouseFacade == null) { _WarehouseFacade = new BenQGuru.eMES.Material.WarehouseFacade(base.DataProvider); } ArrayList array = this.gridHelper.GetCheckedRows(); if (array == null) { return; } if (array.Count != 1) { WebInfoPublish.Publish(this, "只能选择一行!", this.languageComponent1); return; } string time = DateTime.Now.ToString("yyyyMMdd_HHmmss");//")+ ""+DateTime.Now.ToString(" XlsPackage xls = new XlsPackage(); string filename = string.Format("Export_{0}_{1}.{2}", FormatHelper.TODateInt(System.DateTime.Now).ToString(), FormatHelper.TOTimeInt(System.DateTime.Now).ToString(), "xls"); string filepath = string.Format(@"{0}{1}", this.DownloadPhysicalPath, filename); int n = 1; foreach (GridRecord row1 in array) { string checkNo = row1.Items.FindItemByKey("CheckNo").Text; xls.CreateSheet("sheet" + n); xls.NewRow(0); xls.Cell(0, "盘点单号:", xls.Normal); xls.Cell(1, checkNo, xls.Normal); xls.NewRow(1); xls.Cell(0, "库位", xls.Normal); xls.Cell(1, "鼎桥物料编码", xls.Normal); xls.Cell(2, "盘点数量", xls.Normal); BenQGuru.eMES.Domain.Warehouse.StockCheck ssss = (BenQGuru.eMES.Domain.Warehouse.StockCheck)_WarehouseFacade.GetStockCheck(checkNo); if (ssss.CheckType != "All") { WebInfoPublish.Publish(this, "必须是全盘才可用!", this.languageComponent1); return; } int i = 1; BenQGuru.eMES.Domain.Warehouse.StockCheckDetail[] sdddd = _WarehouseFacade.GetDisStockCheckDetails(checkNo); foreach (BenQGuru.eMES.Domain.Warehouse.StockCheckDetail d in sdddd) { xls.NewRow(1 + i); xls.Cell(0, d.StorageCode, xls.Normal); xls.Cell(1, d.DQMCODE, xls.Normal); xls.Cell(2, d.CheckQty.ToString(), xls.Normal); i++; } n++; } System.IO.FileStream file = new System.IO.FileStream(filepath, System.IO.FileMode.Create, System.IO.FileAccess.ReadWrite); xls.Save(file); file.Close(); DownLoadFile1(filename); }