diff --git a/DataBase/版本日志/SGGLDB_WH_2024-01-18.sql b/DataBase/版本日志/SGGLDB_WH_2024-01-18.sql new file mode 100644 index 00000000..6fa5d0ca --- /dev/null +++ b/DataBase/版本日志/SGGLDB_WH_2024-01-18.sql @@ -0,0 +1,299 @@ +update DriverPrepare_SchemePlanItem set SchemePlanId='' where SchemePlanId='ϳɰĿ' +GO +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ù','ϵͳɨ',1) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ù','ϵͳɨ',2) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ù','DZɨ',3) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ù','ˮˮˮϴ',4) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ù','ѭˮϴ',5) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ù','ѭˮԳ',6) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ù','ϵͳѧϴԤĤ',7) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ù','ˮϴ',8) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ù','¯ˮϴ',9) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ù','Ȼߴɨû',10) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ù','ϵͳԷ',11) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ù','ϵͳϴѹ',12) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ù','ϵͳõԳ',13) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ù','ҩϵͳԳ',14) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ù','˹޳ϴװϴͶ÷',15) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ù','ȴԳ',16) +--insert into DriverPrepare_SchemePlanItem values +--(NEWID(),'ù','ϵͳѧϴԤĤ',17) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ù','ϵͳ̬з',18) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ù','ϵͳͶԳ',19) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ù','װ豸ܵϴ©',20) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ù','ϴ',21) +--insert into DriverPrepare_SchemePlanItem values +--(NEWID(),'ù','ϵͳõԳ',22) +--insert into DriverPrepare_SchemePlanItem values +--(NEWID(),'ù','ҩϵͳԳ',23) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ù','ϵͳԳ',24) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'շ','DZѹվԳ',1) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'շ','շװԳ',2) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'շ','շѹ©',3) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'շ','շ䷽',4) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'շ','ּܲ',5) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'շ','ѭϴɨ',6) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'շ','շָѹԳѹͷ',7) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'շ','շѹԳѹͷ',8) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'շ','շֵѹͷ0.4MPa',9) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'շ','ˮϴ',10) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'շ','ɸҺϵͳϴ',11) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'շ','շִϵͳɸװAL2O3',12) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'շ','ϵͳɸ̿صԼ',13) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'շ','շԤϵͳװ',14) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'շ','շϵͳɨڡ⣩',15) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'շ','շɰװ',16) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'շ','ѹѹ͸ƽϴ',17) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'շ','շֿѹѹ͸ƽת',18) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'շ','շֿѹԳ',19) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'շ','廯﮻Գ',20) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'շ','ͻԳ',21) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'շ','ҺͻԳ',22) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'շ','۵ѹԳ',23) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'շ','͸ƽϵͳ©鷽',24) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'շ','Һ崢Ͷ÷',25) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'շ','󱸳ѹϵͳԳͷ',26) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'շ','󱸵ѹϵͳԳͷ',27) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'շ','շװͶԳ',28) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','úԳ',1) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','úϵͳԳPLCԷ',2) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','ʽԷ',3) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','ʽͻԷ',4) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','Է',5) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','ϴˮվԡͶ÷',6) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','úƱϵͳ߳ϴ',7) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','ĥߵѹվѭ',8) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','ĥߵѹվԳ',9) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','úؽϻԳ',10) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','úֳУ鷽',11) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','ĥϲ۱Գ',12) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','ĥӰԳԷ',13) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','ĥúˮԳ',14) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','úƱϵͳԳ',15) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','Һܵϴ',16) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','ܵɨ',17) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','¯ˮ߳ϴ',18) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','ߴɨ',19) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','ѭϴշֳγѭϴ',20) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','ѹߴɨܷ',21) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','ѹúԳ',22) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','Գ',23) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','Գ',24) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','¯ԭʼ¯',25) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','ȴˮϵͳԷ',26) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','ϵͳԷ',27) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','չϵͳԳ',28) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','۰ϻԳ',29) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','ϵͳ鷽',30) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','¯ѹϵͳܷ',31) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','ϵͳܷ',32) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','¯Ͷǰû',33) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','ϵͳܷ',34) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','ˮԳ',35) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','װͶԳ',36) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','任չߴɨ',1) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','任ˮϵͳϴ',2) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','任߻װ',3) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','任߻򻯷',4) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','任鷽',5) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','任û',6) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','任Ϲ¯ ',7) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','任Գ',8) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','任ͶԳ',9) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','ѹչߴɨ',10) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','ѵû﷽',11) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','鷽',12) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','Ѹ״õԳ',13) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','ѭѹϴ',14) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','ѭѹԳ',15) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','ˮ˷',16) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','״ϵͳ',17) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','¼״ϴ״',18) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','״ѭԤ䷽',19) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','ͶԳ',20) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','Һϴߴɨ',21) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','Һϴû',22) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','Һϴ鷽',23) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','Һϴ䷽',24) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','Һϴɰװ',25) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','Һϴɸװ',26) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','Һϴɸ̿ϵͳԼ',27) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','ҺϴҺ',28) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','ҺϴͶԳ',29) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','չ߳ϴɨ',30) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','鷽',31) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','շԳ',32) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','մ߻װ',33) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','պ¯',34) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','շϹ󷽰',35) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','պ¯¯',36) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','չͲԳװһģ',37) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'','ͶԳ',38) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ϳ','չߴɨ',1) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ϳ','ϳ鷽',2) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ϳ','û',3) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ϳ','ϳ߻װ',4) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ϳ','¯¯',5) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ϳ','Ϲ',6) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ϳ','ϳѹϴ',7) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ϳ','ѹϴ',8) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ϳ','͸ƽϵͳ©鷽',9) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ϳ','ϳѹ͸ƽҺϵͳϴ',10) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ϳ','ϳѹ͸ƽת',11) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ϳ','ϳѹԳ',12) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ϳ','ѹ͸ƽԳ',13) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ϳ','ѹԳ',14) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ϳ','ϳԳ ',15) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ϳ','䶳ϵͳ䰱',16) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ϳ','ϳ߻»ԭ',17) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ϳ','ϳװͶԳ',18) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ϳ','渨ܵϴɨ',19) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ϳ','ϵͳܷ',20) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ϳ','õԳ',21) +insert into DriverPrepare_SchemePlanItem values +(NEWID(),'ϳ','Ե𷽰',22) +GO \ No newline at end of file diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index 80f6b286..95863f08 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -3186,6 +3186,10 @@ namespace BLL /// 开车方案编制计划模板文件原始虚拟路径 /// public const string SchemePlanTemplateUrl = "File\\Excel\\TestRun\\开车方案编制计划.xlsx"; + /// + /// 开车责任分工表模板文件原始虚拟路径 + /// + public const string DutyTemplateUrl = "File\\Excel\\TestRun\\开车责任分工表.xlsx"; #endregion #region 绩效考核模板文件路径 diff --git a/SGGL/BLL/TestRun/DriverPrepare/DriverPrepareSchemePlanItemService.cs b/SGGL/BLL/TestRun/DriverPrepare/DriverPrepareSchemePlanItemService.cs index 74690e60..2334bbc3 100644 --- a/SGGL/BLL/TestRun/DriverPrepare/DriverPrepareSchemePlanItemService.cs +++ b/SGGL/BLL/TestRun/DriverPrepare/DriverPrepareSchemePlanItemService.cs @@ -39,7 +39,7 @@ namespace BLL /// public static List GetModelList() { - return (from x in Funs.DB.DriverPrepare_SchemePlanItem where x.SchemePlanId == "合成氨尿素项目" || x.SchemePlanId == "磷酸项目" || x.SchemePlanId == "LNG项目" select x).ToList(); + return (from x in Funs.DB.DriverPrepare_SchemePlanItem where x.SchemePlanId == "公用工程" || x.SchemePlanId == "空分" || x.SchemePlanId == "气化" || x.SchemePlanId == "净化" || x.SchemePlanId == "合成" || x.SchemePlanId == "尿素" || x.SchemePlanId == "磷酸项目" || x.SchemePlanId == "LNG项目" select x).ToList(); } /// diff --git a/SGGL/FineUIPro.Web/File/Excel/TestRun/开车责任分工表.xlsx b/SGGL/FineUIPro.Web/File/Excel/TestRun/开车责任分工表.xlsx new file mode 100644 index 00000000..4919a622 Binary files /dev/null and b/SGGL/FineUIPro.Web/File/Excel/TestRun/开车责任分工表.xlsx differ diff --git a/SGGL/FineUIPro.Web/TestRun/DriverPrepare/Duty.aspx b/SGGL/FineUIPro.Web/TestRun/DriverPrepare/Duty.aspx index 05579f14..8d5e0d7d 100644 --- a/SGGL/FineUIPro.Web/TestRun/DriverPrepare/Duty.aspx +++ b/SGGL/FineUIPro.Web/TestRun/DriverPrepare/Duty.aspx @@ -38,6 +38,9 @@ + + diff --git a/SGGL/FineUIPro.Web/TestRun/DriverPrepare/Duty.aspx.cs b/SGGL/FineUIPro.Web/TestRun/DriverPrepare/Duty.aspx.cs index 66a83189..13fab933 100644 --- a/SGGL/FineUIPro.Web/TestRun/DriverPrepare/Duty.aspx.cs +++ b/SGGL/FineUIPro.Web/TestRun/DriverPrepare/Duty.aspx.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; +using System.IO; using System.Linq; namespace FineUIPro.Web.TestRun.DriverPrepare @@ -156,5 +157,181 @@ namespace FineUIPro.Web.TestRun.DriverPrepare } } #endregion + + #region 导出按钮 + /// 导出按钮 + /// + /// + /// + protected void btnOut_Click(object sender, EventArgs e) + { + string rootPath = Server.MapPath("~/"); + string initTemplatePath = string.Empty; + string uploadfilepath = string.Empty; + string newUrl = string.Empty; + string filePath = string.Empty; + initTemplatePath = Const.DutyTemplateUrl; + uploadfilepath = rootPath + initTemplatePath; + var duty = (from x in Funs.DB.DriverPrepare_Duty where x.ProjectId == this.CurrUser.LoginProjectId select x).FirstOrDefault(); + if (duty != null) + { + string projectName = BLL.ProjectService.GetProjectNameByProjectId(duty.ProjectId); + newUrl = uploadfilepath.Replace(".xlsx", "(" + projectName + ")" + ".xlsx"); + File.Copy(uploadfilepath, newUrl); + // 第一步:读取文件流 + NPOI.SS.UserModel.IWorkbook workbook; + using (FileStream stream = new FileStream(newUrl, FileMode.Open, FileAccess.Read)) + { + workbook = new NPOI.XSSF.UserModel.XSSFWorkbook(stream); + } + // 创建单元格样式 + NPOI.SS.UserModel.ICellStyle cellStyle = workbook.CreateCellStyle(); + cellStyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin; + cellStyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin; + cellStyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin; + cellStyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin; + cellStyle.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center; + cellStyle.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center; + var font = workbook.CreateFont(); + font.FontHeightInPoints = 11; + cellStyle.SetFont(font); + NPOI.SS.UserModel.ICellStyle cellStyle0 = workbook.CreateCellStyle(); + cellStyle0.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin; + cellStyle0.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin; + cellStyle0.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin; + cellStyle0.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin; + cellStyle0.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Left; + cellStyle0.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center; + var font0 = workbook.CreateFont(); + font0.FontHeightInPoints = 11; + font0.IsBold = false; + cellStyle0.SetFont(font0); + // 第二步:创建新数据行 + NPOI.SS.UserModel.ISheet sheet = workbook.GetSheetAt(0); + NPOI.SS.UserModel.IRow row = sheet.GetRow(1); + NPOI.SS.UserModel.ICell cell; + cell = row.GetCell(3); + cell.CellStyle = cellStyle0; + cell.SetCellValue("项目名称:" + projectName); + var items = BLL.DriverPrepareDutyItemService.GetLists(duty.DutyId); + int i = 4; + foreach (var item in items) + { + // 第二步:创建新数据行 + row = sheet.GetRow(i); + // 添加数据 + cell = row.GetCell(3); + cell.CellStyle = cellStyle; + if (item.Item1 == true) + { + cell.SetCellValue("√"); + } + cell = row.GetCell(4); + cell.CellStyle = cellStyle; + if (item.Item2 == true) + { + cell.SetCellValue("√"); + } + cell = row.GetCell(5); + cell.CellStyle = cellStyle; + if (item.Item3 == true) + { + cell.SetCellValue("√"); + } + cell = row.GetCell(6); + cell.CellStyle = cellStyle; + if (item.Item4 == true) + { + cell.SetCellValue("√"); + } + cell = row.GetCell(7); + cell.CellStyle = cellStyle; + if (item.Item5 == true) + { + cell.SetCellValue("√"); + } + cell = row.GetCell(8); + cell.CellStyle = cellStyle; + if (item.Item6 == true) + { + cell.SetCellValue("√"); + } + cell = row.GetCell(9); + cell.CellStyle = cellStyle; + if (item.Item7 == true) + { + cell.SetCellValue("√"); + } + cell = row.GetCell(10); + cell.CellStyle = cellStyle; + if (item.Item8 == true) + { + cell.SetCellValue("√"); + } + cell = row.GetCell(11); + cell.CellStyle = cellStyle; + if (item.Item9 == true) + { + cell.SetCellValue("√"); + } + cell = row.GetCell(12); + cell.CellStyle = cellStyle; + if (item.Item10 == true) + { + cell.SetCellValue("√"); + } + cell = row.GetCell(13); + cell.CellStyle = cellStyle; + if (item.Item11 == true) + { + cell.SetCellValue("√"); + } + cell = row.GetCell(14); + cell.CellStyle = cellStyle; + if (item.Item12 == true) + { + cell.SetCellValue("√"); + } + cell = row.GetCell(15); + cell.CellStyle = cellStyle; + if (item.Item13 == true) + { + cell.SetCellValue("√"); + } + cell = row.GetCell(16); + cell.CellStyle = cellStyle; + if (item.Item14 == true) + { + cell.SetCellValue("√"); + } + cell = row.GetCell(17); + cell.CellStyle = cellStyle; + cell.SetCellValue(item.Remark); + i++; + } + // 第三步:写入文件流 + using (FileStream stream = new FileStream(newUrl, FileMode.Create, FileAccess.Write)) + { + workbook.Write(stream); + workbook.Close(); + } + string fileName = Path.GetFileName(newUrl); + FileInfo info = new FileInfo(newUrl); + long fileSize = info.Length; + Response.Clear(); + Response.ContentType = "application/x-zip-compressed"; + Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + Response.AddHeader("Content-Length", fileSize.ToString()); + Response.TransmitFile(newUrl, 0, fileSize); + Response.Flush(); + Response.Close(); + File.Delete(newUrl); + } + else + { + Alert.ShowInTop("当前无记录,无法导出!", MessageBoxIcon.Warning); + } + } + #endregion } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/TestRun/DriverPrepare/Duty.aspx.designer.cs b/SGGL/FineUIPro.Web/TestRun/DriverPrepare/Duty.aspx.designer.cs index 6df812db..56f7ecf6 100644 --- a/SGGL/FineUIPro.Web/TestRun/DriverPrepare/Duty.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/TestRun/DriverPrepare/Duty.aspx.designer.cs @@ -75,6 +75,15 @@ namespace FineUIPro.Web.TestRun.DriverPrepare { /// protected global::FineUIPro.Button btnModify; + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + /// /// btnDel 控件。 /// diff --git a/SGGL/FineUIPro.Web/TestRun/DriverPrepare/DutyEdit.aspx b/SGGL/FineUIPro.Web/TestRun/DriverPrepare/DutyEdit.aspx index 46a68e32..53775706 100644 --- a/SGGL/FineUIPro.Web/TestRun/DriverPrepare/DutyEdit.aspx +++ b/SGGL/FineUIPro.Web/TestRun/DriverPrepare/DutyEdit.aspx @@ -28,7 +28,7 @@ TitleToolTip="开车责任分工表" AutoScroll="true"> + <%-- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + --%> @@ -83,8 +167,8 @@ - - + + diff --git a/SGGL/FineUIPro.Web/TestRun/DriverPrepare/DutyEdit.aspx.cs b/SGGL/FineUIPro.Web/TestRun/DriverPrepare/DutyEdit.aspx.cs index a8818dbf..06e032d5 100644 --- a/SGGL/FineUIPro.Web/TestRun/DriverPrepare/DutyEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/TestRun/DriverPrepare/DutyEdit.aspx.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.Linq; +using AspNet = System.Web.UI.WebControls; namespace FineUIPro.Web.TestRun.DriverPrepare { @@ -34,6 +35,8 @@ namespace FineUIPro.Web.TestRun.DriverPrepare } BindGrid(); } + //Grid1.EnableCheckBoxSelect = true; + //Grid1.CheckBoxSelectOnly = true; } } #endregion @@ -141,6 +144,46 @@ namespace FineUIPro.Web.TestRun.DriverPrepare BLL.DriverPrepareDutyItemService.UpdateDutyItem(item); } } + + //int rowsCount = this.Grid1.Rows.Count; + //foreach (JObject mergedRow in Grid1.GetMergedData()) + //{ + // int i = mergedRow.Value("index"); + // var item = list.FirstOrDefault(x => x.DutyItemId == Grid1.Rows[i].RowID); + // JObject values = mergedRow.Value("values"); + // AspNet.CheckBox cbItem1 = (AspNet.CheckBox)(this.Grid1.Rows[i].FindControl("cbItem1")); + // AspNet.CheckBox cbItem2 = (AspNet.CheckBox)(this.Grid1.Rows[i].FindControl("cbItem2")); + // AspNet.CheckBox cbItem3 = (AspNet.CheckBox)(this.Grid1.Rows[i].FindControl("cbItem3")); + // AspNet.CheckBox cbItem4 = (AspNet.CheckBox)(this.Grid1.Rows[i].FindControl("cbItem4")); + // AspNet.CheckBox cbItem5 = (AspNet.CheckBox)(this.Grid1.Rows[i].FindControl("cbItem5")); + // AspNet.CheckBox cbItem6 = (AspNet.CheckBox)(this.Grid1.Rows[i].FindControl("cbItem6")); + // AspNet.CheckBox cbItem7 = (AspNet.CheckBox)(this.Grid1.Rows[i].FindControl("cbItem7")); + // AspNet.CheckBox cbItem8 = (AspNet.CheckBox)(this.Grid1.Rows[i].FindControl("cbItem8")); + // AspNet.CheckBox cbItem9 = (AspNet.CheckBox)(this.Grid1.Rows[i].FindControl("cbItem9")); + // AspNet.CheckBox cbItem10 = (AspNet.CheckBox)(this.Grid1.Rows[i].FindControl("cbItem10")); + // AspNet.CheckBox cbItem11 = (AspNet.CheckBox)(this.Grid1.Rows[i].FindControl("cbItem11")); + // AspNet.CheckBox cbItem12 = (AspNet.CheckBox)(this.Grid1.Rows[i].FindControl("cbItem12")); + // AspNet.CheckBox cbItem13 = (AspNet.CheckBox)(this.Grid1.Rows[i].FindControl("cbItem13")); + // AspNet.CheckBox cbItem14 = (AspNet.CheckBox)(this.Grid1.Rows[i].FindControl("cbItem14")); + // item.Item1 = cbItem1.Checked; + // item.Item2 = cbItem2.Checked; + // item.Item3 = cbItem3.Checked; + // item.Item4 = cbItem4.Checked; + // item.Item5 = cbItem5.Checked; + // item.Item6 = cbItem6.Checked; + // item.Item7 = cbItem7.Checked; + // item.Item8 = cbItem8.Checked; + // item.Item9 = cbItem9.Checked; + // item.Item10 = cbItem10.Checked; + // item.Item11 = cbItem11.Checked; + // item.Item12 = cbItem12.Checked; + // item.Item13 = cbItem13.Checked; + // item.Item14 = cbItem14.Checked; + // item.Remark = values.Value("Remark"); + // BLL.DriverPrepareDutyItemService.UpdateDutyItem(item); + //} + + ShowNotify("保存成功!", MessageBoxIcon.Success); PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); } diff --git a/SGGL/FineUIPro.Web/TestRun/DriverPrepare/SchemePlanItemAdd.aspx.cs b/SGGL/FineUIPro.Web/TestRun/DriverPrepare/SchemePlanItemAdd.aspx.cs index 3b71c7b6..c6f319a4 100644 --- a/SGGL/FineUIPro.Web/TestRun/DriverPrepare/SchemePlanItemAdd.aspx.cs +++ b/SGGL/FineUIPro.Web/TestRun/DriverPrepare/SchemePlanItemAdd.aspx.cs @@ -34,7 +34,7 @@ namespace FineUIPro.Web.TestRun.DriverPrepare Model.DriverPrepare_SchemePlanItem newItem = new Model.DriverPrepare_SchemePlanItem(); newItem.SolutionName = this.txtSolutionName.Text.Trim(); Model.DriverPrepare_SchemePlan plan = BLL.DriverPrepareSchemePlanService.GetDriverPlanByProjectId(this.CurrUser.LoginProjectId); - int sortIndex = 21; + int sortIndex = 200; if (plan != null) { var items = BLL.DriverPrepareSchemePlanItemService.GetSchemePlanItemByschemePlanId(plan.SchemePlanId); diff --git a/SGGL/FineUIPro.Web/TestRun/DriverPrepare/SchemePlanItemSelect.aspx b/SGGL/FineUIPro.Web/TestRun/DriverPrepare/SchemePlanItemSelect.aspx index 1895bcb4..f4853597 100644 --- a/SGGL/FineUIPro.Web/TestRun/DriverPrepare/SchemePlanItemSelect.aspx +++ b/SGGL/FineUIPro.Web/TestRun/DriverPrepare/SchemePlanItemSelect.aspx @@ -33,11 +33,27 @@ + + + + + + + + + + + + + + + private void BindGrid() { + string[] selectRowId = Grid1.SelectedRowIDArray; + foreach (GridRow row in Grid1.Rows) + { + if (selectRowId.Contains(row.RowID)) + { + hdNames.Text += row.DataKeys[1].ToString() + ","; + } + } string strSql = @"SELECT * FROM dbo.DriverPrepare_SchemePlanItem WHERE SchemePlanId=@SchemePlanId"; List listStr = new List(); - listStr.Add(new SqlParameter("@SchemePlanId", this.rblType.SelectedValue)); + if (this.rblType.SelectedValue == "合成氨尿素项目") + { + listStr.Add(new SqlParameter("@SchemePlanId", this.rblType2.SelectedValue)); + } + else + { + listStr.Add(new SqlParameter("@SchemePlanId", this.rblType.SelectedValue)); + } SqlParameter[] parameter = listStr.ToArray(); DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); @@ -109,7 +132,7 @@ namespace FineUIPro.Web.TestRun.DriverPrepare string[] selectRowId = Grid1.SelectedRowIDArray; foreach (GridRow row in Grid1.Rows) { - if (selectRowId.Contains(row.RowID) && !nameLists.Contains(row.DataKeys[1].ToString())) + if (selectRowId.Contains(row.RowID) && !nameLists.Contains(row.DataKeys[1].ToString()) && !hdNames.Text.Contains(row.DataKeys[1].ToString())) { Model.DriverPrepare_SchemePlanItem newItem = new Model.DriverPrepare_SchemePlanItem(); newItem.SchemePlanItemId = SQLHelper.GetNewID(); @@ -119,6 +142,23 @@ namespace FineUIPro.Web.TestRun.DriverPrepare BLL.DriverPrepareSchemePlanItemService.AddSchemePlanItem(newItem); } } + if (!string.IsNullOrEmpty(hdNames.Text)) + { + string[] names = hdNames.Text.Split(','); + foreach (var item in names) + { + if (!string.IsNullOrEmpty(item) && !nameLists.Contains(item)) + { + Model.DriverPrepare_SchemePlanItem newItem = new Model.DriverPrepare_SchemePlanItem(); + newItem.SchemePlanItemId = SQLHelper.GetNewID(); + newItem.SchemePlanId = newData.SchemePlanId; + newItem.SolutionName = item; + Random ra = new Random(); + newItem.SortIndex = ra.Next(20, 200); + BLL.DriverPrepareSchemePlanItemService.AddSchemePlanItem(newItem); + } + } + } PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); } #endregion diff --git a/SGGL/FineUIPro.Web/TestRun/DriverPrepare/SchemePlanItemSelect.aspx.designer.cs b/SGGL/FineUIPro.Web/TestRun/DriverPrepare/SchemePlanItemSelect.aspx.designer.cs index cdda17c8..65407acd 100644 --- a/SGGL/FineUIPro.Web/TestRun/DriverPrepare/SchemePlanItemSelect.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/TestRun/DriverPrepare/SchemePlanItemSelect.aspx.designer.cs @@ -84,6 +84,15 @@ namespace FineUIPro.Web.TestRun.DriverPrepare { /// protected global::FineUIPro.ToolbarFill ToolbarFill1; + /// + /// hdNames 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdNames; + /// /// btnAccept 控件。 /// @@ -92,5 +101,32 @@ namespace FineUIPro.Web.TestRun.DriverPrepare { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnAccept; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// rblType2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.RadioButtonList rblType2; + + /// + /// ToolbarFill2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill2; } }