diff --git a/DataBase/版本日志/SGGLDB_WH_V2025-03-07-gf.sql b/DataBase/版本日志/SGGLDB_WH_V2025-03-07-gf.sql new file mode 100644 index 00000000..b17b6869 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_WH_V2025-03-07-gf.sql @@ -0,0 +1,327 @@ + +--ȡǰ˴ +ALTER PROCEDURE [dbo].[Sp_Project_GetToDoItems] + @projectId NVARCHAR(50)=NULL, + @userId NVARCHAR(200)=NULL +AS +/*ȡǰ˴*/ +BEGIN +SELECT HazardRegisterId AS DataId + ,'B6BE5FE0-CB84-47FF-A6C3-5AD9E1CCE079' AS MenuId + ,'ȫѲ' AS MenuName + ,register.RegisterDef AS Content + ,UserId + ,users.UserName + ,register.RegisterDate AS DataTime + ,CONVERT(varchar(100),register.RegisterDate, 23) AS DataTimeStr + ,'../HSSE/HiddenInspection/HiddenRectificationRectify.aspx?HazardRegisterId='+register.HazardRegisterId AS PCUrl +FROM HSSE_Hazard_HazardRegister AS register +LEFT JOIN Sys_User AS users ON users.UserId =@userId +WHERE register.ProjectId=@projectId AND +((register.states = '1' AND (register.ResponsibleMan =@userId OR register.CCManIds LIKE ('%'+@userId+'%') )) +) +UNION ALL + +SELECT HazardRegisterId AS DataId + ,'B6BE5FE0-CB84-47FF-A6C3-5AD9E1CCE079' AS MenuId + ,'ȫѲȷ' AS MenuName + ,register.RegisterDef AS Content + ,UserId + ,users.UserName + ,register.RegisterDate AS DataTime + ,CONVERT(varchar(100),register.RegisterDate, 23) AS DataTimeStr + ,'../HSSE/HiddenInspection/HiddenRectificationConfirm.aspx?HazardRegisterId='+register.HazardRegisterId AS PCUrl +FROM HSSE_Hazard_HazardRegister AS register +LEFT JOIN Sys_User AS users ON users.UserId =@userId +WHERE register.ProjectId=@projectId AND +register.states = '2' AND register.CheckManId =@userId + +UNION ALL +SELECT CheckControlCode AS DataId + ,'B3E99BD9-FDC7-4F15-8C3C-A7821AC9E306' AS MenuId + ,'Ѳ' AS MenuName + ,checkControl.QuestionDef AS Content + ,UserId + ,users.UserName + ,checkControl.CheckDate AS DataTime + ,CONVERT(varchar(100),checkControl.CheckDate, 23) AS DataTimeStr + ,'../CQMS/Check/ChecklistEdit.aspx?ToDo=ToDo&CheckControlCode='+checkControl.CheckControlCode AS PCUrl +FROM Check_CheckControl AS checkControl +LEFT JOIN Sys_User AS users ON users.UserId =@userId +WHERE checkControl.ProjectId=@projectId AND +checkControl.State != '7' AND checkControl.CheckControlCode in (select CheckControlCode from Check_CheckControlApprove approve where approve.ApproveType!='S' and approve.ApproveMan=@userId and approve.ApproveDate is null ) + +UNION ALL +SELECT GJSXID AS DataId + ,'0BEA2126-7A48-40EB-8E21-99148E91A22B' AS MenuId + ,'ؼ' AS MenuName + ,GJSX.Detail AS Content + ,users.UserId + ,users.UserName + ,GJSX.CreateDate AS DataTime + ,CONVERT(varchar(100),GJSX.CreateDate, 23) AS DataTimeStr + ,'../PZHGL/GJSX/GJSXListEdit.aspx?ToDo=ToDo&EditType=Edit&ID='+GJSXID AS PCUrl +FROM GJSX +LEFT JOIN Sys_User AS users ON users.UserId =@userId +WHERE GJSX.ProjectId=@projectId AND +GJSX.State != 0 AND (((select count(*) from GJSX_detail detail where detail.Progress_user=@userId and detail.GJSXID=GJSX.GJSXID)=0 +and (select count(*) from GJSX_Process process where process.UserId=@userId and process.GJSXID=GJSX.GJSXID)>0) +or (GJSX.User_Acceptance like '%'+@userId+'%' and (select count(*) from GJSX_detail detail where detail.GJSXID=GJSX.GJSXID)=(select count(*) from GJSX_Process process where process.GJSXID=GJSX.GJSXID)) +) + +--UNION ALL +--SELECT InspectionEquipmentId AS DataId +-- ,'6c2c1e5e-1812-4e1c-a683-7125518e28c7' AS MenuId +-- ,'豸ϱȷ' AS MenuName +-- ,Equipment.InspectionName AS Content +-- ,UserId +-- ,users.UserName +-- ,Equipment.InspectionDate AS DataTime +-- ,CONVERT(varchar(100),Equipment.InspectionDate, 23) AS DataTimeStr +-- ,'../CQMS/Comprehensive/InspectionEquipmentEdit.aspx?ToDo=ToDo&InspectionEquipmentId='+Equipment.InspectionEquipmentId AS PCUrl +--FROM Comprehensive_InspectionEquipment AS Equipment +--LEFT JOIN Sys_User AS users ON users.UserId =@userId +--WHERE Equipment.ProjectId=@projectId and +--Equipment.Status!='3' AND Equipment.InspectionEquipmentId in (select InspectionEquipmentId from Comprehensive_InspectionEquipmentApprove approve where approve.ApproveType!='S' and approve.ApproveMan=@userId and approve.ApproveDate is null ) +--UNION ALL +--SELECT InspectionPersonId AS DataId +-- ,'8ed133de-5899-4687-878a-20b1f5280f18' AS MenuId +-- ,'Աȷ' AS MenuName +-- ,Person.PersonName AS Content +-- ,UserId +-- ,users.UserName +-- ,Person.CompileDate AS DataTime +-- ,CONVERT(varchar(100),Person.CompileDate, 23) AS DataTimeStr +-- ,'../CQMS/Comprehensive/InspectionPersonEdit.aspx?ToDo=ToDo&InspectionPersonId='+Person.InspectionPersonId AS PCUrl +--FROM Comprehensive_InspectionPerson AS Person +--LEFT JOIN Sys_User AS users ON users.UserId =@userId +--WHERE Person.ProjectId=@projectId and +--Person.Status!='3' AND Person.InspectionPersonId in (select InspectionPersonId from Comprehensive_InspectionPersonApprove approve where approve.ApproveType!='S' and approve.ApproveMan=@userId and approve.ApproveDate is null ) +--UNION ALL +--SELECT InspectionMachineId AS DataId +-- ,'aa55fad1-6c51-43f5-8c99-3c6aaae79118' AS MenuId +-- ,'߱ȷ' AS MenuName +-- ,Machine.InspectionMachineName AS Content +-- ,UserId +-- ,users.UserName +-- ,Machine.CompileDate AS DataTime +-- ,CONVERT(varchar(100),Machine.CompileDate, 23) AS DataTimeStr +-- ,'../CQMS/Comprehensive/InspectionMachineEdit.aspx?ToDo=ToDo&InspectionMachineId='+Machine.InspectionMachineId AS PCUrl +--FROM Comprehensive_InspectionMachine AS Machine +--LEFT JOIN Sys_User AS users ON users.UserId =@userId +--WHERE Machine.ProjectId=@projectId and +--Machine.Status!='3' AND Machine.InspectionMachineId in (select InspectionMachineId from Comprehensive_InspectionMachineApprove approve where approve.ApproveType!='S' and approve.ApproveMan=@userId and approve.ApproveDate is null ) +UNION ALL +SELECT ConstructSolutionId AS DataId + ,'91C4BFDB-0A51-4992-99CC-EB4EC185593D' AS MenuId + ,'ʩ' AS MenuName + ,Solution.SolutionName AS Content + ,UserId + ,users.UserName + ,Solution.CompileDate AS DataTime + ,CONVERT(varchar(100),Solution.CompileDate, 23) AS DataTimeStr + ,'../CQMS/Solution/EditConstructSolution.aspx?ToDo=ToDo&ConstructSolutionId='+Solution.ConstructSolutionId AS PCUrl +FROM Solution_CQMSConstructSolution AS Solution +LEFT JOIN Sys_User AS users ON users.UserId =@userId +WHERE Solution.ProjectId=@projectId and +Solution.State!='3' +AND Solution.ConstructSolutionId in +(select top 1 ConstructSolutionId from ( +SELECT Solution_CQMSConstructSolutionApprove.* +FROM Solution_CQMSConstructSolutionApprove, +(SELECT MIN([order]) AS [order],ConstructSolutionId FROM Solution_CQMSConstructSolutionApprove where ApproveType!='S' and ApproveDate is null GROUP BY ConstructSolutionId )b +WHERE Solution_CQMSConstructSolutionApprove.[order] = b.[order] and Solution_CQMSConstructSolutionApprove.ConstructSolutionId = b.ConstructSolutionId + ) approve +where approve.ApproveMan=@userId ) + +UNION ALL +SELECT InspectionId AS DataId + ,'4781f467-35bf-4cf2-aaa4-7960a175eb61' AS MenuId + ,'֪ͨ' AS MenuName + ,InspectionManagement.AcceptanceSite AS Content + ,UserId + ,users.UserName + ,InspectionManagement.CompileDate AS DataTime + ,CONVERT(varchar(100),InspectionManagement.CompileDate, 23) AS DataTimeStr + ,'../CQMS/ProcessControl/InspectionNoticeEdit.aspx?View=View&InspectionId='+InspectionManagement.InspectionId AS PCUrl +FROM ProcessControl_InspectionManagement AS InspectionManagement +LEFT JOIN Sys_User AS users ON users.UserId =@userId +WHERE InspectionManagement.ProjectId=@projectId and +dateadd(day,3,InspectionManagement.CompileDate)>getdate() and InspectionManagement.AcceptanceCheckMan like '%'+@userId+'%' +UNION ALL +SELECT CheckSpecialId AS DataId + ,'1B08048F-93ED-4E84-AE65-DB7917EA2DFB' AS MenuId + ,'ר' AS MenuName + ,CheckItemSet.CheckItemName AS Content + ,UserId + ,users.UserName + ,CheckSpecial.CheckTime AS DataTime + ,CONVERT(varchar(100),CheckSpecial.CheckTime, 23) AS DataTimeStr + ,'../HSSE/Check/CheckSpecialView.aspx?CheckSpecialId='+CheckSpecial.CheckSpecialId AS PCUrl +FROM Check_CheckSpecial AS CheckSpecial +LEFT JOIN Sys_User AS users ON users.UserId =@userId +LEFT JOIN Technique_CheckItemSet AS CheckItemSet ON CheckItemSet.CheckItemSetId =CheckSpecial.CheckItemSetId +WHERE CheckSpecial.ProjectId=@projectId and +dateadd(day,3,CheckSpecial.CheckTime)>getdate() and CheckSpecial.PartInPersonIds like '%'+@userId+'%' +UNION ALL +SELECT CheckColligationId AS DataId + ,'C198EBA8-9E23-4654-92E1-09C61105C522' AS MenuId + ,'ۺϼ' AS MenuName + ,case CheckType when '0' then 'ܼ' when '1' then '¼' else '' end AS Content + ,users.UserId + ,users.UserName + ,CheckColligation.CheckTime AS DataTime + ,CONVERT(varchar(100),CheckColligation.CheckTime, 23) AS DataTimeStr + ,'../HSSE/Check/CheckColligationEdit.aspx?CheckColligationId='+CheckColligation.CheckColligationId AS PCUrl +FROM Check_CheckColligation AS CheckColligation +LEFT JOIN Sys_User AS users ON users.UserId =@userId +LEFT JOIN Sys_FlowOperate AS FlowOperate ON CheckColligation.CheckColligationId=FlowOperate.DataId +LEFT JOIN Sys_User AS OperateUser ON FlowOperate.OperaterId=OperateUser.UserId +WHERE CheckColligation.ProjectId=@projectId and FlowOperate.IsClosed <> 1 and FlowOperate.OperaterId=@userId +UNION ALL +SELECT PatrolPlanId AS DataId + ,'D256E5C8-DC76-4F4D-BABE-A253418823F4' AS MenuId + ,'Ѳ' AS MenuName + ,HazardListItem.HazardItems AS Content + ,UserId + ,users.UserName + ,PatrolPlan.LimitCheckDate AS DataTime + ,CONVERT(varchar(100),PatrolPlan.LimitCheckDate, 23) AS DataTimeStr + ,'../HSSE/Hazard/RoutingInspectionEdit.aspx?PatrolPlanId='+PatrolPlan.PatrolPlanId AS PCUrl +FROM Hazard_PatrolPlan AS PatrolPlan +LEFT JOIN Sys_User AS users ON users.UserId =@userId +LEFT JOIN Hazard_HazardSelectedItem AS HazardListItem on HazardListItem.HazardSelectedItemId=PatrolPlan.HazardSelectedItemId +WHERE HazardListItem.ProjectId=@projectId and +dateadd(day,-3,PatrolPlan.LimitCheckDate)=22 and (select COUNT(*) from JDGL_QuantityCompletion WHERE ProjectId=@projectId and DATENAME(year,GETDATE())=DATENAME(year,EndDate) and DATENAME(MONTH,GETDATE())=DATENAME(MONTH,EndDate))=0) +--or (DATEADD(day,60,(select top 1 EndDate from JDGL_QuantityCompletion WHERE ProjectId=@projectId order by EndDate desc))=22 and +DATENAME(year,GETDATE())=DATENAME(year,MonthPlan.PlanDate) and DATENAME(MONTH,GETDATE())=DATENAME(MONTH,MonthPlan.PlanDate) + + +ORDER BY DataTime DESC +END + + + + + +GO + + diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosure.aspx b/SGGL/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosure.aspx index 396437fa..e4852e21 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosure.aspx +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosure.aspx @@ -15,8 +15,8 @@ @@ -97,7 +97,7 @@ <%-- <%-- diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/GeneralPlanApproval.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/GeneralPlanApproval.aspx.cs index 3ca54a87..2aeb43dd 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/GeneralPlanApproval.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/GeneralPlanApproval.aspx.cs @@ -269,7 +269,7 @@ namespace FineUIPro.Web.Comprehensive /// protected void btnImport_Click(object sender, EventArgs e) { - PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("GeneralPlanApprovalDataIn.aspx", "导入 - "))); + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("GeneralPlanApprovalDataInNew.aspx", "导入 - "))); } #endregion diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/GeneralPlanApprovalDataInNew.aspx b/SGGL/FineUIPro.Web/CQMS/Comprehensive/GeneralPlanApprovalDataInNew.aspx new file mode 100644 index 00000000..aabca536 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/GeneralPlanApprovalDataInNew.aspx @@ -0,0 +1,175 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GeneralPlanApprovalDataInNew.aspx.cs" Inherits="FineUIPro.Web.CQMS.Comprehensive.GeneralPlanApprovalDataInNew" %> + + + + + + + 导入施工组织设计及施工方案 + + + + + + +
+ + + + + + + + + + + <%----%> + + + + + + + + <%----%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/GeneralPlanApprovalDataInNew.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/GeneralPlanApprovalDataInNew.aspx.cs new file mode 100644 index 00000000..abc0a99d --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/GeneralPlanApprovalDataInNew.aspx.cs @@ -0,0 +1,535 @@ +using BLL; +using Model; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Linq; +using System.Threading; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CQMS.Comprehensive +{ + public partial class GeneralPlanApprovalDataInNew : PageBase + { + /// + /// 错误集合 + /// + public static string errorInfos = string.Empty; + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + if (percent == null) + { + percent = new Dictionary(); + } + this.id.Text = this.CurrUser.UserId; + this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + // 绑定表格 + this.BindGrid(); + } + else if (GetRequestEventArgument() == "reloadGrid") + { + BindGrid(); + } + } + #endregion + + #region 绑定数据 + /// + /// 绑定数据 + /// + private void BindGrid() + { + string strSql = @"SELECT TempId,ProjectId,UserId,Time,RowNo,ToopValue,Value1,Value2,Value3,Value4,Value5,Value6,Value7,Value8,Value9,Value10" + + @" ,Value11,Value12,Value13,Value14,Value15,Value16,Value17,Value18,Value19,Value20" + + @",ToopValue,Type" + + @" FROM Sys_CQMS_DataInTemp " + + @" WHERE ProjectId=@ProjectId AND UserId=@UserId AND Type=@Type"; + List listStr = new List(); + listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); + listStr.Add(new SqlParameter("@UserId", this.CurrUser.UserId)); + listStr.Add(new SqlParameter("@Type", "GeneralPlanApproval")); + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + Grid1.RecordCount = tb.Rows.Count; + var table = this.GetPagedDataTable(Grid1, tb); + Grid1.DataSource = table; + Grid1.DataBind(); + + var dataInTempAll = from x in Funs.DB.Sys_CQMS_DataInTemp + where x.ProjectId == this.CurrUser.LoginProjectId && x.UserId == this.CurrUser.UserId && x.Type == "GeneralPlanApproval" + select x; + for (int i = 0; i < Grid1.Rows.Count; i++) + { + var dataInTemp = dataInTempAll.FirstOrDefault(x => x.TempId == Grid1.Rows[i].DataKeys[0].ToString()); + if (dataInTemp != null) + { + if (!string.IsNullOrEmpty(dataInTemp.ToopValue)) + { + Grid1.Rows[i].RowCssClass = "red"; + } + } + } + var errData = from x in dataInTempAll where x.ToopValue != null select x; + this.lbDataCout.Text = errData.Count().ToString(); + } + #endregion + + #region 双击事件 + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); + return; + } + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("GeneralPlanApprovalDataInNewEdit.aspx?TempId={0}", Grid1.SelectedRowID, "维护 - "))); + } + #endregion + + #region 导入信息 维护 + /// + /// 导入信息编辑 + /// + /// + /// + protected void btnMenuEdit_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); + return; + } + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("GeneralPlanApprovalDataInNewEdit.aspx?TempId={0}", Grid1.SelectedRowID, "维护 - "))); + } + + /// + /// 删除按钮 + /// + /// + /// + protected void btnMenuDelete_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); + return; + } + + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + BLL.Sys_CQMS_DataInTempService.DeleteDataInTempByDataInTempID(rowID); + } + + ShowNotify("删除成功!", MessageBoxIcon.Success); + this.BindGrid(); + } + #endregion + + #region 分页 排序 + /// + /// 分页 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + BindGrid(); + } + + /// + /// 分页显示条数下拉框 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e) + { + BindGrid(); + } + #endregion + + #region 文件上传 + /// + /// 文件上传 + /// + /// + /// + protected void imgbtnImport_Click(object sender, EventArgs e) + { + try + { + if (this.FileExcel.HasFile == false) + { + ShowNotify("请选择Excel文件!", MessageBoxIcon.Warning); + return; + } + string IsXls = Path.GetExtension(this.FileExcel.FileName).ToString().Trim().ToLower(); + if (IsXls != ".xls" && IsXls != ".xlsx") + { + ShowNotify("只能选择Excel文件!", MessageBoxIcon.Warning); + return; + } + string rootPath = Server.MapPath("~/"); + string initFullPath = rootPath + Const.ExcelUrl; + if (!Directory.Exists(initFullPath)) + { + Directory.CreateDirectory(initFullPath); + } + //指定上传文件名称 + this.hdfileName.Text = BLL.Funs.GetNewFileName() + IsXls; + //上传文件路径 + string filePath = initFullPath + this.hdfileName.Text; + //文件上传服务器 + this.FileExcel.PostedFile.SaveAs(filePath); + //文件上传服务器后的名称 + string fileName = rootPath + Const.ExcelUrl + this.hdfileName.Text; + //读取Excel + DataSet ds = NPOIHelper.ExcelToDataSet(fileName, out errorInfos, true); + //验证Excel读取是否有误 + if (!string.IsNullOrEmpty(errorInfos)) + { + ShowNotify(errorInfos, MessageBoxIcon.Warning); + return; + } + + if (ds.Tables.Count > 0) + { + for (int i = 1; i < ds.Tables[0].Rows.Count; i++) + { + Sys_CQMS_DataInTemp newDataInTemp = new Sys_CQMS_DataInTemp(); + newDataInTemp.TempId = SQLHelper.GetNewID(typeof(Model.Sys_CQMS_DataInTemp)); + newDataInTemp.ProjectId = this.CurrUser.LoginProjectId; + newDataInTemp.UserId = this.CurrUser.UserId; + newDataInTemp.Time = System.DateTime.Now; + newDataInTemp.Type = "GeneralPlanApproval"; + newDataInTemp.RowNo = i + 2; + newDataInTemp.Value1 = ds.Tables[0].Rows[i][0].ToString(); + newDataInTemp.Value2 = ds.Tables[0].Rows[i][1].ToString(); + newDataInTemp.Value3 = ds.Tables[0].Rows[i][2].ToString(); + newDataInTemp.Value4 = ds.Tables[0].Rows[i][3].ToString(); + newDataInTemp.Value5 = ds.Tables[0].Rows[i][4].ToString(); + newDataInTemp.Value6 = ds.Tables[0].Rows[i][5].ToString(); + newDataInTemp.Value7 = ds.Tables[0].Rows[i][6].ToString(); + newDataInTemp.Value8 = ds.Tables[0].Rows[i][7].ToString(); + newDataInTemp.Value9 = ds.Tables[0].Rows[i][8].ToString(); + newDataInTemp.Value10 = ds.Tables[0].Rows[i][9].ToString(); + + BLL.Sys_CQMS_DataInTempService.AddDataInTemp(newDataInTemp); + } + this.BindGrid(); + ShowNotify("数据已导入临时表!", MessageBoxIcon.Success); + } + else + { + Alert.ShowInTop("导入数据为空!", MessageBoxIcon.Success); + return; + } + } + catch (Exception ex) + { + Alert.ShowInTop("'" + ex.Message + "'", MessageBoxIcon.Warning); + } + } + #endregion + + #region 导出按钮 + /// 导出按钮 + /// + /// + /// + protected void btnOut_Click(object sender, EventArgs e) + { + Response.ClearContent(); + string filename = Funs.GetNewFileName(); + Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("施工组织设计及施工方案" + filename, System.Text.Encoding.UTF8) + ".xls"); + Response.ContentType = "application/excel"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + Response.Write(GetGridTableHtml(Grid1)); + Response.End(); + } + #endregion + + #region 保存审核事件 + /// + /// 保存审核事件 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + Thread t = new Thread(new ThreadStart(() => { btnSaveMethod(this.CurrUser.LoginProjectId, this.CurrUser.UserId, "GeneralPlanApproval"); })); + t.Start(); + if (percent.ContainsKey(this.CurrUser.UserId)) + { + percent[CurrUser.UserId] = 0; + } + else + { + percent.Add(CurrUser.UserId, 0); + + } + PageContext.RegisterStartupScript("printX()"); + } + protected void btnRefresh_Click(object sender, EventArgs e) + { + this.BindGrid(); + } + + protected void btnSaveMethod(string LoginProjectId, string UserId, string IsPDMS) + { + var oldViewInfos = from x in Funs.DB.Comprehensive_GeneralPlanApproval + where x.ProjectId == this.CurrUser.LoginProjectId + select x; + + var units = from x in Funs.DB.Base_Unit + join y in Funs.DB.Project_ProjectUnit on x.UnitId equals y.UnitId + where y.ProjectId == this.CurrUser.LoginProjectId + select x; + + var cns = from x in Funs.DB.Base_CNProfessional select x; + + var unitWorks = from x in Funs.DB.WBS_UnitWork + where x.ProjectId == this.CurrUser.LoginProjectId + && (x.SuperUnitWork == null || x.SuperUnitWork == "0") + select x; + + var dataInTemp = from x in Funs.DB.Sys_CQMS_DataInTemp + where x.ProjectId == LoginProjectId && x.UserId == UserId && x.Type == "GeneralPlanApproval" + select x; + int okCount = 0; + int i = 0; + int ir = dataInTemp.Count(); + string erreMessage = ""; + foreach (var tempData in dataInTemp) + { + if (tempData != null) + { + i++; + percent[UserId] = (int)(100 * i / ir); + string errInfo = string.Empty; + + Model.Comprehensive_GeneralPlanApproval Ins = new Model.Comprehensive_GeneralPlanApproval(); + if (!string.IsNullOrEmpty(tempData.Value1.Trim())) + { + var unit = units.FirstOrDefault(x => x.UnitName == tempData.Value1.Trim()); + if (unit == null) + { + errInfo += "报批单位[" + tempData.Value1.Trim() + "]不存在;"; + } + else + { + Ins.UnitId = unit.UnitId; + } + } + else + { + errInfo += "报验单位为必填项;"; + } + if (!string.IsNullOrEmpty(tempData.Value2.Trim())) + { + var cn = cns.Where(x => x.ProfessionalName == tempData.Value2.Trim()).FirstOrDefault(); + if (cn == null) + { + errInfo += "专业[" + tempData.Value2.Trim() + "]不存在;"; + } + else + { + Ins.CNProfessionalId = cn.CNProfessionalId; + } + } + else + { + errInfo += "专业为必填项;"; + } + if (!string.IsNullOrEmpty(tempData.Value3.Trim())) + { + string unitIds = string.Empty; + string[] reunit = tempData.Value3.Trim().Split(','); + foreach (string unitWork in reunit) + { + var u = unitWorks.Where(x => x.UnitWorkName == unitWork.Trim()).FirstOrDefault(); + if (u == null) + { + errInfo += "单位工程名称[" + unitWork.Trim() + "]不存在;"; + } + else + { + var q = BLL.UnitWorkService.GetUnitWorkByUnitWorkName(this.CurrUser.LoginProjectId, unitWork.Trim()).UnitWorkId; + unitIds += q + ","; + } + } + if (!string.IsNullOrEmpty(unitIds)) + { + unitIds = unitIds.Substring(0, unitIds.LastIndexOf(",")); + } + Ins.UnitWorkId = unitIds; + } + if (!string.IsNullOrEmpty(tempData.Value4.Trim())) + { + Ins.PlanCode = tempData.Value4.Trim(); + } + else + { + errInfo += "编号为必填项;"; + } + if (!string.IsNullOrEmpty(tempData.Value5.Trim())) + { + Ins.PlanName = tempData.Value5.Trim(); + } + if (!string.IsNullOrEmpty(tempData.Value6.Trim())) + { + try + { + Ins.ApprovalDate = Funs.GetNewDateTime(tempData.Value6.Trim()); + if (Ins.ApprovalDate==null) + { + errInfo += "审批日期 [" + tempData.Value6.Trim() + "]错误;"; + } + } + catch (Exception) + { + errInfo += "审批日期 [" + tempData.Value6.Trim() + "]错误;"; + } + } + if (!string.IsNullOrEmpty(tempData.Value7.Trim())) + { + Ins.AuditMan = tempData.Value7.Trim(); + } + if (!string.IsNullOrEmpty(tempData.Value8.Trim())) + { + Ins.ApprovalMan =tempData.Value8.Trim(); + } + if (!string.IsNullOrEmpty(tempData.Value9.Trim())) + { + Ins.ImplementationDeviation = tempData.Value9.Trim(); + } + if (!string.IsNullOrEmpty(tempData.Value10.Trim())) + { + try + { + Ins.RemarkCode = Convert.ToInt32(tempData.Value10.Trim()); + if (Ins.RemarkCode == null) + { + errInfo += "标志编号[" + tempData.Value10.Trim() + "]格式错误;"; + } + } + catch (Exception) + { + errInfo += "标志编号[" + tempData.Value10.Trim() + "]格式错误;"; + } + } + else + { + errInfo += "标志编号为必填项;"; + } + Ins.CompileMan = this.CurrUser.UserId; + Ins.CompileDate = DateTime.Now.Date; + if (string.IsNullOrEmpty(errInfo)) ////所有信息正确的话 插入数据 + { + Ins.ProjectId = LoginProjectId; + var isExitISOValue = oldViewInfos.FirstOrDefault(x => x.RemarkCode == Funs.GetNewIntOrZero(tempData.Value10)); + if (isExitISOValue != null) ///已存在 + { + Ins.GeneralPlanApprovalId = isExitISOValue.GeneralPlanApprovalId; + BLL.GeneralPlanApprovalService.UpdateGeneralPlanApproval(Ins); + } + else + { + Ins.GeneralPlanApprovalId = SQLHelper.GetNewID(typeof(Model.Comprehensive_InspectionMachine)); + BLL.GeneralPlanApprovalService.AddGeneralPlanApproval(Ins); + } + BLL.Sys_CQMS_DataInTempService.DeleteDataInTempByDataInTempID(tempData.TempId); + okCount++; + } + + if (!string.IsNullOrEmpty(errInfo)) + { + tempData.ToopValue = errInfo; + BLL.Sys_CQMS_DataInTempService.UpdateDataInTemp(tempData); + erreMessage += errInfo + ";"; + + } + } + } + } + #endregion + + #region 删除所有数据事件 + /// + /// 删除所有数据事件 + /// + /// + /// + protected void btnAllDelete_Click(object sender, EventArgs e) + { + //先删除临时表中 该人员以前导入的数据 + BLL.Sys_CQMS_DataInTempService.DeleteDataInTempByProjectIdUserId(this.CurrUser.LoginProjectId, this.CurrUser.UserId, "GeneralPlanApproval"); + this.BindGrid(); + ShowNotify("删除成功!", MessageBoxIcon.Success); + this.lbDataCout.Text = string.Empty; + } + #endregion + + #region 模版导入说明 下载 + /// + /// 下载模版 + /// + /// + /// + protected void imgbtnUpload_Click(object sender, EventArgs e) + { + string rootPath = Server.MapPath("~/"); + string uploadfilepath = rootPath + Const.GeneralPlanApprovalTemplateUrl; + string filePath = Const.GeneralPlanApprovalTemplateUrl; + string fileName = Path.GetFileName(filePath); + FileInfo info = new FileInfo(uploadfilepath); + long fileSize = info.Length; + Response.ClearContent(); + Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + Response.ContentType = "excel/plain"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + Response.AddHeader("Content-Length", fileSize.ToString().Trim()); + Response.TransmitFile(uploadfilepath, 0, fileSize); + Response.End(); + } + #endregion + + public static Dictionary percent { get; set; } + public static Dictionary url { get; set; } + + [System.Web.Services.WebMethod] + public static int getPercent(string id) + { + return percent[id]; + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/GeneralPlanApprovalDataInNew.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/GeneralPlanApprovalDataInNew.aspx.designer.cs new file mode 100644 index 00000000..ff7faab7 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/GeneralPlanApprovalDataInNew.aspx.designer.cs @@ -0,0 +1,251 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Comprehensive +{ + + + public partial class GeneralPlanApprovalDataInNew + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// id 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField id; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// hdfileName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdfileName; + + /// + /// FileExcel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FileUpload FileExcel; + + /// + /// imgbtnImport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button imgbtnImport; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnRefresh 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnRefresh; + + /// + /// btnAllDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAllDelete; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// imgbtnUpload 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button imgbtnUpload; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// lbDataCout 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbDataCout; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Window2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window2; + + /// + /// ContentPanel3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ContentPanel ContentPanel3; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuEdit; + + /// + /// btnMenuDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDelete; + + /// + /// ScriptManager2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.ScriptManager ScriptManager2; + } +} diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/GeneralPlanApprovalDataInNewEdit.aspx b/SGGL/FineUIPro.Web/CQMS/Comprehensive/GeneralPlanApprovalDataInNewEdit.aspx new file mode 100644 index 00000000..6bb2c9e6 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/GeneralPlanApprovalDataInNewEdit.aspx @@ -0,0 +1,69 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GeneralPlanApprovalDataInNewEdit.aspx.cs" Inherits="FineUIPro.Web.CQMS.Comprehensive.GeneralPlanApprovalDataInNewEdit" %> + + + + + + + 编辑施工组织设计及施工方案导入内容 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/GeneralPlanApprovalDataInNewEdit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/GeneralPlanApprovalDataInNewEdit.aspx.cs new file mode 100644 index 00000000..32344044 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/GeneralPlanApprovalDataInNewEdit.aspx.cs @@ -0,0 +1,221 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CQMS.Comprehensive +{ + public partial class GeneralPlanApprovalDataInNewEdit : PageBase + { + #region 定义项 + /// + /// 临时表主键 + /// + public string TempId + { + get + { + return (string)ViewState["TempId"]; + } + set + { + ViewState["TempId"] = value; + } + } + #endregion + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.TempId = Request.Params["TempId"]; + this.txtValue1.Focus(); + var dataInTemp = BLL.Sys_CQMS_DataInTempService.GetDataInTempByTempId(this.TempId); + if (dataInTemp != null) + { + this.txtValue1.Text = dataInTemp.Value1; + this.txtValue2.Text = dataInTemp.Value2; + this.txtValue3.Text = dataInTemp.Value3; + this.txtValue4.Text = dataInTemp.Value4; + this.txtValue5.Text = dataInTemp.Value5; + this.txtValue6.Text = dataInTemp.Value6; + this.txtValue7.Text = dataInTemp.Value7; + this.txtValue8.Text = dataInTemp.Value8; + this.txtValue9.Text = dataInTemp.Value9; + this.txtValue10.Text = dataInTemp.Value10; + + this.lbErrCout.Text = dataInTemp.ToopValue; + } + } + } + #endregion + + #region 保存按钮 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + var dataInTemp = BLL.Sys_CQMS_DataInTempService.GetDataInTempByTempId(this.TempId); + if (this.ckAll.Checked) + { + var allDataInTemp = from x in Funs.DB.Sys_CQMS_DataInTemp where x.ProjectId == this.CurrUser.LoginProjectId && x.UserId == this.CurrUser.UserId && x.Type == "GeneralPlanApproval" select x; + if (dataInTemp.Value1 != this.txtValue1.Text.Trim()) + { + var tempValue1 = allDataInTemp.Where(x => x.Value1 == dataInTemp.Value1 || (x.Value1 == null && dataInTemp.Value1 == null)); + if (tempValue1 != null) + { + foreach (var item in tempValue1) + { + item.Value1 = this.txtValue1.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value2 != this.txtValue2.Text.Trim()) + { + var tempValue2 = allDataInTemp.Where(x => x.Value2 == dataInTemp.Value2 || (x.Value2 == null && dataInTemp.Value2 == null)); + if (tempValue2 != null) + { + foreach (var item in tempValue2) + { + item.Value2 = this.txtValue2.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value3 != this.txtValue3.Text.Trim()) + { + var tempValue3 = allDataInTemp.Where(x => x.Value3 == dataInTemp.Value3 || (x.Value3 == null && dataInTemp.Value3 == null)); + if (tempValue3 != null) + { + foreach (var item in tempValue3) + { + item.Value3 = this.txtValue3.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value5 != this.txtValue5.Text.Trim()) + { + var tempValue5 = allDataInTemp.Where(x => x.Value5 == dataInTemp.Value5 || (x.Value5 == null && dataInTemp.Value5 == null)); + if (tempValue5 != null) + { + foreach (var item in tempValue5) + { + item.Value5 = this.txtValue5.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value6 != this.txtValue6.Text.Trim()) + { + var tempValue6 = allDataInTemp.Where(x => x.Value6 == dataInTemp.Value6 || (x.Value6 == null && dataInTemp.Value6 == null)); + if (tempValue6 != null) + { + foreach (var item in tempValue6) + { + item.Value6 = this.txtValue6.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value7 != this.txtValue7.Text.Trim()) + { + var tempValue7 = allDataInTemp.Where(x => x.Value7 == dataInTemp.Value7 || (x.Value7 == null && dataInTemp.Value7 == null)); + if (tempValue7 != null) + { + foreach (var item in tempValue7) + { + item.Value7 = this.txtValue7.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value8 != this.txtValue8.Text.Trim()) + { + var tempValue8 = allDataInTemp.Where(x => x.Value8 == dataInTemp.Value8 || (x.Value8 == null && dataInTemp.Value8 == null)); + if (tempValue8 != null) + { + foreach (var item in tempValue8) + { + item.Value8 = this.txtValue8.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value9 != this.txtValue9.Text.Trim()) + { + var tempValue9 = allDataInTemp.Where(x => x.Value9 == dataInTemp.Value9 || (x.Value9 == null && dataInTemp.Value9 == null)); + if (tempValue9 != null) + { + foreach (var item in tempValue9) + { + item.Value9 = this.txtValue9.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value10 != this.txtValue10.Text.Trim()) + { + var tempValue10 = allDataInTemp.Where(x => x.Value10 == dataInTemp.Value10 || (x.Value10 == null && dataInTemp.Value10 == null)); + if (tempValue10 != null) + { + foreach (var item in tempValue10) + { + item.Value10 = this.txtValue10.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + var toopValue = allDataInTemp.Where(x => x.ToopValue == dataInTemp.ToopValue); + if (toopValue != null) + { + foreach (var item in toopValue) + { + item.ToopValue = null; + Funs.DB.SubmitChanges(); + } + } + } + else + { + Model.Sys_CQMS_DataInTemp newDataInTemp = new Model.Sys_CQMS_DataInTemp(); + newDataInTemp.ProjectId = this.CurrUser.LoginProjectId; + newDataInTemp.UserId = this.CurrUser.UserId; + newDataInTemp.Time = System.DateTime.Now; + newDataInTemp.Type = "GeneralPlanApproval"; + newDataInTemp.Value1 = this.txtValue1.Text.Trim(); + newDataInTemp.Value2 = this.txtValue2.Text.Trim(); + newDataInTemp.Value3 = this.txtValue3.Text.Trim(); + newDataInTemp.Value4 = this.txtValue4.Text.Trim(); + newDataInTemp.Value5 = this.txtValue5.Text.Trim(); + newDataInTemp.Value6 = this.txtValue6.Text.Trim(); + newDataInTemp.Value7 = this.txtValue7.Text.Trim(); + newDataInTemp.Value8 = this.txtValue8.Text.Trim(); + newDataInTemp.Value9 = this.txtValue9.Text.Trim(); + newDataInTemp.Value10 = this.txtValue10.Text.Trim(); + if (!string.IsNullOrEmpty(this.TempId)) + { + newDataInTemp.TempId = this.TempId; + newDataInTemp.ToopValue = null; + BLL.Sys_CQMS_DataInTempService.UpdateDataInTemp(newDataInTemp); + } + } + ShowNotify("信息修改完成!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/GeneralPlanApprovalDataInNewEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/GeneralPlanApprovalDataInNewEdit.aspx.designer.cs new file mode 100644 index 00000000..7b0700c1 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/GeneralPlanApprovalDataInNewEdit.aspx.designer.cs @@ -0,0 +1,179 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Comprehensive +{ + + + public partial class GeneralPlanApprovalDataInNewEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// txtValue1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue1; + + /// + /// txtValue2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue2; + + /// + /// txtValue3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue3; + + /// + /// txtValue4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue4; + + /// + /// txtValue5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue5; + + /// + /// txtValue6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue6; + + /// + /// txtValue7 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue7; + + /// + /// txtValue8 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue8; + + /// + /// txtValue9 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue9; + + /// + /// txtValue10 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue10; + + /// + /// ckAll 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.CheckBox ckAll; + + /// + /// lbErrCout 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea lbErrCout; + } +} diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionEquipmentDataInNewEdit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionEquipmentDataInNewEdit.aspx.cs index 4f7a8c0c..45980e52 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionEquipmentDataInNewEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionEquipmentDataInNewEdit.aspx.cs @@ -244,7 +244,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive else { Model.Sys_CQMS_DataInTemp newDataInTemp = new Model.Sys_CQMS_DataInTemp(); - newDataInTemp.ProjectId = this.CurrUser.ProjectId; + newDataInTemp.ProjectId = this.CurrUser.LoginProjectId; newDataInTemp.UserId = this.CurrUser.UserId; newDataInTemp.Time = System.DateTime.Now; newDataInTemp.Type = "InspectionEquipment"; diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionMachineDataInNewEdit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionMachineDataInNewEdit.aspx.cs index e10c4c5f..139eec67 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionMachineDataInNewEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionMachineDataInNewEdit.aspx.cs @@ -257,7 +257,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive else { Model.Sys_CQMS_DataInTemp newDataInTemp = new Model.Sys_CQMS_DataInTemp(); - newDataInTemp.ProjectId = this.CurrUser.ProjectId; + newDataInTemp.ProjectId = this.CurrUser.LoginProjectId; newDataInTemp.UserId = this.CurrUser.UserId; newDataInTemp.Time = System.DateTime.Now; newDataInTemp.Type = "InspectionMachine"; diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPersonDataInNewEdit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPersonDataInNewEdit.aspx.cs index 1475807e..1aef4cd8 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPersonDataInNewEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPersonDataInNewEdit.aspx.cs @@ -257,7 +257,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive else { Model.Sys_CQMS_DataInTemp newDataInTemp = new Model.Sys_CQMS_DataInTemp(); - newDataInTemp.ProjectId = this.CurrUser.ProjectId; + newDataInTemp.ProjectId = this.CurrUser.LoginProjectId; newDataInTemp.UserId = this.CurrUser.UserId; newDataInTemp.Time = System.DateTime.Now; newDataInTemp.Type = "InspectionPerson"; diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionTestPlan.aspx b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionTestPlan.aspx index 73e5dcf8..b08132fe 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionTestPlan.aspx +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionTestPlan.aspx @@ -16,8 +16,8 @@ @@ -105,7 +105,7 @@ diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionTestPlan.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionTestPlan.aspx.cs index 0cfc98df..e74faf92 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionTestPlan.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionTestPlan.aspx.cs @@ -235,7 +235,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive /// protected void btnImport_Click(object sender, EventArgs e) { - PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("InspectionTestPlanDataIn.aspx", "导入 - "))); + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("InspectionTestPlanDataInNew.aspx", "导入 - "))); } #endregion diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionTestPlanDataInNew.aspx b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionTestPlanDataInNew.aspx new file mode 100644 index 00000000..02932f3b --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionTestPlanDataInNew.aspx @@ -0,0 +1,167 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InspectionTestPlanDataInNew.aspx.cs" Inherits="FineUIPro.Web.CQMS.Comprehensive.InspectionTestPlanDataInNew" %> + + + + + + + + + + + +
+ + + + + + + + + + + <%----%> + + + + + + + + <%----%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionTestPlanDataInNew.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionTestPlanDataInNew.aspx.cs new file mode 100644 index 00000000..995624c2 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionTestPlanDataInNew.aspx.cs @@ -0,0 +1,501 @@ +using BLL; +using Model; +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Data; +using System.IO; +using System.Linq; +using System.Threading; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CQMS.Comprehensive +{ + public partial class InspectionTestPlanDataInNew : PageBase + { + /// + /// 错误集合 + /// + public static string errorInfos = string.Empty; + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + if (percent == null) + { + percent = new Dictionary(); + } + this.id.Text = this.CurrUser.UserId; + this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + // 绑定表格 + this.BindGrid(); + } + else if (GetRequestEventArgument() == "reloadGrid") + { + BindGrid(); + } + } + #endregion + + #region 绑定数据 + /// + /// 绑定数据 + /// + private void BindGrid() + { + string strSql = @"SELECT TempId,ProjectId,UserId,Time,RowNo,ToopValue,Value1,Value2,Value3,Value4,Value5,Value6,Value7,Value8,Value9,Value10" + + @" ,Value11,Value12,Value13,Value14,Value15,Value16,Value17,Value18,Value19,Value20" + + @",ToopValue,Type" + + @" FROM Sys_CQMS_DataInTemp " + + @" WHERE ProjectId=@ProjectId AND UserId=@UserId AND Type=@Type"; + List listStr = new List(); + listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); + listStr.Add(new SqlParameter("@UserId", this.CurrUser.UserId)); + listStr.Add(new SqlParameter("@Type", "InspectionTestPlan")); + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + Grid1.RecordCount = tb.Rows.Count; + var table = this.GetPagedDataTable(Grid1, tb); + Grid1.DataSource = table; + Grid1.DataBind(); + + var dataInTempAll = from x in Funs.DB.Sys_CQMS_DataInTemp + where x.ProjectId == this.CurrUser.LoginProjectId && x.UserId == this.CurrUser.UserId && x.Type == "InspectionTestPlan" + select x; + for (int i = 0; i < Grid1.Rows.Count; i++) + { + var dataInTemp = dataInTempAll.FirstOrDefault(x => x.TempId == Grid1.Rows[i].DataKeys[0].ToString()); + if (dataInTemp != null) + { + if (!string.IsNullOrEmpty(dataInTemp.ToopValue)) + { + Grid1.Rows[i].RowCssClass = "red"; + } + } + } + var errData = from x in dataInTempAll where x.ToopValue != null select x; + this.lbDataCout.Text = errData.Count().ToString(); + } + #endregion + + #region 双击事件 + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); + return; + } + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("InspectionTestPlanDataInNewEdit.aspx?TempId={0}", Grid1.SelectedRowID, "维护 - "))); + } + #endregion + + #region 导入信息 维护 + /// + /// 导入信息编辑 + /// + /// + /// + protected void btnMenuEdit_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); + return; + } + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("InspectionTestPlanDataInNewEdit.aspx?TempId={0}", Grid1.SelectedRowID, "维护 - "))); + } + + /// + /// 删除按钮 + /// + /// + /// + protected void btnMenuDelete_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); + return; + } + + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + BLL.Sys_CQMS_DataInTempService.DeleteDataInTempByDataInTempID(rowID); + } + + ShowNotify("删除成功!", MessageBoxIcon.Success); + this.BindGrid(); + } + #endregion + + #region 分页 排序 + /// + /// 分页 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + BindGrid(); + } + + /// + /// 分页显示条数下拉框 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e) + { + BindGrid(); + } + #endregion + + #region 文件上传 + /// + /// 文件上传 + /// + /// + /// + protected void imgbtnImport_Click(object sender, EventArgs e) + { + try + { + if (this.FileExcel.HasFile == false) + { + ShowNotify("请选择Excel文件!", MessageBoxIcon.Warning); + return; + } + string IsXls = Path.GetExtension(this.FileExcel.FileName).ToString().Trim().ToLower(); + if (IsXls != ".xls" && IsXls != ".xlsx") + { + ShowNotify("只能选择Excel文件!", MessageBoxIcon.Warning); + return; + } + string rootPath = Server.MapPath("~/"); + string initFullPath = rootPath + Const.ExcelUrl; + if (!Directory.Exists(initFullPath)) + { + Directory.CreateDirectory(initFullPath); + } + //指定上传文件名称 + this.hdfileName.Text = BLL.Funs.GetNewFileName() + IsXls; + //上传文件路径 + string filePath = initFullPath + this.hdfileName.Text; + //文件上传服务器 + this.FileExcel.PostedFile.SaveAs(filePath); + //文件上传服务器后的名称 + string fileName = rootPath + Const.ExcelUrl + this.hdfileName.Text; + //读取Excel + DataSet ds = NPOIHelper.ExcelToDataSet(fileName, out errorInfos, true); + //验证Excel读取是否有误 + if (!string.IsNullOrEmpty(errorInfos)) + { + ShowNotify(errorInfos, MessageBoxIcon.Warning); + return; + } + + if (ds.Tables.Count > 0) + { + for (int i = 1; i < ds.Tables[0].Rows.Count; i++) + { + Sys_CQMS_DataInTemp newDataInTemp = new Sys_CQMS_DataInTemp(); + newDataInTemp.TempId = SQLHelper.GetNewID(typeof(Model.Sys_CQMS_DataInTemp)); + newDataInTemp.ProjectId = this.CurrUser.LoginProjectId; + newDataInTemp.UserId = this.CurrUser.UserId; + newDataInTemp.Time = System.DateTime.Now; + newDataInTemp.Type = "InspectionTestPlan"; + newDataInTemp.RowNo = i + 2; + newDataInTemp.Value1 = ds.Tables[0].Rows[i][0].ToString(); + newDataInTemp.Value2 = ds.Tables[0].Rows[i][1].ToString(); + newDataInTemp.Value3 = ds.Tables[0].Rows[i][2].ToString(); + newDataInTemp.Value4 = ds.Tables[0].Rows[i][3].ToString(); + newDataInTemp.Value5 = ds.Tables[0].Rows[i][4].ToString(); + newDataInTemp.Value6 = ds.Tables[0].Rows[i][5].ToString(); + newDataInTemp.Value7 = ds.Tables[0].Rows[i][6].ToString(); + newDataInTemp.Value8 = ds.Tables[0].Rows[i][7].ToString(); + + BLL.Sys_CQMS_DataInTempService.AddDataInTemp(newDataInTemp); + } + this.BindGrid(); + ShowNotify("数据已导入临时表!", MessageBoxIcon.Success); + } + else + { + Alert.ShowInTop("导入数据为空!", MessageBoxIcon.Success); + return; + } + } + catch (Exception ex) + { + Alert.ShowInTop("'" + ex.Message + "'", MessageBoxIcon.Warning); + } + } + #endregion + + #region 导出按钮 + /// 导出按钮 + /// + /// + /// + protected void btnOut_Click(object sender, EventArgs e) + { + Response.ClearContent(); + string filename = Funs.GetNewFileName(); + Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("检验试验计划" + filename, System.Text.Encoding.UTF8) + ".xls"); + Response.ContentType = "application/excel"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + Response.Write(GetGridTableHtml(Grid1)); + Response.End(); + } + #endregion + + #region 保存审核事件 + /// + /// 保存审核事件 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + Thread t = new Thread(new ThreadStart(() => { btnSaveMethod(this.CurrUser.LoginProjectId, this.CurrUser.UserId, "InspectionTestPlan"); })); + t.Start(); + if (percent.ContainsKey(this.CurrUser.UserId)) + { + percent[CurrUser.UserId] = 0; + } + else + { + percent.Add(CurrUser.UserId, 0); + + } + PageContext.RegisterStartupScript("printX()"); + } + protected void btnRefresh_Click(object sender, EventArgs e) + { + this.BindGrid(); + } + + protected void btnSaveMethod(string LoginProjectId, string UserId, string IsPDMS) + { + var oldViewInfos = from x in Funs.DB.Inspection_Test_Plan + where x.ProjectId == this.CurrUser.LoginProjectId + select x; + + var units = from x in Funs.DB.Base_Unit + join y in Funs.DB.Project_ProjectUnit on x.UnitId equals y.UnitId + where y.ProjectId == this.CurrUser.LoginProjectId + select x; + + var cns = from x in Funs.DB.Base_CNProfessional select x; + + var dataInTemp = from x in Funs.DB.Sys_CQMS_DataInTemp + where x.ProjectId == LoginProjectId && x.UserId == UserId && x.Type == "InspectionTestPlan" + select x; + int okCount = 0; + int i = 0; + int ir = dataInTemp.Count(); + string erreMessage = ""; + foreach (var tempData in dataInTemp) + { + if (tempData != null) + { + i++; + percent[UserId] = (int)(100 * i / ir); + string errInfo = string.Empty; + + Model.Inspection_Test_Plan Ins = new Model.Inspection_Test_Plan(); + if (!string.IsNullOrEmpty(tempData.Value1.Trim())) + { + var unit = units.FirstOrDefault(x => x.UnitName == tempData.Value1.Trim()); + if (unit == null) + { + errInfo += "报批单位[" + tempData.Value1.Trim() + "]不存在;"; + } + else + { + Ins.UnitId = unit.UnitId; + } + } + else + { + errInfo += "报验单位为必填项;"; + } + if (!string.IsNullOrEmpty(tempData.Value2.Trim())) + { + var cn = cns.Where(x => x.ProfessionalName == tempData.Value2.Trim()).FirstOrDefault(); + if (cn == null) + { + errInfo += "专业[" + tempData.Value2.Trim() + "]不存在;"; + } + else + { + Ins.CNProfessionalId = cn.CNProfessionalId; + } + } + else + { + errInfo += "专业为必填项;"; + } + if (!string.IsNullOrEmpty(tempData.Value3.Trim())) + { + Ins.PlanCode = tempData.Value3.Trim(); + } + else + { + errInfo += "编号为必填项;"; + } + if (!string.IsNullOrEmpty(tempData.Value4.Trim())) + { + Ins.PlanCode = tempData.Value4.Trim(); + } + if (!string.IsNullOrEmpty(tempData.Value5.Trim())) + { + try + { + Ins.ApprovalDate = Funs.GetNewDateTime(tempData.Value5.Trim()); + if (Ins.ApprovalDate == null) + { + errInfo += "审批日期[" + tempData.Value5.Trim() + "]错误;"; + } + } + catch (Exception) + { + errInfo += "审批日期[" + tempData.Value5.Trim() + "]错误;"; + } + } + if (!string.IsNullOrEmpty(tempData.Value6.Trim())) + { + Ins.AuditMan = tempData.Value6.Trim(); + } + if (!string.IsNullOrEmpty(tempData.Value7.Trim())) + { + Ins.ApprovalMan = tempData.Value7.Trim(); + } + if (!string.IsNullOrEmpty(tempData.Value8.Trim())) + { + try + { + Ins.RemarkCode = Convert.ToInt32(tempData.Value8.Trim()); + if (Ins.RemarkCode == null) + { + errInfo += "标志编号[" + tempData.Value8.Trim() + "]格式错误;"; + } + } + catch (Exception) + { + errInfo += "标志编号[" + tempData.Value8.Trim() + "]格式错误;"; + } + } + else + { + errInfo += "标志编号为必填项;"; + } + if (string.IsNullOrEmpty(errInfo)) ////所有信息正确的话 插入数据 + { + Ins.CreateMan = this.CurrUser.UserId; + Ins.CreateDate = DateTime.Now; + Ins.ProjectId = LoginProjectId; + var isExitISOValue = oldViewInfos.FirstOrDefault(x => x.RemarkCode == Funs.GetNewIntOrZero(tempData.Value8)); + if (isExitISOValue != null) ///已存在 + { + Ins.Id = isExitISOValue.Id; + BLL.InspectionTestPlanService.Update(Ins); + } + else + { + Ins.Id = SQLHelper.GetNewID(typeof(Model.Inspection_Test_Plan)); + BLL.InspectionTestPlanService.Insert(Ins); + } + BLL.Sys_CQMS_DataInTempService.DeleteDataInTempByDataInTempID(tempData.TempId); + okCount++; + } + + if (!string.IsNullOrEmpty(errInfo)) + { + tempData.ToopValue = errInfo; + BLL.Sys_CQMS_DataInTempService.UpdateDataInTemp(tempData); + erreMessage += errInfo + ";"; + + } + } + } + } + #endregion + + #region 删除所有数据事件 + /// + /// 删除所有数据事件 + /// + /// + /// + protected void btnAllDelete_Click(object sender, EventArgs e) + { + //先删除临时表中 该人员以前导入的数据 + BLL.Sys_CQMS_DataInTempService.DeleteDataInTempByProjectIdUserId(this.CurrUser.LoginProjectId, this.CurrUser.UserId, "InspectionTestPlan"); + this.BindGrid(); + ShowNotify("删除成功!", MessageBoxIcon.Success); + this.lbDataCout.Text = string.Empty; + } + #endregion + + #region 模版导入说明 下载 + /// + /// 下载模版 + /// + /// + /// + protected void imgbtnUpload_Click(object sender, EventArgs e) + { + string rootPath = Server.MapPath("~/"); + string uploadfilepath = rootPath + Const.InspectionTestPlanTemplateUrl; + string filePath = Const.InspectionTestPlanTemplateUrl; + string fileName = Path.GetFileName(filePath); + FileInfo info = new FileInfo(uploadfilepath); + long fileSize = info.Length; + Response.ClearContent(); + Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + Response.ContentType = "excel/plain"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + Response.AddHeader("Content-Length", fileSize.ToString().Trim()); + Response.TransmitFile(uploadfilepath, 0, fileSize); + Response.End(); + } + #endregion + + public static Dictionary percent { get; set; } + public static Dictionary url { get; set; } + + [System.Web.Services.WebMethod] + public static int getPercent(string id) + { + return percent[id]; + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionTestPlanDataInNew.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionTestPlanDataInNew.aspx.designer.cs new file mode 100644 index 00000000..8ce9866c --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionTestPlanDataInNew.aspx.designer.cs @@ -0,0 +1,251 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Comprehensive +{ + + + public partial class InspectionTestPlanDataInNew + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// id 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField id; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// hdfileName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdfileName; + + /// + /// FileExcel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FileUpload FileExcel; + + /// + /// imgbtnImport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button imgbtnImport; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnRefresh 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnRefresh; + + /// + /// btnAllDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAllDelete; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// imgbtnUpload 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button imgbtnUpload; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// lbDataCout 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbDataCout; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Window2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window2; + + /// + /// ContentPanel3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ContentPanel ContentPanel3; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuEdit; + + /// + /// btnMenuDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDelete; + + /// + /// ScriptManager2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.ScriptManager ScriptManager2; + } +} diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionTestPlanDataInNewEdit.aspx b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionTestPlanDataInNewEdit.aspx new file mode 100644 index 00000000..b8148a7a --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionTestPlanDataInNewEdit.aspx @@ -0,0 +1,65 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="InspectionTestPlanDataInNewEdit.aspx.cs" Inherits="FineUIPro.Web.CQMS.Comprehensive.InspectionTestPlanDataInNewEdit" %> + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionTestPlanDataInNewEdit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionTestPlanDataInNewEdit.aspx.cs new file mode 100644 index 00000000..d8c5b606 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionTestPlanDataInNewEdit.aspx.cs @@ -0,0 +1,193 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CQMS.Comprehensive +{ + public partial class InspectionTestPlanDataInNewEdit : PageBase + { + #region 定义项 + /// + /// 临时表主键 + /// + public string TempId + { + get + { + return (string)ViewState["TempId"]; + } + set + { + ViewState["TempId"] = value; + } + } + #endregion + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.TempId = Request.Params["TempId"]; + this.txtValue1.Focus(); + var dataInTemp = BLL.Sys_CQMS_DataInTempService.GetDataInTempByTempId(this.TempId); + if (dataInTemp != null) + { + this.txtValue1.Text = dataInTemp.Value1; + this.txtValue2.Text = dataInTemp.Value2; + this.txtValue3.Text = dataInTemp.Value3; + this.txtValue4.Text = dataInTemp.Value4; + this.txtValue5.Text = dataInTemp.Value5; + this.txtValue6.Text = dataInTemp.Value6; + this.txtValue7.Text = dataInTemp.Value7; + this.txtValue8.Text = dataInTemp.Value8; + + this.lbErrCout.Text = dataInTemp.ToopValue; + } + } + } + #endregion + + #region 保存按钮 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + var dataInTemp = BLL.Sys_CQMS_DataInTempService.GetDataInTempByTempId(this.TempId); + if (this.ckAll.Checked) + { + var allDataInTemp = from x in Funs.DB.Sys_CQMS_DataInTemp where x.ProjectId == this.CurrUser.LoginProjectId && x.UserId == this.CurrUser.UserId && x.Type == "InspectionTestPlan" select x; + if (dataInTemp.Value1 != this.txtValue1.Text.Trim()) + { + var tempValue1 = allDataInTemp.Where(x => x.Value1 == dataInTemp.Value1 || (x.Value1 == null && dataInTemp.Value1 == null)); + if (tempValue1 != null) + { + foreach (var item in tempValue1) + { + item.Value1 = this.txtValue1.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value2 != this.txtValue2.Text.Trim()) + { + var tempValue2 = allDataInTemp.Where(x => x.Value2 == dataInTemp.Value2 || (x.Value2 == null && dataInTemp.Value2 == null)); + if (tempValue2 != null) + { + foreach (var item in tempValue2) + { + item.Value2 = this.txtValue2.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value3 != this.txtValue3.Text.Trim()) + { + var tempValue3 = allDataInTemp.Where(x => x.Value3 == dataInTemp.Value3 || (x.Value3 == null && dataInTemp.Value3 == null)); + if (tempValue3 != null) + { + foreach (var item in tempValue3) + { + item.Value3 = this.txtValue3.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value5 != this.txtValue5.Text.Trim()) + { + var tempValue5 = allDataInTemp.Where(x => x.Value5 == dataInTemp.Value5 || (x.Value5 == null && dataInTemp.Value5 == null)); + if (tempValue5 != null) + { + foreach (var item in tempValue5) + { + item.Value5 = this.txtValue5.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value6 != this.txtValue6.Text.Trim()) + { + var tempValue6 = allDataInTemp.Where(x => x.Value6 == dataInTemp.Value6 || (x.Value6 == null && dataInTemp.Value6 == null)); + if (tempValue6 != null) + { + foreach (var item in tempValue6) + { + item.Value6 = this.txtValue6.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value7 != this.txtValue7.Text.Trim()) + { + var tempValue7 = allDataInTemp.Where(x => x.Value7 == dataInTemp.Value7 || (x.Value7 == null && dataInTemp.Value7 == null)); + if (tempValue7 != null) + { + foreach (var item in tempValue7) + { + item.Value7 = this.txtValue7.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value8 != this.txtValue8.Text.Trim()) + { + var tempValue8 = allDataInTemp.Where(x => x.Value8 == dataInTemp.Value8 || (x.Value8 == null && dataInTemp.Value8 == null)); + if (tempValue8 != null) + { + foreach (var item in tempValue8) + { + item.Value8 = this.txtValue8.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + var toopValue = allDataInTemp.Where(x => x.ToopValue == dataInTemp.ToopValue); + if (toopValue != null) + { + foreach (var item in toopValue) + { + item.ToopValue = null; + Funs.DB.SubmitChanges(); + } + } + } + else + { + Model.Sys_CQMS_DataInTemp newDataInTemp = new Model.Sys_CQMS_DataInTemp(); + newDataInTemp.ProjectId = this.CurrUser.LoginProjectId; + newDataInTemp.UserId = this.CurrUser.UserId; + newDataInTemp.Time = System.DateTime.Now; + newDataInTemp.Type = "InspectionTestPlan"; + newDataInTemp.Value1 = this.txtValue1.Text.Trim(); + newDataInTemp.Value2 = this.txtValue2.Text.Trim(); + newDataInTemp.Value3 = this.txtValue3.Text.Trim(); + newDataInTemp.Value4 = this.txtValue4.Text.Trim(); + newDataInTemp.Value5 = this.txtValue5.Text.Trim(); + newDataInTemp.Value6 = this.txtValue6.Text.Trim(); + newDataInTemp.Value7 = this.txtValue7.Text.Trim(); + newDataInTemp.Value8 = this.txtValue8.Text.Trim(); + if (!string.IsNullOrEmpty(this.TempId)) + { + newDataInTemp.TempId = this.TempId; + newDataInTemp.ToopValue = null; + BLL.Sys_CQMS_DataInTempService.UpdateDataInTemp(newDataInTemp); + } + } + ShowNotify("信息修改完成!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionTestPlanDataInNewEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionTestPlanDataInNewEdit.aspx.designer.cs new file mode 100644 index 00000000..365e3559 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionTestPlanDataInNewEdit.aspx.designer.cs @@ -0,0 +1,161 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Comprehensive +{ + + + public partial class InspectionTestPlanDataInNewEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// txtValue1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue1; + + /// + /// txtValue2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue2; + + /// + /// txtValue3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue3; + + /// + /// txtValue4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue4; + + /// + /// txtValue5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue5; + + /// + /// txtValue6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue6; + + /// + /// txtValue7 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue7; + + /// + /// txtValue8 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue8; + + /// + /// ckAll 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.CheckBox ckAll; + + /// + /// lbErrCout 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea lbErrCout; + } +} diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApproval.aspx b/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApproval.aspx index d581e069..b8eb16d1 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApproval.aspx +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApproval.aspx @@ -15,8 +15,8 @@ @@ -112,7 +112,7 @@ diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApproval.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApproval.aspx.cs index 023438d1..49b52f1f 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApproval.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApproval.aspx.cs @@ -270,7 +270,7 @@ namespace FineUIPro.Web.Comprehensive /// protected void btnImport_Click(object sender, EventArgs e) { - PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("MajorPlanApprovalDataIn.aspx", "导入 - "))); + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("MajorPlanApprovalDataInNew.aspx", "导入 - "))); } #endregion diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApprovalDataInNew.aspx b/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApprovalDataInNew.aspx new file mode 100644 index 00000000..36d9d1aa --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApprovalDataInNew.aspx @@ -0,0 +1,182 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MajorPlanApprovalDataInNew.aspx.cs" Inherits="FineUIPro.Web.CQMS.Comprehensive.MajorPlanApprovalDataInNew" %> + + + + + + + 导入超危大工程施工方案 + + + + + + + +
+ + + + + + + + + + + <%----%> + + + + + + + + <%----%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApprovalDataInNew.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApprovalDataInNew.aspx.cs new file mode 100644 index 00000000..fee0d483 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApprovalDataInNew.aspx.cs @@ -0,0 +1,558 @@ +using BLL; +using FineUIPro.Web.ProjectData; +using Model; +using NPOI.SS.Formula.Functions; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Linq; +using System.Threading; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CQMS.Comprehensive +{ + public partial class MajorPlanApprovalDataInNew : PageBase + { + /// + /// 错误集合 + /// + public static string errorInfos = string.Empty; + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + if (percent == null) + { + percent = new Dictionary(); + } + this.id.Text = this.CurrUser.UserId; + this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + // 绑定表格 + this.BindGrid(); + } + else if (GetRequestEventArgument() == "reloadGrid") + { + BindGrid(); + } + } + #endregion + + #region 绑定数据 + /// + /// 绑定数据 + /// + private void BindGrid() + { + string strSql = @"SELECT TempId,ProjectId,UserId,Time,RowNo,ToopValue,Value1,Value2,Value3,Value4,Value5,Value6,Value7,Value8,Value9,Value10" + + @" ,Value11,Value12,Value13,Value14,Value15,Value16,Value17,Value18,Value19,Value20" + + @",ToopValue,Type" + + @" FROM Sys_CQMS_DataInTemp " + + @" WHERE ProjectId=@ProjectId AND UserId=@UserId AND Type=@Type"; + List listStr = new List(); + listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); + listStr.Add(new SqlParameter("@UserId", this.CurrUser.UserId)); + listStr.Add(new SqlParameter("@Type", "MajorPlanApproval")); + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + Grid1.RecordCount = tb.Rows.Count; + var table = this.GetPagedDataTable(Grid1, tb); + Grid1.DataSource = table; + Grid1.DataBind(); + + var dataInTempAll = from x in Funs.DB.Sys_CQMS_DataInTemp + where x.ProjectId == this.CurrUser.LoginProjectId && x.UserId == this.CurrUser.UserId && x.Type == "MajorPlanApproval" + select x; + for (int i = 0; i < Grid1.Rows.Count; i++) + { + var dataInTemp = dataInTempAll.FirstOrDefault(x => x.TempId == Grid1.Rows[i].DataKeys[0].ToString()); + if (dataInTemp != null) + { + if (!string.IsNullOrEmpty(dataInTemp.ToopValue)) + { + Grid1.Rows[i].RowCssClass = "red"; + } + } + } + var errData = from x in dataInTempAll where x.ToopValue != null select x; + this.lbDataCout.Text = errData.Count().ToString(); + } + #endregion + + #region 双击事件 + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); + return; + } + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("MajorPlanApprovalDataInNewEdit.aspx?TempId={0}", Grid1.SelectedRowID, "维护 - "))); + } + #endregion + + #region 导入信息 维护 + /// + /// 导入信息编辑 + /// + /// + /// + protected void btnMenuEdit_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); + return; + } + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("MajorPlanApprovalDataInNewEdit.aspx?TempId={0}", Grid1.SelectedRowID, "维护 - "))); + } + + /// + /// 删除按钮 + /// + /// + /// + protected void btnMenuDelete_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); + return; + } + + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + BLL.Sys_CQMS_DataInTempService.DeleteDataInTempByDataInTempID(rowID); + } + + ShowNotify("删除成功!", MessageBoxIcon.Success); + this.BindGrid(); + } + #endregion + + #region 分页 排序 + /// + /// 分页 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + BindGrid(); + } + + /// + /// 分页显示条数下拉框 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e) + { + BindGrid(); + } + #endregion + + #region 文件上传 + /// + /// 文件上传 + /// + /// + /// + protected void imgbtnImport_Click(object sender, EventArgs e) + { + try + { + if (this.FileExcel.HasFile == false) + { + ShowNotify("请选择Excel文件!", MessageBoxIcon.Warning); + return; + } + string IsXls = Path.GetExtension(this.FileExcel.FileName).ToString().Trim().ToLower(); + if (IsXls != ".xls" && IsXls != ".xlsx") + { + ShowNotify("只能选择Excel文件!", MessageBoxIcon.Warning); + return; + } + string rootPath = Server.MapPath("~/"); + string initFullPath = rootPath + Const.ExcelUrl; + if (!Directory.Exists(initFullPath)) + { + Directory.CreateDirectory(initFullPath); + } + //指定上传文件名称 + this.hdfileName.Text = BLL.Funs.GetNewFileName() + IsXls; + //上传文件路径 + string filePath = initFullPath + this.hdfileName.Text; + //文件上传服务器 + this.FileExcel.PostedFile.SaveAs(filePath); + //文件上传服务器后的名称 + string fileName = rootPath + Const.ExcelUrl + this.hdfileName.Text; + //读取Excel + DataSet ds = NPOIHelper.ExcelToDataSet(fileName, out errorInfos, true); + //验证Excel读取是否有误 + if (!string.IsNullOrEmpty(errorInfos)) + { + ShowNotify(errorInfos, MessageBoxIcon.Warning); + return; + } + + if (ds.Tables.Count > 0) + { + for (int i = 1; i < ds.Tables[0].Rows.Count; i++) + { + Sys_CQMS_DataInTemp newDataInTemp = new Sys_CQMS_DataInTemp(); + newDataInTemp.TempId = SQLHelper.GetNewID(typeof(Model.Sys_CQMS_DataInTemp)); + newDataInTemp.ProjectId = this.CurrUser.LoginProjectId; + newDataInTemp.UserId = this.CurrUser.UserId; + newDataInTemp.Time = System.DateTime.Now; + newDataInTemp.Type = "MajorPlanApproval"; + newDataInTemp.RowNo = i + 2; + newDataInTemp.Value1 = ds.Tables[0].Rows[i][0].ToString(); + newDataInTemp.Value2 = ds.Tables[0].Rows[i][1].ToString(); + newDataInTemp.Value3 = ds.Tables[0].Rows[i][2].ToString(); + newDataInTemp.Value4 = ds.Tables[0].Rows[i][3].ToString(); + newDataInTemp.Value5 = ds.Tables[0].Rows[i][4].ToString(); + newDataInTemp.Value6 = ds.Tables[0].Rows[i][5].ToString(); + newDataInTemp.Value7 = ds.Tables[0].Rows[i][6].ToString(); + newDataInTemp.Value8 = ds.Tables[0].Rows[i][7].ToString(); + newDataInTemp.Value9 = ds.Tables[0].Rows[i][8].ToString(); + newDataInTemp.Value10 = ds.Tables[0].Rows[i][9].ToString(); + newDataInTemp.Value11 = ds.Tables[0].Rows[i][10].ToString(); + newDataInTemp.Value12 = ds.Tables[0].Rows[i][11].ToString(); + + BLL.Sys_CQMS_DataInTempService.AddDataInTemp(newDataInTemp); + } + this.BindGrid(); + ShowNotify("数据已导入临时表!", MessageBoxIcon.Success); + } + else + { + Alert.ShowInTop("导入数据为空!", MessageBoxIcon.Success); + return; + } + } + catch (Exception ex) + { + Alert.ShowInTop("'" + ex.Message + "'", MessageBoxIcon.Warning); + } + } + #endregion + + #region 导出按钮 + /// 导出按钮 + /// + /// + /// + protected void btnOut_Click(object sender, EventArgs e) + { + Response.ClearContent(); + string filename = Funs.GetNewFileName(); + Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("超危大工程施工方案" + filename, System.Text.Encoding.UTF8) + ".xls"); + Response.ContentType = "application/excel"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + Response.Write(GetGridTableHtml(Grid1)); + Response.End(); + } + #endregion + + #region 保存审核事件 + /// + /// 保存审核事件 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + Thread t = new Thread(new ThreadStart(() => { btnSaveMethod(this.CurrUser.LoginProjectId, this.CurrUser.UserId, "MajorPlanApproval"); })); + t.Start(); + if (percent.ContainsKey(this.CurrUser.UserId)) + { + percent[CurrUser.UserId] = 0; + } + else + { + percent.Add(CurrUser.UserId, 0); + + } + PageContext.RegisterStartupScript("printX()"); + } + protected void btnRefresh_Click(object sender, EventArgs e) + { + this.BindGrid(); + } + + protected void btnSaveMethod(string LoginProjectId, string UserId, string IsPDMS) + { + var oldViewInfos = from x in Funs.DB.Comprehensive_MajorPlanApproval + where x.ProjectId == this.CurrUser.LoginProjectId + select x; + + var units = from x in Funs.DB.Base_Unit + join y in Funs.DB.Project_ProjectUnit on x.UnitId equals y.UnitId + where y.ProjectId == this.CurrUser.LoginProjectId + select x; + + var cns = from x in Funs.DB.Base_CNProfessional select x; + + var unitWorks = from x in Funs.DB.WBS_UnitWork + where x.ProjectId == this.CurrUser.LoginProjectId + && (x.SuperUnitWork == null || x.SuperUnitWork == "0") + select x; + + var dataInTemp = from x in Funs.DB.Sys_CQMS_DataInTemp + where x.ProjectId == LoginProjectId && x.UserId == UserId && x.Type == "MajorPlanApproval" + select x; + int okCount = 0; + int i = 0; + int ir = dataInTemp.Count(); + string erreMessage = ""; + foreach (var tempData in dataInTemp) + { + if (tempData != null) + { + i++; + percent[UserId] = (int)(100 * i / ir); + string errInfo = string.Empty; + + Model.Comprehensive_MajorPlanApproval Ins = new Model.Comprehensive_MajorPlanApproval(); + if (!string.IsNullOrEmpty(tempData.Value1.Trim())) + { + var unit = units.FirstOrDefault(x => x.UnitName == tempData.Value1.Trim()); + if (unit == null) + { + errInfo += "报批单位[" + tempData.Value1.Trim() + "]不存在;"; + } + else + { + Ins.UnitId = unit.UnitId; + } + } + else + { + errInfo += "报验单位为必填项;"; + } + if (!string.IsNullOrEmpty(tempData.Value2.Trim())) + { + var cn = cns.Where(x => x.ProfessionalName == tempData.Value2.Trim()).FirstOrDefault(); + if (cn == null) + { + errInfo += "专业[" + tempData.Value2.Trim() + "]不存在;"; + } + else + { + Ins.CNProfessionalId = cn.CNProfessionalId; + } + } + else + { + errInfo += "专业为必填项;"; + } + if (!string.IsNullOrEmpty(tempData.Value3.Trim())) + { + string unitIds = string.Empty; + string[] reunit = tempData.Value3.Trim().Split(','); + foreach (string unitWork in reunit) + { + var u = unitWorks.Where(x => x.UnitWorkName == unitWork.Trim()).FirstOrDefault(); + if (u == null) + { + errInfo += "单位工程名称[" + unitWork.Trim() + "]不存在;"; + } + else + { + var q = BLL.UnitWorkService.GetUnitWorkByUnitWorkName(this.CurrUser.LoginProjectId, unitWork.Trim()).UnitWorkId; + unitIds += q + ","; + } + } + if (!string.IsNullOrEmpty(unitIds)) + { + unitIds = unitIds.Substring(0, unitIds.LastIndexOf(",")); + } + Ins.UnitWorkId = unitIds; + } + if (!string.IsNullOrEmpty(tempData.Value4.Trim())) + { + Ins.PlanCode = tempData.Value4.Trim(); + } + else + { + errInfo += "编号为必填项;"; + } + if (!string.IsNullOrEmpty(tempData.Value5.Trim())) + { + Ins.PlanName = tempData.Value5.Trim(); + } + if (!string.IsNullOrEmpty(tempData.Value6.Trim())) + { + Ins.ReviewMan = tempData.Value6.Trim(); + } + if (!string.IsNullOrEmpty(tempData.Value7.Trim())) + { + try + { + Ins.ApprovalDate = Funs.GetNewDateTime(tempData.Value7.Trim()); + if (Ins.ApprovalDate == null) + { + errInfo += "审批日期[" + tempData.Value7.Trim() + "]错误;"; + } + } + catch (Exception) + { + errInfo += "审批日期[" + tempData.Value7.Trim() + "]错误;"; + } + } + if (!string.IsNullOrEmpty(tempData.Value8.Trim())) + { + Ins.AuditMan = tempData.Value8.Trim(); + } + if (!string.IsNullOrEmpty(tempData.Value9.Trim())) + { + Ins.ApprovalMan = tempData.Value9.Trim(); + } + if (!string.IsNullOrEmpty(tempData.Value10.Trim())) + { + Ins.ExpertReviewMan = tempData.Value10.Trim(); + } + if (!string.IsNullOrEmpty(tempData.Value11.Trim())) + { + if (tempData.Value11.Trim() != "是" && tempData.Value11.Trim() != "否") + { + errInfo += "是否通过专家[" + tempData.Value11.Trim() + "]错误;"; + } + else + { + Ins.IsReview = tempData.Value11.Trim() == "是" ? true : false; + } + } + else + { + errInfo += "是否通过专家为必填项;"; + } + if (!string.IsNullOrEmpty(tempData.Value12.Trim())) + { + try + { + Ins.RemarkCode = Convert.ToInt32(tempData.Value12.Trim()); + if (Ins.RemarkCode == null) + { + errInfo += "标志编号[" + tempData.Value12.Trim() + "]格式错误;"; + } + } + catch (Exception) + { + errInfo += "标志编号[" + tempData.Value12.Trim() + "]格式错误;"; + } + } + else + { + errInfo += "标志编号为必填项;"; + } + Ins.CompileMan = this.CurrUser.UserId; + Ins.CompileDate = DateTime.Now.Date; + if (string.IsNullOrEmpty(errInfo)) ////所有信息正确的话 插入数据 + { + Ins.ProjectId = LoginProjectId; + var isExitISOValue = oldViewInfos.FirstOrDefault(x => x.RemarkCode == Funs.GetNewIntOrZero(tempData.Value12)); + if (isExitISOValue != null) ///已存在 + { + Ins.MajorPlanApprovalId = isExitISOValue.MajorPlanApprovalId; + BLL.MajorPlanApprovalService.UpdateMajorPlanApproval(Ins); + } + else + { + Ins.MajorPlanApprovalId = SQLHelper.GetNewID(typeof(Model.Comprehensive_MajorPlanApproval)); + BLL.MajorPlanApprovalService.AddMajorPlanApproval(Ins); + } + BLL.Sys_CQMS_DataInTempService.DeleteDataInTempByDataInTempID(tempData.TempId); + okCount++; + } + + if (!string.IsNullOrEmpty(errInfo)) + { + tempData.ToopValue = errInfo; + BLL.Sys_CQMS_DataInTempService.UpdateDataInTemp(tempData); + erreMessage += errInfo + ";"; + + } + } + } + } + #endregion + + #region 删除所有数据事件 + /// + /// 删除所有数据事件 + /// + /// + /// + protected void btnAllDelete_Click(object sender, EventArgs e) + { + //先删除临时表中 该人员以前导入的数据 + BLL.Sys_CQMS_DataInTempService.DeleteDataInTempByProjectIdUserId(this.CurrUser.LoginProjectId, this.CurrUser.UserId, "MajorPlanApproval"); + this.BindGrid(); + ShowNotify("删除成功!", MessageBoxIcon.Success); + this.lbDataCout.Text = string.Empty; + } + #endregion + + #region 模版导入说明 下载 + /// + /// 下载模版 + /// + /// + /// + protected void imgbtnUpload_Click(object sender, EventArgs e) + { + string rootPath = Server.MapPath("~/"); + string uploadfilepath = rootPath + Const.MajorPlanApprovalTemplateUrl; + string filePath = Const.MajorPlanApprovalTemplateUrl; + string fileName = Path.GetFileName(filePath); + FileInfo info = new FileInfo(uploadfilepath); + long fileSize = info.Length; + Response.ClearContent(); + Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + Response.ContentType = "excel/plain"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + Response.AddHeader("Content-Length", fileSize.ToString().Trim()); + Response.TransmitFile(uploadfilepath, 0, fileSize); + Response.End(); + } + #endregion + + public static Dictionary percent { get; set; } + public static Dictionary url { get; set; } + + [System.Web.Services.WebMethod] + public static int getPercent(string id) + { + return percent[id]; + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApprovalDataInNew.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApprovalDataInNew.aspx.designer.cs new file mode 100644 index 00000000..a7c92b00 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApprovalDataInNew.aspx.designer.cs @@ -0,0 +1,251 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Comprehensive +{ + + + public partial class MajorPlanApprovalDataInNew + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// id 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField id; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// hdfileName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdfileName; + + /// + /// FileExcel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FileUpload FileExcel; + + /// + /// imgbtnImport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button imgbtnImport; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnRefresh 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnRefresh; + + /// + /// btnAllDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAllDelete; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// imgbtnUpload 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button imgbtnUpload; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// lbDataCout 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbDataCout; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Window2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window2; + + /// + /// ContentPanel3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ContentPanel ContentPanel3; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuEdit; + + /// + /// btnMenuDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDelete; + + /// + /// ScriptManager2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.ScriptManager ScriptManager2; + } +} diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApprovalDataInNewEdit.aspx b/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApprovalDataInNewEdit.aspx new file mode 100644 index 00000000..5b928f68 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApprovalDataInNewEdit.aspx @@ -0,0 +1,77 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MajorPlanApprovalDataInNewEdit.aspx.cs" Inherits="FineUIPro.Web.CQMS.Comprehensive.MajorPlanApprovalDataInNewEdit" %> + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApprovalDataInNewEdit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApprovalDataInNewEdit.aspx.cs new file mode 100644 index 00000000..703b3640 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApprovalDataInNewEdit.aspx.cs @@ -0,0 +1,249 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CQMS.Comprehensive +{ + public partial class MajorPlanApprovalDataInNewEdit : PageBase + { + #region 定义项 + /// + /// 临时表主键 + /// + public string TempId + { + get + { + return (string)ViewState["TempId"]; + } + set + { + ViewState["TempId"] = value; + } + } + #endregion + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.TempId = Request.Params["TempId"]; + this.txtValue1.Focus(); + var dataInTemp = BLL.Sys_CQMS_DataInTempService.GetDataInTempByTempId(this.TempId); + if (dataInTemp != null) + { + this.txtValue1.Text = dataInTemp.Value1; + this.txtValue2.Text = dataInTemp.Value2; + this.txtValue3.Text = dataInTemp.Value3; + this.txtValue4.Text = dataInTemp.Value4; + this.txtValue5.Text = dataInTemp.Value5; + this.txtValue6.Text = dataInTemp.Value6; + this.txtValue7.Text = dataInTemp.Value7; + this.txtValue8.Text = dataInTemp.Value8; + this.txtValue9.Text = dataInTemp.Value9; + this.txtValue10.Text = dataInTemp.Value10; + this.txtValue11.Text = dataInTemp.Value11; + this.txtValue12.Text = dataInTemp.Value12; + + this.lbErrCout.Text = dataInTemp.ToopValue; + } + } + } + #endregion + + #region 保存按钮 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + var dataInTemp = BLL.Sys_CQMS_DataInTempService.GetDataInTempByTempId(this.TempId); + if (this.ckAll.Checked) + { + var allDataInTemp = from x in Funs.DB.Sys_CQMS_DataInTemp where x.ProjectId == this.CurrUser.LoginProjectId && x.UserId == this.CurrUser.UserId && x.Type == "MajorPlanApproval" select x; + if (dataInTemp.Value1 != this.txtValue1.Text.Trim()) + { + var tempValue1 = allDataInTemp.Where(x => x.Value1 == dataInTemp.Value1 || (x.Value1 == null && dataInTemp.Value1 == null)); + if (tempValue1 != null) + { + foreach (var item in tempValue1) + { + item.Value1 = this.txtValue1.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value2 != this.txtValue2.Text.Trim()) + { + var tempValue2 = allDataInTemp.Where(x => x.Value2 == dataInTemp.Value2 || (x.Value2 == null && dataInTemp.Value2 == null)); + if (tempValue2 != null) + { + foreach (var item in tempValue2) + { + item.Value2 = this.txtValue2.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value3 != this.txtValue3.Text.Trim()) + { + var tempValue3 = allDataInTemp.Where(x => x.Value3 == dataInTemp.Value3 || (x.Value3 == null && dataInTemp.Value3 == null)); + if (tempValue3 != null) + { + foreach (var item in tempValue3) + { + item.Value3 = this.txtValue3.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value5 != this.txtValue5.Text.Trim()) + { + var tempValue5 = allDataInTemp.Where(x => x.Value5 == dataInTemp.Value5 || (x.Value5 == null && dataInTemp.Value5 == null)); + if (tempValue5 != null) + { + foreach (var item in tempValue5) + { + item.Value5 = this.txtValue5.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value6 != this.txtValue6.Text.Trim()) + { + var tempValue6 = allDataInTemp.Where(x => x.Value6 == dataInTemp.Value6 || (x.Value6 == null && dataInTemp.Value6 == null)); + if (tempValue6 != null) + { + foreach (var item in tempValue6) + { + item.Value6 = this.txtValue6.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value7 != this.txtValue7.Text.Trim()) + { + var tempValue7 = allDataInTemp.Where(x => x.Value7 == dataInTemp.Value7 || (x.Value7 == null && dataInTemp.Value7 == null)); + if (tempValue7 != null) + { + foreach (var item in tempValue7) + { + item.Value7 = this.txtValue7.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value8 != this.txtValue8.Text.Trim()) + { + var tempValue8 = allDataInTemp.Where(x => x.Value8 == dataInTemp.Value8 || (x.Value8 == null && dataInTemp.Value8 == null)); + if (tempValue8 != null) + { + foreach (var item in tempValue8) + { + item.Value8 = this.txtValue8.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value9 != this.txtValue9.Text.Trim()) + { + var tempValue9 = allDataInTemp.Where(x => x.Value9 == dataInTemp.Value9 || (x.Value9 == null && dataInTemp.Value9 == null)); + if (tempValue9 != null) + { + foreach (var item in tempValue9) + { + item.Value9 = this.txtValue9.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value10 != this.txtValue10.Text.Trim()) + { + var tempValue10 = allDataInTemp.Where(x => x.Value10 == dataInTemp.Value10 || (x.Value10 == null && dataInTemp.Value10 == null)); + if (tempValue10 != null) + { + foreach (var item in tempValue10) + { + item.Value10 = this.txtValue10.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value11 != this.txtValue11.Text.Trim()) + { + var tempValue11 = allDataInTemp.Where(x => x.Value11 == dataInTemp.Value11 || (x.Value11 == null && dataInTemp.Value11 == null)); + if (tempValue11 != null) + { + foreach (var item in tempValue11) + { + item.Value11 = this.txtValue11.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value12 != this.txtValue12.Text.Trim()) + { + var tempValue12 = allDataInTemp.Where(x => x.Value12 == dataInTemp.Value12 || (x.Value12 == null && dataInTemp.Value12 == null)); + if (tempValue12 != null) + { + foreach (var item in tempValue12) + { + item.Value12 = this.txtValue12.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + var toopValue = allDataInTemp.Where(x => x.ToopValue == dataInTemp.ToopValue); + if (toopValue != null) + { + foreach (var item in toopValue) + { + item.ToopValue = null; + Funs.DB.SubmitChanges(); + } + } + } + else + { + Model.Sys_CQMS_DataInTemp newDataInTemp = new Model.Sys_CQMS_DataInTemp(); + newDataInTemp.ProjectId = this.CurrUser.LoginProjectId; + newDataInTemp.UserId = this.CurrUser.UserId; + newDataInTemp.Time = System.DateTime.Now; + newDataInTemp.Type = "MajorPlanApproval"; + newDataInTemp.Value1 = this.txtValue1.Text.Trim(); + newDataInTemp.Value2 = this.txtValue2.Text.Trim(); + newDataInTemp.Value3 = this.txtValue3.Text.Trim(); + newDataInTemp.Value4 = this.txtValue4.Text.Trim(); + newDataInTemp.Value5 = this.txtValue5.Text.Trim(); + newDataInTemp.Value6 = this.txtValue6.Text.Trim(); + newDataInTemp.Value7 = this.txtValue7.Text.Trim(); + newDataInTemp.Value8 = this.txtValue8.Text.Trim(); + newDataInTemp.Value9 = this.txtValue9.Text.Trim(); + newDataInTemp.Value10 = this.txtValue10.Text.Trim(); + newDataInTemp.Value11 = this.txtValue11.Text.Trim(); + newDataInTemp.Value12 = this.txtValue12.Text.Trim(); + if (!string.IsNullOrEmpty(this.TempId)) + { + newDataInTemp.TempId = this.TempId; + newDataInTemp.ToopValue = null; + BLL.Sys_CQMS_DataInTempService.UpdateDataInTemp(newDataInTemp); + } + } + ShowNotify("信息修改完成!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApprovalDataInNewEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApprovalDataInNewEdit.aspx.designer.cs new file mode 100644 index 00000000..d468a0b5 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/MajorPlanApprovalDataInNewEdit.aspx.designer.cs @@ -0,0 +1,197 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Comprehensive +{ + + + public partial class MajorPlanApprovalDataInNewEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// txtValue1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue1; + + /// + /// txtValue2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue2; + + /// + /// txtValue3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue3; + + /// + /// txtValue4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue4; + + /// + /// txtValue5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue5; + + /// + /// txtValue6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue6; + + /// + /// txtValue7 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue7; + + /// + /// txtValue8 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue8; + + /// + /// txtValue9 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue9; + + /// + /// txtValue10 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue10; + + /// + /// txtValue11 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue11; + + /// + /// txtValue12 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue12; + + /// + /// ckAll 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.CheckBox ckAll; + + /// + /// lbErrCout 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea lbErrCout; + } +} diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/NCRManagementDataInNewEdit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/NCRManagementDataInNewEdit.aspx.cs index 2a1688cd..cbf4af35 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/NCRManagementDataInNewEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/NCRManagementDataInNewEdit.aspx.cs @@ -257,7 +257,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive else { Model.Sys_CQMS_DataInTemp newDataInTemp = new Model.Sys_CQMS_DataInTemp(); - newDataInTemp.ProjectId = this.CurrUser.ProjectId; + newDataInTemp.ProjectId = this.CurrUser.LoginProjectId; newDataInTemp.UserId = this.CurrUser.UserId; newDataInTemp.Time = System.DateTime.Now; newDataInTemp.Type = "NCR"; diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/PressurePipe.aspx b/SGGL/FineUIPro.Web/CQMS/Comprehensive/PressurePipe.aspx index 98af5de4..afd99afc 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/PressurePipe.aspx +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/PressurePipe.aspx @@ -16,7 +16,7 @@ @@ -103,7 +103,7 @@ diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecords.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecords.aspx.cs index 2b328f37..9979be44 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecords.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecords.aspx.cs @@ -201,7 +201,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive /// protected void btnImport_Click(object sender, EventArgs e) { - PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("TrainingRecordsDataIn.aspx", "导入 - "))); + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("TrainingRecordsDataInNew.aspx", "导入 - "))); } #endregion diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataInNew.aspx b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataInNew.aspx new file mode 100644 index 00000000..c7a634f6 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataInNew.aspx @@ -0,0 +1,169 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TrainingRecordsDataInNew.aspx.cs" Inherits="FineUIPro.Web.CQMS.Comprehensive.TrainingRecordsDataInNew" %> + + + + + + + + + + + + + +
+ + + + + + + + + + + <%----%> + + + + + + + + <%----%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataInNew.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataInNew.aspx.cs new file mode 100644 index 00000000..1e77cb09 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataInNew.aspx.cs @@ -0,0 +1,488 @@ +using BLL; +using Model; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Linq; +using System.Threading; + +namespace FineUIPro.Web.CQMS.Comprehensive +{ + public partial class TrainingRecordsDataInNew : PageBase + { + /// + /// 错误集合 + /// + public static string errorInfos = string.Empty; + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + if (percent == null) + { + percent = new Dictionary(); + } + this.id.Text = this.CurrUser.UserId; + this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + // 绑定表格 + this.BindGrid(); + } + else if (GetRequestEventArgument() == "reloadGrid") + { + BindGrid(); + } + } + #endregion + + #region 绑定数据 + /// + /// 绑定数据 + /// + private void BindGrid() + { + string strSql = @"SELECT TempId,ProjectId,UserId,Time,RowNo,ToopValue,Value1,Value2,Value3,Value4,Value5,Value6,Value7,Value8,Value9,Value10" + + @" ,Value11,Value12,Value13,Value14,Value15,Value16,Value17,Value18,Value19,Value20" + + @",ToopValue,Type" + + @" FROM Sys_CQMS_DataInTemp " + + @" WHERE ProjectId=@ProjectId AND UserId=@UserId AND Type=@Type"; + List listStr = new List(); + listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); + listStr.Add(new SqlParameter("@UserId", this.CurrUser.UserId)); + listStr.Add(new SqlParameter("@Type", "TrainingRecords")); + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + Grid1.RecordCount = tb.Rows.Count; + var table = this.GetPagedDataTable(Grid1, tb); + Grid1.DataSource = table; + Grid1.DataBind(); + + var dataInTempAll = from x in Funs.DB.Sys_CQMS_DataInTemp + where x.ProjectId == this.CurrUser.LoginProjectId && x.UserId == this.CurrUser.UserId && x.Type == "TrainingRecords" + select x; + for (int i = 0; i < Grid1.Rows.Count; i++) + { + var dataInTemp = dataInTempAll.FirstOrDefault(x => x.TempId == Grid1.Rows[i].DataKeys[0].ToString()); + if (dataInTemp != null) + { + if (!string.IsNullOrEmpty(dataInTemp.ToopValue)) + { + Grid1.Rows[i].RowCssClass = "red"; + } + } + } + var errData = from x in dataInTempAll where x.ToopValue != null select x; + this.lbDataCout.Text = errData.Count().ToString(); + } + #endregion + + #region 双击事件 + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); + return; + } + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("TrainingRecordsDataInNewEdit.aspx?TempId={0}", Grid1.SelectedRowID, "维护 - "))); + } + #endregion + + #region 导入信息 维护 + /// + /// 导入信息编辑 + /// + /// + /// + protected void btnMenuEdit_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); + return; + } + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("TrainingRecordsDataInNewEdit.aspx?TempId={0}", Grid1.SelectedRowID, "维护 - "))); + } + + /// + /// 删除按钮 + /// + /// + /// + protected void btnMenuDelete_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); + return; + } + + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + BLL.Sys_CQMS_DataInTempService.DeleteDataInTempByDataInTempID(rowID); + } + + ShowNotify("删除成功!", MessageBoxIcon.Success); + this.BindGrid(); + } + #endregion + + #region 分页 排序 + /// + /// 分页 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + BindGrid(); + } + + /// + /// 分页显示条数下拉框 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e) + { + BindGrid(); + } + #endregion + + #region 文件上传 + /// + /// 文件上传 + /// + /// + /// + protected void imgbtnImport_Click(object sender, EventArgs e) + { + try + { + if (this.FileExcel.HasFile == false) + { + ShowNotify("请选择Excel文件!", MessageBoxIcon.Warning); + return; + } + string IsXls = Path.GetExtension(this.FileExcel.FileName).ToString().Trim().ToLower(); + if (IsXls != ".xls" && IsXls != ".xlsx") + { + ShowNotify("只能选择Excel文件!", MessageBoxIcon.Warning); + return; + } + string rootPath = Server.MapPath("~/"); + string initFullPath = rootPath + Const.ExcelUrl; + if (!Directory.Exists(initFullPath)) + { + Directory.CreateDirectory(initFullPath); + } + //指定上传文件名称 + this.hdfileName.Text = BLL.Funs.GetNewFileName() + IsXls; + //上传文件路径 + string filePath = initFullPath + this.hdfileName.Text; + //文件上传服务器 + this.FileExcel.PostedFile.SaveAs(filePath); + //文件上传服务器后的名称 + string fileName = rootPath + Const.ExcelUrl + this.hdfileName.Text; + //读取Excel + DataSet ds = NPOIHelper.ExcelToDataSet(fileName, out errorInfos, true); + //验证Excel读取是否有误 + if (!string.IsNullOrEmpty(errorInfos)) + { + ShowNotify(errorInfos, MessageBoxIcon.Warning); + return; + } + + if (ds.Tables.Count > 0) + { + for (int i = 1; i < ds.Tables[0].Rows.Count; i++) + { + Sys_CQMS_DataInTemp newDataInTemp = new Sys_CQMS_DataInTemp(); + newDataInTemp.TempId = SQLHelper.GetNewID(typeof(Model.Sys_CQMS_DataInTemp)); + newDataInTemp.ProjectId = this.CurrUser.LoginProjectId; + newDataInTemp.UserId = this.CurrUser.UserId; + newDataInTemp.Time = System.DateTime.Now; + newDataInTemp.Type = "TrainingRecords"; + newDataInTemp.RowNo = i + 2; + newDataInTemp.Value1 = ds.Tables[0].Rows[i][0].ToString(); + newDataInTemp.Value2 = ds.Tables[0].Rows[i][1].ToString(); + newDataInTemp.Value3 = ds.Tables[0].Rows[i][2].ToString(); + newDataInTemp.Value4 = ds.Tables[0].Rows[i][3].ToString(); + newDataInTemp.Value5 = ds.Tables[0].Rows[i][4].ToString(); + newDataInTemp.Value6 = ds.Tables[0].Rows[i][5].ToString(); + newDataInTemp.Value7 = ds.Tables[0].Rows[i][6].ToString(); + newDataInTemp.Value8 = ds.Tables[0].Rows[i][7].ToString(); + + BLL.Sys_CQMS_DataInTempService.AddDataInTemp(newDataInTemp); + } + this.BindGrid(); + ShowNotify("数据已导入临时表!", MessageBoxIcon.Success); + } + else + { + Alert.ShowInTop("导入数据为空!", MessageBoxIcon.Success); + return; + } + } + catch (Exception ex) + { + Alert.ShowInTop("'" + ex.Message + "'", MessageBoxIcon.Warning); + } + } + #endregion + + #region 导出按钮 + /// 导出按钮 + /// + /// + /// + protected void btnOut_Click(object sender, EventArgs e) + { + Response.ClearContent(); + string filename = Funs.GetNewFileName(); + Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("培训记录" + filename, System.Text.Encoding.UTF8) + ".xls"); + Response.ContentType = "application/excel"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + Response.Write(GetGridTableHtml(Grid1)); + Response.End(); + } + #endregion + + #region 保存审核事件 + /// + /// 保存审核事件 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + Thread t = new Thread(new ThreadStart(() => { btnSaveMethod(this.CurrUser.LoginProjectId, this.CurrUser.UserId, "TrainingRecords"); })); + t.Start(); + if (percent.ContainsKey(this.CurrUser.UserId)) + { + percent[CurrUser.UserId] = 0; + } + else + { + percent.Add(CurrUser.UserId, 0); + + } + PageContext.RegisterStartupScript("printX()"); + } + protected void btnRefresh_Click(object sender, EventArgs e) + { + this.BindGrid(); + } + + protected void btnSaveMethod(string LoginProjectId, string UserId, string IsPDMS) + { + var oldViewInfos = from x in Funs.DB.Comprehensive_TrainingRecords + where x.ProjectId == this.CurrUser.LoginProjectId + select x; + + var cns = from x in Funs.DB.Base_CNProfessional select x; + + var dataInTemp = from x in Funs.DB.Sys_CQMS_DataInTemp + where x.ProjectId == LoginProjectId && x.UserId == UserId && x.Type == "TrainingRecords" + select x; + int okCount = 0; + int i = 0; + int ir = dataInTemp.Count(); + string erreMessage = ""; + foreach (var tempData in dataInTemp) + { + if (tempData != null) + { + i++; + percent[UserId] = (int)(100 * i / ir); + string errInfo = string.Empty; + + Model.Comprehensive_TrainingRecords Ins = new Model.Comprehensive_TrainingRecords(); + if (!string.IsNullOrEmpty(tempData.Value1.Trim())) + { + Ins.TrainingContents = tempData.Value1.Trim(); + } + else + { + errInfo += "培训内容为必填项;"; + } + if (!string.IsNullOrEmpty(tempData.Value2.Trim())) + { + var cn = cns.Where(x => x.ProfessionalName == tempData.Value2.Trim()).FirstOrDefault(); + if (cn == null) + { + errInfo += "专业名称[" + tempData.Value2.Trim() + "]不存在;"; + } + else + { + Ins.CNProfessionalId = cn.CNProfessionalId; + } + } + else + { + errInfo += "专业名称为必填项;"; + } + + if (!string.IsNullOrEmpty(tempData.Value3.Trim())) + { + Ins.TrainingObject = tempData.Value3.Trim(); + } + else + { + errInfo += "培训对象为必填项;"; + } + if (!string.IsNullOrEmpty(tempData.Value4.Trim())) + { + Ins.TrainingAddress = tempData.Value4.Trim(); + } + else + { + errInfo += "培训地点为必填项;"; + } + if (!string.IsNullOrEmpty(tempData.Value5.Trim())) + { + try + { + Ins.Hours = Funs.GetNewDecimal(tempData.Value5.Trim()); + if (Ins.Hours == null) + { + errInfo += "课时[" + tempData.Value5.Trim() + "]不存在;"; + } + } + catch (Exception) + { + errInfo += "课时[" + tempData.Value5.Trim() + "]不存在;"; + } + } + if (!string.IsNullOrEmpty(tempData.Value6.Trim())) + { + Ins.KeynoteSpeaker = tempData.Value6.Trim(); + } + if (!string.IsNullOrEmpty(tempData.Value7.Trim())) + { + Ins.Remark=tempData.Value7.Trim(); + } + if (!string.IsNullOrEmpty(tempData.Value8.Trim())) + { + try + { + Ins.RemarkCode = Convert.ToInt32(tempData.Value8.Trim()); + if (Ins.RemarkCode == null) + { + errInfo += "标志编号[" + tempData.Value8.Trim() + "]格式错误;"; + } + } + catch (Exception) + { + errInfo += "标志编号[" + tempData.Value8.Trim() + "]格式错误;"; + } + } + else + { + errInfo += "标志编号为必填项;"; + } + if (string.IsNullOrEmpty(errInfo)) ////所有信息正确的话 插入数据 + { + Ins.ProjectId = LoginProjectId; + var isExitISOValue = oldViewInfos.FirstOrDefault(x => x.RemarkCode == Funs.GetNewIntOrZero(tempData.Value8)); + if (isExitISOValue != null) ///已存在 + { + Ins.TrainingRecordsId = isExitISOValue.TrainingRecordsId; + BLL.TrainingRecordsService.UpdateTrainingRecords(Ins); + } + else + { + Ins.TrainingRecordsId = SQLHelper.GetNewID(typeof(Model.Comprehensive_ConTechnologyDisclosure)); + BLL.TrainingRecordsService.AddTrainingRecords(Ins); + } + BLL.Sys_CQMS_DataInTempService.DeleteDataInTempByDataInTempID(tempData.TempId); + okCount++; + } + + if (!string.IsNullOrEmpty(errInfo)) + { + tempData.ToopValue = errInfo; + BLL.Sys_CQMS_DataInTempService.UpdateDataInTemp(tempData); + erreMessage += errInfo + ";"; + + } + } + } + } + #endregion + + #region 删除所有数据事件 + /// + /// 删除所有数据事件 + /// + /// + /// + protected void btnAllDelete_Click(object sender, EventArgs e) + { + //先删除临时表中 该人员以前导入的数据 + BLL.Sys_CQMS_DataInTempService.DeleteDataInTempByProjectIdUserId(this.CurrUser.LoginProjectId, this.CurrUser.UserId, "TrainingRecords"); + this.BindGrid(); + ShowNotify("删除成功!", MessageBoxIcon.Success); + this.lbDataCout.Text = string.Empty; + } + #endregion + + #region 模版导入说明 下载 + /// + /// 下载模版 + /// + /// + /// + protected void imgbtnUpload_Click(object sender, EventArgs e) + { + string rootPath = Server.MapPath("~/"); + string uploadfilepath = rootPath + Const.CQMS_TrainingRecordsTemplateUrl; + string filePath = Const.CQMS_TrainingRecordsTemplateUrl; + string fileName = Path.GetFileName(filePath); + FileInfo info = new FileInfo(uploadfilepath); + long fileSize = info.Length; + Response.ClearContent(); + Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + Response.ContentType = "excel/plain"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + Response.AddHeader("Content-Length", fileSize.ToString().Trim()); + Response.TransmitFile(uploadfilepath, 0, fileSize); + Response.End(); + } + #endregion + + public static Dictionary percent { get; set; } + public static Dictionary url { get; set; } + + [System.Web.Services.WebMethod] + public static int getPercent(string id) + { + return percent[id]; + } + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataInNew.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataInNew.aspx.designer.cs new file mode 100644 index 00000000..7857f602 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataInNew.aspx.designer.cs @@ -0,0 +1,251 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Comprehensive +{ + + + public partial class TrainingRecordsDataInNew + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// id 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField id; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// hdfileName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdfileName; + + /// + /// FileExcel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FileUpload FileExcel; + + /// + /// imgbtnImport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button imgbtnImport; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnRefresh 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnRefresh; + + /// + /// btnAllDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAllDelete; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// imgbtnUpload 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button imgbtnUpload; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// lbDataCout 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lbDataCout; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Window2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window2; + + /// + /// ContentPanel3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ContentPanel ContentPanel3; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuEdit; + + /// + /// btnMenuDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDelete; + + /// + /// ScriptManager2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.ScriptManager ScriptManager2; + } +} diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataInNewEdit.aspx b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataInNewEdit.aspx new file mode 100644 index 00000000..3eadae10 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataInNewEdit.aspx @@ -0,0 +1,66 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TrainingRecordsDataInNewEdit.aspx.cs" Inherits="FineUIPro.Web.CQMS.Comprehensive.TrainingRecordsDataInNewEdit" %> + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataInNewEdit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataInNewEdit.aspx.cs new file mode 100644 index 00000000..336d211f --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataInNewEdit.aspx.cs @@ -0,0 +1,193 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CQMS.Comprehensive +{ + public partial class TrainingRecordsDataInNewEdit : PageBase + { + #region 定义项 + /// + /// 临时表主键 + /// + public string TempId + { + get + { + return (string)ViewState["TempId"]; + } + set + { + ViewState["TempId"] = value; + } + } + #endregion + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.TempId = Request.Params["TempId"]; + this.txtValue1.Focus(); + var dataInTemp = BLL.Sys_CQMS_DataInTempService.GetDataInTempByTempId(this.TempId); + if (dataInTemp != null) + { + this.txtValue1.Text = dataInTemp.Value1; + this.txtValue2.Text = dataInTemp.Value2; + this.txtValue3.Text = dataInTemp.Value3; + this.txtValue4.Text = dataInTemp.Value4; + this.txtValue5.Text = dataInTemp.Value5; + this.txtValue6.Text = dataInTemp.Value6; + this.txtValue7.Text = dataInTemp.Value7; + this.txtValue8.Text = dataInTemp.Value8; + + this.lbErrCout.Text = dataInTemp.ToopValue; + } + } + } + #endregion + + #region 保存按钮 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + var dataInTemp = BLL.Sys_CQMS_DataInTempService.GetDataInTempByTempId(this.TempId); + if (this.ckAll.Checked) + { + var allDataInTemp = from x in Funs.DB.Sys_CQMS_DataInTemp where x.ProjectId == this.CurrUser.LoginProjectId && x.UserId == this.CurrUser.UserId && x.Type == "TrainingRecords" select x; + if (dataInTemp.Value1 != this.txtValue1.Text.Trim()) + { + var tempValue1 = allDataInTemp.Where(x => x.Value1 == dataInTemp.Value1 || (x.Value1 == null && dataInTemp.Value1 == null)); + if (tempValue1 != null) + { + foreach (var item in tempValue1) + { + item.Value1 = this.txtValue1.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value2 != this.txtValue2.Text.Trim()) + { + var tempValue2 = allDataInTemp.Where(x => x.Value2 == dataInTemp.Value2 || (x.Value2 == null && dataInTemp.Value2 == null)); + if (tempValue2 != null) + { + foreach (var item in tempValue2) + { + item.Value2 = this.txtValue2.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value3 != this.txtValue3.Text.Trim()) + { + var tempValue3 = allDataInTemp.Where(x => x.Value3 == dataInTemp.Value3 || (x.Value3 == null && dataInTemp.Value3 == null)); + if (tempValue3 != null) + { + foreach (var item in tempValue3) + { + item.Value3 = this.txtValue3.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value5 != this.txtValue5.Text.Trim()) + { + var tempValue5 = allDataInTemp.Where(x => x.Value5 == dataInTemp.Value5 || (x.Value5 == null && dataInTemp.Value5 == null)); + if (tempValue5 != null) + { + foreach (var item in tempValue5) + { + item.Value5 = this.txtValue5.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value6 != this.txtValue6.Text.Trim()) + { + var tempValue6 = allDataInTemp.Where(x => x.Value6 == dataInTemp.Value6 || (x.Value6 == null && dataInTemp.Value6 == null)); + if (tempValue6 != null) + { + foreach (var item in tempValue6) + { + item.Value6 = this.txtValue6.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value7 != this.txtValue7.Text.Trim()) + { + var tempValue7 = allDataInTemp.Where(x => x.Value7 == dataInTemp.Value7 || (x.Value7 == null && dataInTemp.Value7 == null)); + if (tempValue7 != null) + { + foreach (var item in tempValue7) + { + item.Value7 = this.txtValue7.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + if (dataInTemp.Value8 != this.txtValue8.Text.Trim()) + { + var tempValue8 = allDataInTemp.Where(x => x.Value8 == dataInTemp.Value8 || (x.Value8 == null && dataInTemp.Value8 == null)); + if (tempValue8 != null) + { + foreach (var item in tempValue8) + { + item.Value8 = this.txtValue8.Text.Trim(); + Funs.DB.SubmitChanges(); + } + } + } + var toopValue = allDataInTemp.Where(x => x.ToopValue == dataInTemp.ToopValue); + if (toopValue != null) + { + foreach (var item in toopValue) + { + item.ToopValue = null; + Funs.DB.SubmitChanges(); + } + } + } + else + { + Model.Sys_CQMS_DataInTemp newDataInTemp = new Model.Sys_CQMS_DataInTemp(); + newDataInTemp.ProjectId = this.CurrUser.LoginProjectId; + newDataInTemp.UserId = this.CurrUser.UserId; + newDataInTemp.Time = System.DateTime.Now; + newDataInTemp.Type = "TrainingRecords"; + newDataInTemp.Value1 = this.txtValue1.Text.Trim(); + newDataInTemp.Value2 = this.txtValue2.Text.Trim(); + newDataInTemp.Value3 = this.txtValue3.Text.Trim(); + newDataInTemp.Value4 = this.txtValue4.Text.Trim(); + newDataInTemp.Value5 = this.txtValue5.Text.Trim(); + newDataInTemp.Value6 = this.txtValue6.Text.Trim(); + newDataInTemp.Value7 = this.txtValue7.Text.Trim(); + newDataInTemp.Value8 = this.txtValue8.Text.Trim(); + if (!string.IsNullOrEmpty(this.TempId)) + { + newDataInTemp.TempId = this.TempId; + newDataInTemp.ToopValue = null; + BLL.Sys_CQMS_DataInTempService.UpdateDataInTemp(newDataInTemp); + } + } + ShowNotify("信息修改完成!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataInNewEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataInNewEdit.aspx.designer.cs new file mode 100644 index 00000000..c8269ddf --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataInNewEdit.aspx.designer.cs @@ -0,0 +1,161 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Comprehensive +{ + + + public partial class TrainingRecordsDataInNewEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// txtValue1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue1; + + /// + /// txtValue2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue2; + + /// + /// txtValue3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue3; + + /// + /// txtValue4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue4; + + /// + /// txtValue5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue5; + + /// + /// txtValue6 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue6; + + /// + /// txtValue7 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue7; + + /// + /// txtValue8 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue8; + + /// + /// ckAll 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.CheckBox ckAll; + + /// + /// lbErrCout 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea lbErrCout; + } +} diff --git a/SGGL/FineUIPro.Web/File/Excel/DataIn/设计交底管理导入模板.xls b/SGGL/FineUIPro.Web/File/Excel/DataIn/设计交底管理导入模板.xls index aeebee8b..1dde0100 100644 Binary files a/SGGL/FineUIPro.Web/File/Excel/DataIn/设计交底管理导入模板.xls and b/SGGL/FineUIPro.Web/File/Excel/DataIn/设计交底管理导入模板.xls differ diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 31d695a8..cf00c480 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -447,6 +447,8 @@ + + @@ -458,22 +460,32 @@ + + + + + + + + + + @@ -495,9 +507,13 @@ + + + + @@ -509,24 +525,36 @@ + + + + + + + + + + + + @@ -1460,6 +1488,7 @@ + @@ -7493,6 +7522,20 @@ ConTechnologyDisclosureDataIn.aspx + + ConTechnologyDisclosureDataInNew.aspx + ASPXCodeBehind + + + ConTechnologyDisclosureDataInNew.aspx + + + ConTechnologyDisclosureDataInNewEdit.aspx + ASPXCodeBehind + + + ConTechnologyDisclosureDataInNewEdit.aspx + ConTechnologyDisclosureEdit.aspx ASPXCodeBehind @@ -7570,6 +7613,20 @@ DataReceivingDocDataIn.aspx + + DataReceivingDocDataInNew.aspx + ASPXCodeBehind + + + DataReceivingDocDataInNew.aspx + + + DataReceivingDocDataInNewEdit.aspx + ASPXCodeBehind + + + DataReceivingDocDataInNewEdit.aspx + DataReceivingDocEdit.aspx ASPXCodeBehind @@ -7605,6 +7662,20 @@ DesignChangeOrderDataIn.aspx + + DesignChangeOrderDataInNew.aspx + ASPXCodeBehind + + + DesignChangeOrderDataInNew.aspx + + + DesignChangeOrderDataInNewEdit.aspx + ASPXCodeBehind + + + DesignChangeOrderDataInNewEdit.aspx + DesignChangeOrderEdit.aspx ASPXCodeBehind @@ -7633,6 +7704,20 @@ DesignDetailsDataIn.aspx + + DesignDetailsDataInNew.aspx + ASPXCodeBehind + + + DesignDetailsDataInNew.aspx + + + DesignDetailsDataInNewEdit.aspx + ASPXCodeBehind + + + DesignDetailsDataInNewEdit.aspx + DesignDetailsEdit.aspx ASPXCodeBehind @@ -7661,6 +7746,20 @@ DesignDrawingsDataIn.aspx + + DesignDrawingsDataInNew.aspx + ASPXCodeBehind + + + DesignDrawingsDataInNew.aspx + + + DesignDrawingsDataInNewEdit.aspx + ASPXCodeBehind + + + DesignDrawingsDataInNewEdit.aspx + DesignDrawingsEdit.aspx ASPXCodeBehind @@ -7682,6 +7781,20 @@ GeneralPlanApprovalDataIn.aspx + + GeneralPlanApprovalDataInNew.aspx + ASPXCodeBehind + + + GeneralPlanApprovalDataInNew.aspx + + + GeneralPlanApprovalDataInNewEdit.aspx + ASPXCodeBehind + + + GeneralPlanApprovalDataInNewEdit.aspx + GeneralPlanApprovalEdit.aspx ASPXCodeBehind @@ -7829,6 +7942,20 @@ InspectionTestPlanDataIn.aspx + + InspectionTestPlanDataInNew.aspx + ASPXCodeBehind + + + InspectionTestPlanDataInNew.aspx + + + InspectionTestPlanDataInNewEdit.aspx + ASPXCodeBehind + + + InspectionTestPlanDataInNewEdit.aspx + InspectionTestPlanEdit.aspx ASPXCodeBehind @@ -7850,6 +7977,20 @@ MajorPlanApprovalDataIn.aspx + + MajorPlanApprovalDataInNew.aspx + ASPXCodeBehind + + + MajorPlanApprovalDataInNew.aspx + + + MajorPlanApprovalDataInNewEdit.aspx + ASPXCodeBehind + + + MajorPlanApprovalDataInNewEdit.aspx + MajorPlanApprovalEdit.aspx ASPXCodeBehind @@ -7927,6 +8068,20 @@ PressurePipeDataIn.aspx + + PressurePipeDataInNew.aspx + ASPXCodeBehind + + + PressurePipeDataInNew.aspx + + + PressurePipeDataInNewEdit.aspx + ASPXCodeBehind + + + PressurePipeDataInNewEdit.aspx + PressurePipeEdit.aspx ASPXCodeBehind @@ -7955,6 +8110,20 @@ QualityAccidentDataIn.aspx + + QualityAccidentDataInNew.aspx + ASPXCodeBehind + + + QualityAccidentDataInNew.aspx + + + QualityAccidentDataInNewEdit.aspx + ASPXCodeBehind + + + QualityAccidentDataInNewEdit.aspx + QualityAccidentEdit.aspx ASPXCodeBehind @@ -7976,6 +8145,20 @@ ReviewDrawingsDataIn.aspx + + ReviewDrawingsDataInNew.aspx + ASPXCodeBehind + + + ReviewDrawingsDataInNew.aspx + + + ReviewDrawingsDataInNewEdit.aspx + ASPXCodeBehind + + + ReviewDrawingsDataInNewEdit.aspx + ReviewDrawingsEdit.aspx ASPXCodeBehind @@ -8004,6 +8187,20 @@ SiteVisaManagementDataIn.aspx + + SiteVisaManagementDataInNew.aspx + ASPXCodeBehind + + + SiteVisaManagementDataInNew.aspx + + + SiteVisaManagementDataInNewEdit.aspx + ASPXCodeBehind + + + SiteVisaManagementDataInNewEdit.aspx + SiteVisaManagementEdit.aspx ASPXCodeBehind @@ -8032,6 +8229,20 @@ SpecialEquipmentDataIn.aspx + + SpecialEquipmentDataInNew.aspx + ASPXCodeBehind + + + SpecialEquipmentDataInNew.aspx + + + SpecialEquipmentDataInNewEdit.aspx + ASPXCodeBehind + + + SpecialEquipmentDataInNewEdit.aspx + SpecialEquipmentEdit.aspx ASPXCodeBehind @@ -8053,6 +8264,20 @@ TrainingRecordsDataIn.aspx + + TrainingRecordsDataInNew.aspx + ASPXCodeBehind + + + TrainingRecordsDataInNew.aspx + + + TrainingRecordsDataInNewEdit.aspx + ASPXCodeBehind + + + TrainingRecordsDataInNewEdit.aspx + TrainingRecordsEdit.aspx ASPXCodeBehind @@ -14286,6 +14511,13 @@ QuantityCompletion.aspx + + QuantityCompletionChart.aspx + ASPXCodeBehind + + + QuantityCompletionChart.aspx + QuantityCompletionEdit.aspx ASPXCodeBehind @@ -19465,7 +19697,7 @@ - +