diff --git a/DataBase/版本日志/SGGLDB_WH_2024-04-23-bwj.sql b/DataBase/版本日志/SGGLDB_WH_2024-04-23-bwj.sql new file mode 100644 index 00000000..226ed803 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_WH_2024-04-23-bwj.sql @@ -0,0 +1,12 @@ +alter table Comprehensive_TrainingRecords add RemarkCode nvarchar(50) +alter table Comprehensive_SiteVisaManagement add RemarkCode nvarchar(50) +alter table Comprehensive_DesignDetails add RemarCode nvarchar(50) +alter table Inspection_Test_Plan add RemarkCode nvarchar(50) +alter table Comprehensive_ReviewDrawings add RemarkCode nvarchar(50) +alter table Comprehensive_GeneralPlanApproval add RemarkCode nvarchar(50) +alter table Comprehensive_MajorPlanApproval add RemarkCode nvarchar(50) +alter table Comprehensive_SpecialEquipment add RemarkCode nvarchar(50) +alter table Comprehensive_PressurePipe add RemarkCode nvarchar(50) +alter table Comprehensive_QualityAccident add RemarkCode nvarchar(50) +go + diff --git a/SGGL/BLL/CQMS/Comprehensive/DesignDetailsService.cs b/SGGL/BLL/CQMS/Comprehensive/DesignDetailsService.cs index 0e5ef697..bbb685b6 100644 --- a/SGGL/BLL/CQMS/Comprehensive/DesignDetailsService.cs +++ b/SGGL/BLL/CQMS/Comprehensive/DesignDetailsService.cs @@ -141,6 +141,7 @@ namespace BLL newDesignDetails.Status = designDetails.Status; newDesignDetails.AuditMan = designDetails.AuditMan; newDesignDetails.JoinPersonNum = designDetails.JoinPersonNum; + newDesignDetails.RemarCode = designDetails.RemarCode; db.Comprehensive_DesignDetails.InsertOnSubmit(newDesignDetails); db.SubmitChanges(); diff --git a/SGGL/BLL/CQMS/Comprehensive/GeneralPlanApprovalService.cs b/SGGL/BLL/CQMS/Comprehensive/GeneralPlanApprovalService.cs index 42c58e2e..649bb780 100644 --- a/SGGL/BLL/CQMS/Comprehensive/GeneralPlanApprovalService.cs +++ b/SGGL/BLL/CQMS/Comprehensive/GeneralPlanApprovalService.cs @@ -117,6 +117,7 @@ namespace BLL newGeneralPlanApproval.CompileMan = generalPlanApproval.CompileMan; newGeneralPlanApproval.CompileDate = generalPlanApproval.CompileDate; newGeneralPlanApproval.UnitWorkId = generalPlanApproval.UnitWorkId; + newGeneralPlanApproval.RemarkCode = generalPlanApproval.RemarkCode; db.Comprehensive_GeneralPlanApproval.InsertOnSubmit(newGeneralPlanApproval); db.SubmitChanges(); } diff --git a/SGGL/BLL/CQMS/Comprehensive/SiteVisaManagementService.cs b/SGGL/BLL/CQMS/Comprehensive/SiteVisaManagementService.cs index e30fe577..caf2ce27 100644 --- a/SGGL/BLL/CQMS/Comprehensive/SiteVisaManagementService.cs +++ b/SGGL/BLL/CQMS/Comprehensive/SiteVisaManagementService.cs @@ -135,6 +135,7 @@ namespace BLL newSiteVisaManagement.AuditMan = siteVisaMangement.AuditMan; newSiteVisaManagement.Remark = siteVisaMangement.Remark; newSiteVisaManagement.Status = siteVisaMangement.Status; + newSiteVisaManagement.RemarkCode = siteVisaMangement.RemarkCode; db.Comprehensive_SiteVisaManagement.InsertOnSubmit(newSiteVisaManagement); db.SubmitChanges(); } diff --git a/SGGL/BLL/CQMS/Comprehensive/TrainingRecordsService.cs b/SGGL/BLL/CQMS/Comprehensive/TrainingRecordsService.cs index 5131de34..1a13a283 100644 --- a/SGGL/BLL/CQMS/Comprehensive/TrainingRecordsService.cs +++ b/SGGL/BLL/CQMS/Comprehensive/TrainingRecordsService.cs @@ -48,7 +48,8 @@ namespace BLL TrainingAddress = trainingRecords.TrainingAddress, Hours = trainingRecords.Hours, KeynoteSpeaker = trainingRecords.KeynoteSpeaker, - Remark = trainingRecords.Remark + Remark = trainingRecords.Remark, + RemarkCode = trainingRecords.RemarkCode }; Funs.DB.Comprehensive_TrainingRecords.InsertOnSubmit(newTraining); Funs.DB.SubmitChanges(); diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index 69a4d707..d6385fae 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -3249,12 +3249,32 @@ namespace BLL /// /// 培训记录导入模板原始虚拟路径 /// - public const string CQMS_TrainingRecordsTemplateUrl= "File\\Excel\\DataIn\\培训记录导入模板.xlsx"; + public const string CQMS_TrainingRecordsTemplateUrl= "File\\Excel\\DataIn\\培训记录导入模板.xls"; /// /// 质量专项检查模板文件原始虚拟路径 /// public const string JointCheckTempUrl = "File\\Excel\\CQMS\\质量专项检查模版.xlsx"; + + /// + /// 设计交底导入模板文件原始虚拟路径 + /// + public const string DesignDetailsTemplateUrl = "File\\Excel\\DataIn\\设计交底导入模板.xls"; + + /// + /// 图纸会审记录导入模板文件原始虚拟路径 + /// + public const string ReviewDrawingsTemplateUrl = "File\\Excel\\DataIn\\图纸会审记录导入模板.xls"; + + /// + /// 检验试验计划导入模板文件原始虚拟路径 + /// + public const string InspectionTestPlanTemplateUrl = "File\\Excel\\DataIn\\检验试验计划导入模板.xls"; + + /// + /// 施工组织设计及施工方案导入模板文件原始虚拟路径 + /// + public const string GeneralPlanApprovalTemplateUrl = "File\\Excel\\DataIn\\施工组织设计及施工方案导入模板.xls"; #endregion #region 绩效考核模板文件路径 diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/DataReceivingDocDataIn.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/DataReceivingDocDataIn.aspx.cs index bf26116c..3f9394bb 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/DataReceivingDocDataIn.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/DataReceivingDocDataIn.aspx.cs @@ -292,9 +292,12 @@ namespace FineUIPro.Web.CQMS.Comprehensive } string row12 = pds.Rows[i][12].ToString().Trim(); - if (row12 != "是" && row12 != "否") + if (!string.IsNullOrEmpty(row12)) { - result += (i + 2).ToString() + "," + "是否需回复" + "," + "错误!" + "|"; + if (row12 != "是" && row12 != "否") + { + result += (i + 2).ToString() + "," + "是否需回复" + "," + "错误!" + "|"; + } } string row13 = pds.Rows[i][13].ToString().Trim(); @@ -602,7 +605,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive { string rootPath = Server.MapPath("~/"); string uploadfilepath = rootPath + Const.CQMS_DataReceivingDocTempUrl; - string filePath = Const.NCRManagementDataInUrl; + string filePath = Const.CQMS_DataReceivingDocTempUrl; string fileName = Path.GetFileName(filePath); FileInfo info = new FileInfo(uploadfilepath); long fileSize = info.Length; diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/DesignDetails.aspx b/SGGL/FineUIPro.Web/CQMS/Comprehensive/DesignDetails.aspx index ba23f186..57482e4c 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/DesignDetails.aspx +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/DesignDetails.aspx @@ -26,6 +26,8 @@ + @@ -92,6 +94,10 @@ + + @@ -98,6 +100,10 @@ Target="Parent" EnableResize="false" runat="server" IsModal="true" OnClose="Window1_Close" Width="900px" Height="460px"> + diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawings.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawings.aspx.cs index 30c1fbc6..e2270f9f 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawings.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawings.aspx.cs @@ -92,7 +92,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive } if (buttonList.Contains(BLL.Const.BtnSave)) { - //this.btnImport.Hidden = false; + this.btnImport.Hidden = false; } } } @@ -311,5 +311,19 @@ namespace FineUIPro.Web.CQMS.Comprehensive return "编制"; } + + + + #region 导入 + /// + /// 导入按钮 + /// + /// + /// + protected void btnImport_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("ReviewDrawingsDataIn.aspx", "导入 - "))); + } + #endregion } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawings.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawings.aspx.designer.cs index 27acdd82..9aef1198 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawings.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawings.aspx.designer.cs @@ -7,13 +7,11 @@ // //------------------------------------------------------------------------------ -namespace FineUIPro.Web.CQMS.Comprehensive -{ - - - public partial class ReviewDrawings - { - +namespace FineUIPro.Web.CQMS.Comprehensive { + + + public partial class ReviewDrawings { + /// /// form1 控件。 /// @@ -22,7 +20,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// PageManager1 控件。 /// @@ -31,7 +29,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.PageManager PageManager1; - + /// /// Panel1 控件。 /// @@ -40,7 +38,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel Panel1; - + /// /// Grid1 控件。 /// @@ -49,7 +47,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Grid Grid1; - + /// /// ToolSearch 控件。 /// @@ -58,7 +56,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar ToolSearch; - + /// /// sdrpCNProfessionalId 控件。 /// @@ -67,7 +65,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList sdrpCNProfessionalId; - + /// /// txtDraCode 控件。 /// @@ -76,7 +74,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtDraCode; - + /// /// btnSearch 控件。 /// @@ -85,7 +83,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnSearch; - + /// /// btnNew 控件。 /// @@ -94,7 +92,16 @@ namespace FineUIPro.Web.CQMS.Comprehensive /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnNew; - + + /// + /// btnImport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnImport; + /// /// lblPageIndex 控件。 /// @@ -103,7 +110,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Label lblPageIndex; - + /// /// Label2 控件。 /// @@ -112,7 +119,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Label Label2; - + /// /// Label3 控件。 /// @@ -121,7 +128,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Label Label3; - + /// /// txtStatus 控件。 /// @@ -130,7 +137,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Label txtStatus; - + /// /// lbtnFileUrl 控件。 /// @@ -139,7 +146,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.LinkButton lbtnFileUrl; - + /// /// ToolbarText1 控件。 /// @@ -148,7 +155,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarText ToolbarText1; - + /// /// ddlPageSize 控件。 /// @@ -157,7 +164,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList ddlPageSize; - + /// /// Window1 控件。 /// @@ -166,7 +173,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window Window1; - + /// /// Window2 控件。 /// @@ -175,7 +182,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window Window2; - + /// /// WindowAtt 控件。 /// @@ -184,7 +191,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window WindowAtt; - + /// /// Menu1 控件。 /// @@ -193,7 +200,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Menu Menu1; - + /// /// btnMenuModify 控件。 /// @@ -202,7 +209,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.MenuButton btnMenuModify; - + /// /// btnMenuDel 控件。 /// diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataIn.aspx b/SGGL/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataIn.aspx new file mode 100644 index 00000000..ed085e02 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataIn.aspx @@ -0,0 +1,68 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ReviewDrawingsDataIn.aspx.cs" Inherits="FineUIPro.Web.CQMS.Comprehensive.ReviewDrawingsDataIn" %> + + + + + + + 导入图纸会审记录 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataIn.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataIn.aspx.cs new file mode 100644 index 00000000..3ff71672 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataIn.aspx.cs @@ -0,0 +1,483 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.OleDb; +using System.IO; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CQMS.Comprehensive +{ + public partial class ReviewDrawingsDataIn : PageBase + { + #region 定义变量 + /// + /// 上传预设的虚拟路径 + /// + private string initPath = Const.ExcelUrl; + + + /// + /// 错误集合 + /// + public static List errorInfos = new List(); + #endregion + + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.hdCheckResult.Text = string.Empty; + this.hdFileName.Text = string.Empty; + if (errorInfos != null) + { + errorInfos.Clear(); + } + } + } + #endregion + + #region 审核 + /// + /// 审核 + /// + /// + /// + protected void btnAudit_Click(object sender, EventArgs e) + { + try + { + if (this.fuAttachUrl.HasFile == false) + { + ShowNotify("请您选择Excel文件!", MessageBoxIcon.Warning); + return; + } + string IsXls = Path.GetExtension(this.fuAttachUrl.FileName).ToString().Trim().ToLower(); + if (IsXls != ".xls") + { + ShowNotify("只可以选择Excel文件!", MessageBoxIcon.Warning); + return; + } + if (errorInfos != null) + { + errorInfos.Clear(); + } + string rootPath = Server.MapPath("~/"); + string initFullPath = rootPath + initPath; + if (!Directory.Exists(initFullPath)) + { + Directory.CreateDirectory(initFullPath); + } + + this.hdFileName.Text = BLL.Funs.GetNewFileName() + IsXls; + string filePath = initFullPath + this.hdFileName.Text; + this.fuAttachUrl.PostedFile.SaveAs(filePath); + ImportXlsToData(rootPath + initPath + this.hdFileName.Text); + } + catch (Exception ex) + { + ShowNotify("'" + ex.Message + "'", MessageBoxIcon.Warning); + } + } + + #region 读Excel提取数据 + /// + /// 从Excel提取数据--》Dataset + /// + /// Excel文件路径名 + private void ImportXlsToData(string fileName) + { + try + { + string oleDBConnString = String.Empty; + oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;"; + oleDBConnString += "Data Source="; + oleDBConnString += fileName; + oleDBConnString += ";Extended Properties=Excel 8.0;"; + OleDbConnection oleDBConn = null; + OleDbDataAdapter oleAdMaster = null; + DataTable m_tableName = new DataTable(); + DataSet ds = new DataSet(); + + oleDBConn = new OleDbConnection(oleDBConnString); + oleDBConn.Open(); + m_tableName = oleDBConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null); + + if (m_tableName != null && m_tableName.Rows.Count > 0) + { + + m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim(); + + } + string sqlMaster; + sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]"; + oleAdMaster = new OleDbDataAdapter(sqlMaster, oleDBConn); + oleAdMaster.Fill(ds, "m_tableName"); + oleAdMaster.Dispose(); + oleDBConn.Close(); + oleDBConn.Dispose(); + + AddDatasetToSQL(ds.Tables[0], 7); + hdCheckResult.Text = "1"; + } + catch (Exception exc) + { + Response.Write(exc); + //return null; + // return dt; + } + finally + { + } + } + #endregion + + #region 将Dataset的数据导入数据库 + /// + /// 将Dataset的数据导入数据库 + /// + /// 数据集 + /// 数据集行数 + /// + private bool AddDatasetToSQL(DataTable pds, int Cols) + { + string result = string.Empty; + int ic, ir; + ic = pds.Columns.Count; + if (ic < Cols) + { + ShowNotify("导入Excel格式错误!Excel只有" + ic.ToString().Trim() + "列", MessageBoxIcon.Warning); + return false; + } + + ir = pds.Rows.Count; + if (pds != null && ir > 0) + { + var oldViewInfos = from x in Funs.DB.Comprehensive_ReviewDrawings + 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 + select x; + + for (int i = 0; i < ir; i++) + { + string row0 = pds.Rows[i][0].ToString(); + if (string.IsNullOrEmpty(row0)) + { + result += (i + 2).ToString() + "," + "专业名称" + "," + "此项为必填项!" + "|"; + } + else + { + var cn = cns.Where(x => x.ProfessionalName == row0.Trim()).FirstOrDefault(); + if (cn == null) + { + result += (i + 2).ToString() + "," + "专业名称" + "," + "[" + row0 + "]不存在!" + "|"; + } + } + + string row1 = pds.Rows[i][1].ToString(); + if (string.IsNullOrEmpty(row1)) + { + result += (i + 2).ToString() + "," + "编号" + "," + "此项为必填项!" + "|"; + } + + string row2 = pds.Rows[i][2].ToString(); + if (!string.IsNullOrEmpty(row2)) + { + string[] reunit = row2.Split(','); + foreach (string unitWork in reunit) + { + var u = unitWorks.Where(x => x.UnitWorkName == unitWork.Trim()).FirstOrDefault(); + if (u == null) + { + result += (i + 2).ToString() + "," + "单位工程名称" + "," + "[" + unitWork.Trim() + "]不存在!" + "|"; + } + } + } + + string row3 = pds.Rows[i][3].ToString(); + if (!string.IsNullOrEmpty(row3)) + { + try + { + DateTime date = Convert.ToDateTime(row3.Trim()); + } + catch (Exception) + { + result += (i + 2).ToString() + "," + "图纸会审日期" + "," + "[" + row3 + "]错误!" + "|"; + } + } + else + { + result += (i + 2).ToString() + "," + "图纸会审日期" + "," + "此项为必填项!" + "|"; + } + + string row4 = pds.Rows[i][4].ToString(); + if (!string.IsNullOrEmpty(row4)) + { + string[] reunit = row4.Split(','); + foreach (string unit in reunit) + { + var u = units.Where(x => x.UnitName == unit.Trim()).FirstOrDefault(); + if (u == null) + { + result += (i + 2).ToString() + "," + "参加单位" + "," + "[" + unit.Trim() + "]不存在!" + "|"; + } + } + } + + string row6 = pds.Rows[i][6].ToString(); + if (string.IsNullOrEmpty(row6)) + { + result += (i + 2).ToString() + "," + "标志编号" + "," + "此项为必填项!" + "|"; + } + } + if (!string.IsNullOrEmpty(result)) + { + result = result.Substring(0, result.LastIndexOf("|")); + } + errorInfos.Clear(); + if (!string.IsNullOrEmpty(result)) + { + string results = result; + List errorInfoList = results.Split('|').ToList(); + foreach (var item in errorInfoList) + { + string[] errors = item.Split(','); + Model.ErrorInfo errorInfo = new Model.ErrorInfo(); + errorInfo.Row = errors[0]; + errorInfo.Column = errors[1]; + errorInfo.Reason = errors[2]; + errorInfos.Add(errorInfo); + } + if (errorInfos.Count > 0) + { + this.gvErrorInfo.DataSource = errorInfos; + this.gvErrorInfo.DataBind(); + } + } + else + { + ShowNotify("审核完成,请点击导入!", MessageBoxIcon.Success); + } + } + else + { + ShowNotify("导入数据为空!", MessageBoxIcon.Warning); + } + return true; + } + #endregion + #endregion + + #region 导入 + /// + /// 导入 + /// + /// + /// + protected void btnImport_Click(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(hdCheckResult.Text)) + { + if (errorInfos.Count <= 0) + { + string rootPath = Server.MapPath("~/"); + ImportXlsToData2(rootPath + initPath + this.hdFileName.Text); + hdCheckResult.Text = string.Empty; + ShowNotify("导入成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + else + { + ShowNotify("请先将错误数据修正,再重新导入提交!", MessageBoxIcon.Warning); + } + } + else + { + ShowNotify("请先审核要导入的文件!", MessageBoxIcon.Warning); + } + } + + #region Excel提取数据 + /// + /// 从Excel提取数据--》Dataset + /// + /// Excel文件路径名 + private void ImportXlsToData2(string fileName) + { + try + { + string oleDBConnString = String.Empty; + oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;"; + oleDBConnString += "Data Source="; + oleDBConnString += fileName; + oleDBConnString += ";Extended Properties=Excel 8.0;"; + OleDbConnection oleDBConn = null; + OleDbDataAdapter oleAdMaster = null; + DataTable m_tableName = new DataTable(); + DataSet ds = new DataSet(); + + oleDBConn = new OleDbConnection(oleDBConnString); + oleDBConn.Open(); + m_tableName = oleDBConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null); + + if (m_tableName != null && m_tableName.Rows.Count > 0) + { + + m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim(); + + } + string sqlMaster; + sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]"; + oleAdMaster = new OleDbDataAdapter(sqlMaster, oleDBConn); + oleAdMaster.Fill(ds, "m_tableName"); + oleAdMaster.Dispose(); + oleDBConn.Close(); + oleDBConn.Dispose(); + + AddDatasetToSQL2(ds.Tables[0], 7); + } + catch (Exception ex) + { + throw ex; + } + } + #endregion + + #region 将Dataset的数据导入数据库 + /// + /// 将Dataset的数据导入数据库 + /// + /// 数据集 + /// 数据集列数 + /// + private bool AddDatasetToSQL2(DataTable pds, int Cols) + { + int ic, ir; + ic = pds.Columns.Count; + if (ic < Cols) + { + ShowNotify("导入Excel格式错误!Excel只有" + ic.ToString().Trim() + "列", MessageBoxIcon.Warning); + } + string result = string.Empty; + ir = pds.Rows.Count; + if (pds != null && ir > 0) + { + var oldViewInfos = from x in Funs.DB.Comprehensive_ReviewDrawings + 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 + select x; + + for (int i = 0; i < ir; i++) + { + Model.Comprehensive_ReviewDrawings oldViewInfo = new Model.Comprehensive_ReviewDrawings(); + string row0 = pds.Rows[i][0].ToString().Trim(); + var cn = cns.Where(y => y.ProfessionalName == row0).FirstOrDefault(); + oldViewInfo = oldViewInfos.Where(x => x.RemarkCode == pds.Rows[i][6].ToString().Trim() + ).FirstOrDefault(); + if (oldViewInfo == null) + { + Model.Comprehensive_ReviewDrawings des = new Model.Comprehensive_ReviewDrawings(); + des.Id = SQLHelper.GetNewID(typeof(Model.Comprehensive_ReviewDrawings)); + des.ProjectId = this.CurrUser.LoginProjectId; + des.CNProfessionalId = cn.CNProfessionalId; + des.DraCode = pds.Rows[i][1].ToString().Trim(); + if (!string.IsNullOrEmpty(pds.Rows[i][2].ToString().Trim())) + { + des.UnitWorkId = BLL.UnitWorkService.GetUnitWorkIdsByUnitWorkNames(this.CurrUser.LoginProjectId, pds.Rows[i][2].ToString().Trim()); + } + if (!string.IsNullOrEmpty(pds.Rows[i][3].ToString().Trim())) + { + des.ReviewDate = Convert.ToDateTime(pds.Rows[i][3].ToString().Trim()); + } + if (!string.IsNullOrEmpty(pds.Rows[i][4].ToString().Trim())) + { + des.ReceiveUnits = BLL.UnitService.GetUnitIds(pds.Rows[i][4].ToString().Trim()); + } + des.Remarks = pds.Rows[i][5].ToString().Trim(); + des.RemarkCode = pds.Rows[i][6].ToString().Trim(); + des.CreateMan = this.CurrUser.UserId; + des.CreateDate = DateTime.Now; + des.Status = BLL.Const.Comprehensive_Compile; + BLL.ReviewDrawingsService.Insert(des); + } + } + } + else + { + ShowNotify("导入数据为空!", MessageBoxIcon.Warning); + } + return true; + } + #endregion + #endregion + + #region 下载模板 + /// + /// 下载模板按钮 + /// + /// + /// + protected void btnDownLoad_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Confirm.GetShowReference("确定下载导入模板吗?", String.Empty, MessageBoxIcon.Question, PageManager1.GetCustomEventReference(false, "Confirm_OK"), PageManager1.GetCustomEventReference("Confirm_Cancel"))); + } + + /// + /// 下载导入模板 + /// + /// + /// + protected void PageManager1_CustomEvent(object sender, CustomEventArgs e) + { + if (e.EventArgument == "Confirm_OK") + { + string rootPath = Server.MapPath("~/"); + string uploadfilepath = rootPath + Const.ReviewDrawingsTemplateUrl; + string filePath = Const.ReviewDrawingsTemplateUrl; + 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 + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataIn.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataIn.aspx.designer.cs new file mode 100644 index 00000000..12a7755c --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataIn.aspx.designer.cs @@ -0,0 +1,123 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Comprehensive { + + + public partial class ReviewDrawingsDataIn { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// hdFileName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdFileName; + + /// + /// btnAudit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAudit; + + /// + /// btnImport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnImport; + + /// + /// btnDownLoad 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnDownLoad; + + /// + /// hdCheckResult 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdCheckResult; + + /// + /// fuAttachUrl 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FileUpload fuAttachUrl; + + /// + /// gvErrorInfo 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid gvErrorInfo; + + /// + /// lblPageIndex 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblPageIndex; + } +} diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/SiteVisaManagementDataIn.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/SiteVisaManagementDataIn.aspx.cs index b9f2e362..ad609dc3 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/SiteVisaManagementDataIn.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/SiteVisaManagementDataIn.aspx.cs @@ -126,7 +126,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive oleDBConn.Close(); oleDBConn.Dispose(); - AddDatasetToSQL(ds.Tables[0], 10); + AddDatasetToSQL(ds.Tables[0], 11); hdCheckResult.Text = "1"; } catch (Exception exc) @@ -166,7 +166,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive join y in Funs.DB.Project_ProjectUnit on x.UnitId equals y.UnitId where y.ProjectId == this.CurrUser.LoginProjectId && (y.UnitType == Const.ProjectUnitType_1 || y.UnitType == Const.ProjectUnitType_2) select x; - var ins = from x in Funs.DB.WBS_UnitWork where x.ProjectId == this.CurrUser.LoginProjectId select x; + var ins = from x in Funs.DB.WBS_UnitWork where x.ProjectId == this.CurrUser.LoginProjectId && x.SuperUnitWork == null orderby x.UnitWorkCode select x; var cns = from x in Funs.DB.Base_CNProfessional select x; for (int i = 0; i < ir; i++) @@ -212,7 +212,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive var in1 = ins.Where(x => x.UnitWorkName == row4.Trim()).FirstOrDefault(); if (in1 == null) { - result += (i + 2).ToString() + "," + "装置" + "," + "[" + row4 + "]不存在!" + "|"; + result += (i + 2).ToString() + "," + "单位工程" + "," + "[" + row4 + "]不存在!" + "|"; } } @@ -238,6 +238,12 @@ namespace FineUIPro.Web.CQMS.Comprehensive result += (i + 2).ToString() + "," + "签证时间" + "," + "[" + row6 + "]错误!" + "|"; } } + + string row10 = pds.Rows[i][10].ToString(); + if (string.IsNullOrEmpty(row10)) + { + result += (i + 2).ToString() + "," + "标志编号" + "," + "此项为必填项!" + "|"; + } } if (!string.IsNullOrEmpty(result)) { @@ -343,7 +349,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive oleDBConn.Close(); oleDBConn.Dispose(); - AddDatasetToSQL2(ds.Tables[0], 4); + AddDatasetToSQL2(ds.Tables[0], 11); } catch (Exception ex) { @@ -377,13 +383,13 @@ namespace FineUIPro.Web.CQMS.Comprehensive select x; var cns = from x in Funs.DB.Base_CNProfessional select x; - var installations = from x in Funs.DB.WBS_UnitWork where x.ProjectId == this.CurrUser.LoginProjectId select x; + var ins = from x in Funs.DB.WBS_UnitWork where x.ProjectId == this.CurrUser.LoginProjectId && x.SuperUnitWork == null select x; var oldViewInfos = from x in Funs.DB.Comprehensive_SiteVisaManagement where x.ProjectId == this.CurrUser.LoginProjectId select x; for (int i = 0; i < ir; i++) { - var oldViewInfo = oldViewInfos.Where(x => x.VisaCode == pds.Rows[i][1].ToString().Trim()).FirstOrDefault(); + var oldViewInfo = oldViewInfos.Where(x => x.RemarkCode == pds.Rows[i][10].ToString().Trim()).FirstOrDefault(); if (oldViewInfo == null) { Model.Comprehensive_SiteVisaManagement Ins = new Model.Comprehensive_SiteVisaManagement(); @@ -397,7 +403,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive Ins.ProcessingState = pds.Rows[i][3].ToString().Trim(); if (!string.IsNullOrEmpty(pds.Rows[i][4].ToString().Trim())) { - Ins.UnitWorkId = Funs.DB.WBS_UnitWork.First(e => e.UnitWorkName == pds.Rows[i][4].ToString().Trim()).UnitWorkId; + Ins.UnitWorkId = ins.FirstOrDefault(x => x.UnitWorkName == pds.Rows[i][4].ToString().Trim()).UnitWorkId; } if (!string.IsNullOrEmpty(pds.Rows[i][5].ToString().Trim())) { @@ -410,6 +416,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive Ins.SignMan = pds.Rows[i][7].ToString().Trim(); Ins.AuditMan = pds.Rows[i][8].ToString().Trim(); Ins.Remark = pds.Rows[i][9].ToString().Trim(); + Ins.RemarkCode = pds.Rows[i][10].ToString().Trim(); Ins.CompileMan = this.CurrUser.UserId; Ins.Status = BLL.Const.Comprehensive_Compile; Ins.VisaId = SQLHelper.GetNewID(); diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataIn.aspx b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataIn.aspx index b83bf5de..878e4edd 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataIn.aspx +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataIn.aspx @@ -6,162 +6,63 @@ 导入培训记录 - -
- - - + + - + - - - - - - - - + + + - + - - <%----%> - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataIn.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataIn.aspx.cs index eb107868..5c10af82 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataIn.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataIn.aspx.cs @@ -1,18 +1,17 @@ using BLL; -using Model; using System; using System.Collections.Generic; using System.Data; -using System.Data.SqlClient; +using System.Data.OleDb; using System.IO; using System.Linq; -using System.Threading; +using System.Web.UI.WebControls; namespace FineUIPro.Web.CQMS.Comprehensive { public partial class TrainingRecordsDataIn : PageBase { - #region 定义项 + #region 定义变量 /// /// 上传预设的虚拟路径 /// @@ -21,8 +20,7 @@ namespace FineUIPro.Web.CQMS.Comprehensive /// /// 错误集合 /// - public static string errorInfos = string.Empty; - + public static List errorInfos = new List(); #endregion #region 加载 @@ -35,486 +33,400 @@ namespace FineUIPro.Web.CQMS.Comprehensive { if (!IsPostBack) { - if (percent == null) + this.hdCheckResult.Text = string.Empty; + this.hdFileName.Text = string.Empty; + if (errorInfos != 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,Value21,Value22,Value23,Value24,Value25,Value26,Value27,Value28,Value29,Value30" - + @" ,Value31,Value32,Value33,Value34,Value35,Value36,Value37,Value38,Value39,Value40,Value41,Value42,Value43,Value44,Value45,Value46,Value47,Value48,Value49,Value50,ToopValue,Type" - + @" FROM Sys_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_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"; - } + errorInfos.Clear(); } } - var errData = from x in dataInTempAll where x.ToopValue != null select x; - this.lbDataCout.Text = errData.Count().ToString(); } #endregion - #region 双击事件 + #region 审核 /// - /// Grid行双击事件 + /// 审核 /// /// /// - protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) - { - if (Grid1.SelectedRowIndexArray.Length == 0) - { - Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); - return; - } - if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.TrainingRecordsMenuId, Const.BtnSave)) - { - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("TrainingRecordsDataInEdit.aspx?TempId={0}", Grid1.SelectedRowID, "维护 - "))); - } - else - { - ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); - } - } - #endregion - - #region 导入信息 维护 - /// - /// 导入信息编辑 - /// - /// - /// - protected void btnMenuEdit_Click(object sender, EventArgs e) - { - if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.TrainingRecordsMenuId, BLL.Const.BtnSave)) - { - if (Grid1.SelectedRowIndexArray.Length == 0) - { - Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); - return; - } - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("TrainingRecordsDataInEdit.aspx?TempId={0}", Grid1.SelectedRowID, "维护 - "))); - } - else - { - ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); - } - } - - /// - /// 删除按钮 - /// - /// - /// - protected void btnMenuDelete_Click(object sender, EventArgs e) - { - if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.TrainingRecordsMenuId, Const.BtnSave)) - { - 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_DataTempService.DeleteDataInTempByDataInTempID(rowID); - } - ShowNotify("删除成功!", MessageBoxIcon.Success); - this.BindGrid(); - } - else - { - Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); - return; - } - } - #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 btnAllDelete_Click(object sender, EventArgs e) - { - if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.TrainingRecordsMenuId, Const.BtnSave)) - { - //先删除临时表中 该人员以前导入的数据 - BLL.Sys_DataTempService.DeleteDataInTempByProjectIdUserId(this.CurrUser.LoginProjectId, this.CurrUser.UserId, "TrainingRecords"); - this.BindGrid(); - ShowNotify("删除成功!", MessageBoxIcon.Success); - this.lbDataCout.Text = string.Empty; - } - else - { - Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); - return; - } - } - #endregion - - #region 下载模板 - /// - /// 下载模板 - /// - /// - /// - protected void imgbtnUpload_Click(object sender, EventArgs e) - { - this.TemplateUpload(BLL.Const.CQMS_TrainingRecordsTemplateUrl); - } - - protected void TemplateUpload(string initTemplatePath) - { - string rootPath = Server.MapPath("~/"); - string uploadfilepath = rootPath + initTemplatePath; - 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(); - } - - /// - /// 导入说明 - /// - /// - /// - //protected void lkAchievements_Click(object sender, EventArgs e) - //{ - // this.TemplateUpload(Const.CQMS_DataReceivingDocTempUrl); - //} - #endregion - - #region 进度条 - 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]; - } - #endregion - - #region 文件上传 - /// - /// 文件上传 - /// - /// - /// - protected void imgbtnImport_Click(object sender, EventArgs e) + protected void btnAudit_Click(object sender, EventArgs e) { try { - if (this.FileExcel.HasFile == false) + if (this.fuAttachUrl.HasFile == false) { - ShowNotify("请选择Excel文件!", MessageBoxIcon.Warning); + ShowNotify("请您选择Excel文件!", MessageBoxIcon.Warning); return; } - string IsXls = Path.GetExtension(this.FileExcel.FileName).ToString().Trim().ToLower(); - if (IsXls != ".xls" && IsXls != ".xlsx") + string IsXls = Path.GetExtension(this.fuAttachUrl.FileName).ToString().Trim().ToLower(); + if (IsXls != ".xls") { - ShowNotify("只能选择Excel文件!", MessageBoxIcon.Warning); + ShowNotify("只可以选择Excel文件!", MessageBoxIcon.Warning); return; } + if (errorInfos != null) + { + errorInfos.Clear(); + } string rootPath = Server.MapPath("~/"); string initFullPath = rootPath + initPath; 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 + initPath + 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 = 0; i < ds.Tables[0].Rows.Count; i++) - { - Sys_DataInTemp newDataInTemp = new Sys_DataInTemp(); - newDataInTemp.TempId = SQLHelper.GetNewID(typeof(Model.Sys_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]["培训内容"].ToString().Trim(); - newDataInTemp.Value2 = ds.Tables[0].Rows[i]["专业"].ToString().Trim(); - newDataInTemp.Value3 = ds.Tables[0].Rows[i]["培训对象"].ToString().Trim(); - newDataInTemp.Value4 = ds.Tables[0].Rows[i]["培训地点"].ToString().Trim(); - newDataInTemp.Value5 = ds.Tables[0].Rows[i]["课时(小时)"].ToString().Trim(); - newDataInTemp.Value6 = ds.Tables[0].Rows[i]["主讲人"].ToString().Trim(); - newDataInTemp.Value7 = ds.Tables[0].Rows[i]["备注"].ToString().Trim(); - - BLL.Sys_DataTempService.AddDataInTemp(newDataInTemp); - } - this.BindGrid(); - ShowNotify("数据已导入临时表!", MessageBoxIcon.Success); - } - else - { - ShowNotify("无数据!", MessageBoxIcon.Warning); - return; - } + this.hdFileName.Text = BLL.Funs.GetNewFileName() + IsXls; + string filePath = initFullPath + this.hdFileName.Text; + this.fuAttachUrl.PostedFile.SaveAs(filePath); + ImportXlsToData(rootPath + initPath + this.hdFileName.Text); } catch (Exception ex) { - Alert.ShowInTop("'" + ex.Message + "'", MessageBoxIcon.Warning); + ShowNotify("'" + ex.Message + "'", MessageBoxIcon.Warning); + } + } + + #region 读Excel提取数据 + /// + /// 从Excel提取数据--》Dataset + /// + /// Excel文件路径名 + private void ImportXlsToData(string fileName) + { + try + { + string oleDBConnString = String.Empty; + oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;"; + oleDBConnString += "Data Source="; + oleDBConnString += fileName; + oleDBConnString += ";Extended Properties=Excel 8.0;"; + OleDbConnection oleDBConn = null; + OleDbDataAdapter oleAdMaster = null; + DataTable m_tableName = new DataTable(); + DataSet ds = new DataSet(); + + oleDBConn = new OleDbConnection(oleDBConnString); + oleDBConn.Open(); + m_tableName = oleDBConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null); + + if (m_tableName != null && m_tableName.Rows.Count > 0) + { + + m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim(); + + } + string sqlMaster; + sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]"; + oleAdMaster = new OleDbDataAdapter(sqlMaster, oleDBConn); + oleAdMaster.Fill(ds, "m_tableName"); + oleAdMaster.Dispose(); + oleDBConn.Close(); + oleDBConn.Dispose(); + + AddDatasetToSQL(ds.Tables[0], 8); + hdCheckResult.Text = "1"; + } + catch (Exception exc) + { + Response.Write(exc); + //return null; + // return dt; + } + finally + { } } #endregion - #region 保存审核事件 + #region 将Dataset的数据导入数据库 /// - /// 保存审核事件 + /// 将Dataset的数据导入数据库 /// - /// - /// - protected void btnSave_Click(object sender, EventArgs e) + /// 数据集 + /// 数据集行数 + /// + private bool AddDatasetToSQL(DataTable pds, int Cols) { - Thread t = new Thread(new ThreadStart(() => { btnSaveMethod(this.CurrUser.LoginProjectId, this.CurrUser.UserId); })); - t.Start(); - if (percent.ContainsKey(this.CurrUser.UserId)) + string result = string.Empty; + int ic, ir; + ic = pds.Columns.Count; + if (ic < Cols) { - percent[CurrUser.UserId] = 0; + ShowNotify("导入Excel格式错误!Excel只有" + ic.ToString().Trim() + "列", MessageBoxIcon.Warning); + return false; } - 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) - { - var cNProfessionals = from x in Funs.DB.Base_CNProfessional select x;//专业 - - var dataInTemp = from x in Funs.DB.Sys_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) + ir = pds.Rows.Count; + if (pds != null && ir > 0) { - if (tempData != null) + 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; + + for (int i = 0; i < ir; i++) { - i++; - percent[UserId] = (int)(100 * i / ir); - string errInfo = string.Empty; - var isExitValue = Funs.DB.Comprehensive_TrainingRecords.FirstOrDefault(x => x.ProjectId == this.CurrUser.LoginProjectId && x.TrainingContents == tempData.Value1 - && x.CNProfessionalId == tempData.Value2); - if (isExitValue == null || this.ckUpdate.Checked) + string row0 = pds.Rows[i][0].ToString(); + if (string.IsNullOrEmpty(row0)) { - Model.Comprehensive_TrainingRecords newData = new Model.Comprehensive_TrainingRecords(); - if (!string.IsNullOrEmpty(tempData.Value1.Trim())) - { - newData.TrainingContents = tempData.Value1.Trim(); - } - else - { - errInfo += "培训内容为必填项;"; - } + result += (i + 2).ToString() + "," + "培训内容" + "," + "此项为必填项!" + "|"; + } - if (!string.IsNullOrEmpty(tempData.Value2.Trim())) - { - var professional = cNProfessionals.FirstOrDefault(e => e.ProfessionalName == tempData.Value2.Trim()); - if (professional != null) - { - newData.CNProfessionalId = professional.CNProfessionalId; - } - else - { - errInfo += "专业不存在;"; - } - } - else - { - errInfo += "专业为必填项;"; - } - if (!string.IsNullOrEmpty(tempData.Value3.Trim())) - { - newData.TrainingObject = tempData.Value3.Trim(); - } - else - { - errInfo += "培训对象为必填项;"; - } - if (!string.IsNullOrEmpty(tempData.Value4.Trim())) - { - newData.TrainingAddress = tempData.Value4.Trim(); - } - else - { - errInfo += "培训地点为必填项;"; - } - if (!string.IsNullOrEmpty(tempData.Value5.Trim())) - { - try - { - newData.Hours = Funs.GetNewDecimal(tempData.Value5.Trim()); - } - catch (Exception) - { - errInfo += "课时(小时)格式错误;"; - } - } - if (!string.IsNullOrEmpty(tempData.Value6.Trim())) - { - newData.KeynoteSpeaker = tempData.Value6.Trim(); - } - if (!string.IsNullOrEmpty(tempData.Value7.Trim())) - { - newData.Remark = tempData.Value7.Trim(); - } - if (string.IsNullOrEmpty(errInfo)) ////所有信息正确的话 这插入管线焊口 - { - newData.ProjectId = this.CurrUser.LoginProjectId; - - var data = BLL.TrainingRecordsService.GetTrainingRecordsByName(newData.TrainingContents, newData.CNProfessionalId); - if (data == null) - { - newData.TrainingRecordsId = SQLHelper.GetNewID(typeof(Model.Comprehensive_TrainingRecords)); - BLL.TrainingRecordsService.AddTrainingRecords(newData); - } - else - { - newData.TrainingRecordsId = data.TrainingRecordsId; - BLL.TrainingRecordsService.UpdateTrainingRecords(newData); - } - - BLL.Sys_DataTempService.DeleteDataInTempByDataInTempID(tempData.TempId); - okCount++; - } + string row1 = pds.Rows[i][1].ToString(); + if (string.IsNullOrEmpty(row1)) + { + result += (i + 2).ToString() + "," + "专业名称" + "," + "此项为必填项!" + "|"; } else { - errInfo = "该条记录已存在于培训记录表中。"; + var cn = cns.Where(x => x.ProfessionalName == row1.Trim()).FirstOrDefault(); + if (cn == null) + { + result += (i + 2).ToString() + "," + "专业名称" + "," + "[" + row1 + "]不存在!" + "|"; + } } - if (!string.IsNullOrEmpty(errInfo)) + string row2 = pds.Rows[i][2].ToString(); + if (string.IsNullOrEmpty(row2)) { - tempData.ToopValue = errInfo; - BLL.Sys_DataTempService.UpdateDataInTemp(tempData); - erreMessage += errInfo + ";"; + result += (i + 2).ToString() + "," + "培训对象" + "," + "此项为必填项!" + "|"; + } + + string row3 = pds.Rows[i][3].ToString(); + if (string.IsNullOrEmpty(row3)) + { + result += (i + 2).ToString() + "," + "培训地点" + "," + "此项为必填项!" + "|"; + } + + string row4 = pds.Rows[i][4].ToString(); + if (!string.IsNullOrEmpty(row4)) + { + try + { + decimal d = Convert.ToDecimal(row4.Trim()); + } + catch (Exception) + { + result += (i + 2).ToString() + "," + "课时(小时)" + "," + "[" + row4 + "]错误!" + "|"; + } + } + + string row7 = pds.Rows[i][7].ToString(); + if (string.IsNullOrEmpty(row7)) + { + result += (i + 2).ToString() + "," + "标志编号" + "," + "此项为必填项!" + "|"; } } + if (!string.IsNullOrEmpty(result)) + { + result = result.Substring(0, result.LastIndexOf("|")); + } + errorInfos.Clear(); + if (!string.IsNullOrEmpty(result)) + { + string results = result; + List errorInfoList = results.Split('|').ToList(); + foreach (var item in errorInfoList) + { + string[] errors = item.Split(','); + Model.ErrorInfo errorInfo = new Model.ErrorInfo(); + errorInfo.Row = errors[0]; + errorInfo.Column = errors[1]; + errorInfo.Reason = errors[2]; + errorInfos.Add(errorInfo); + } + if (errorInfos.Count > 0) + { + this.gvErrorInfo.DataSource = errorInfos; + this.gvErrorInfo.DataBind(); + } + } + else + { + ShowNotify("审核完成,请点击导入!", MessageBoxIcon.Success); + } + } + else + { + ShowNotify("导入数据为空!", MessageBoxIcon.Warning); + } + return true; + } + #endregion + #endregion + + #region 导入 + /// + /// 导入 + /// + /// + /// + protected void btnImport_Click(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(hdCheckResult.Text)) + { + if (errorInfos.Count <= 0) + { + string rootPath = Server.MapPath("~/"); + ImportXlsToData2(rootPath + initPath + this.hdFileName.Text); + hdCheckResult.Text = string.Empty; + ShowNotify("导入成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + else + { + ShowNotify("请先将错误数据修正,再重新导入提交!", MessageBoxIcon.Warning); + } + } + else + { + ShowNotify("请先审核要导入的文件!", MessageBoxIcon.Warning); + } + } + + #region Excel提取数据 + /// + /// 从Excel提取数据--》Dataset + /// + /// Excel文件路径名 + private void ImportXlsToData2(string fileName) + { + try + { + string oleDBConnString = String.Empty; + oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;"; + oleDBConnString += "Data Source="; + oleDBConnString += fileName; + oleDBConnString += ";Extended Properties=Excel 8.0;"; + OleDbConnection oleDBConn = null; + OleDbDataAdapter oleAdMaster = null; + DataTable m_tableName = new DataTable(); + DataSet ds = new DataSet(); + + oleDBConn = new OleDbConnection(oleDBConnString); + oleDBConn.Open(); + m_tableName = oleDBConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null); + + if (m_tableName != null && m_tableName.Rows.Count > 0) + { + + m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim(); + + } + string sqlMaster; + sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]"; + oleAdMaster = new OleDbDataAdapter(sqlMaster, oleDBConn); + oleAdMaster.Fill(ds, "m_tableName"); + oleAdMaster.Dispose(); + oleDBConn.Close(); + oleDBConn.Dispose(); + + AddDatasetToSQL2(ds.Tables[0], 8); + } + catch (Exception ex) + { + throw ex; } } #endregion - #region 导出按钮 - /// 导出按钮 + #region 将Dataset的数据导入数据库 + /// + /// 将Dataset的数据导入数据库 + /// + /// 数据集 + /// 数据集列数 + /// + private bool AddDatasetToSQL2(DataTable pds, int Cols) + { + int ic, ir; + ic = pds.Columns.Count; + if (ic < Cols) + { + ShowNotify("导入Excel格式错误!Excel只有" + ic.ToString().Trim() + "列", MessageBoxIcon.Warning); + } + string result = string.Empty; + ir = pds.Rows.Count; + if (pds != null && ir > 0) + { + 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; + + for (int i = 0; i < ir; i++) + { + Model.Comprehensive_TrainingRecords oldViewInfo = new Model.Comprehensive_TrainingRecords(); + + string row1 = pds.Rows[i][1].ToString().Trim(); + var cn = cns.Where(y => y.ProfessionalName == row1).FirstOrDefault(); + oldViewInfo = oldViewInfos.Where(x => x.RemarkCode == pds.Rows[i][7].ToString().Trim() + ).FirstOrDefault(); + if (oldViewInfo == null) + { + Model.Comprehensive_TrainingRecords des = new Model.Comprehensive_TrainingRecords(); + des.TrainingRecordsId = SQLHelper.GetNewID(typeof(Model.Comprehensive_TrainingRecords)); + des.ProjectId = this.CurrUser.LoginProjectId; + des.TrainingContents = pds.Rows[i][0].ToString().Trim(); + des.CNProfessionalId = cn.CNProfessionalId; + des.TrainingObject = pds.Rows[i][2].ToString().Trim(); + des.TrainingAddress = pds.Rows[i][3].ToString().Trim(); + if (!string.IsNullOrEmpty(pds.Rows[i][4].ToString().Trim())) + { + des.Hours = Convert.ToDecimal(pds.Rows[i][4].ToString().Trim()); + } + des.KeynoteSpeaker = pds.Rows[i][5].ToString().Trim(); + des.Remark = pds.Rows[i][6].ToString().Trim(); + des.RemarkCode = pds.Rows[i][7].ToString().Trim(); + BLL.TrainingRecordsService.AddTrainingRecords(des); + } + } + } + else + { + ShowNotify("导入数据为空!", MessageBoxIcon.Warning); + } + return true; + } + #endregion + #endregion + + #region 下载模板 + /// + /// 下载模板按钮 /// /// /// - protected void btnOut_Click(object sender, EventArgs e) + protected void btnDownLoad_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) + ".xlsx"); - Response.ContentType = "application/excel"; - Response.ContentEncoding = System.Text.Encoding.UTF8; - Response.Write(GetGridTableHtml(Grid1)); - Response.End(); + PageContext.RegisterStartupScript(Confirm.GetShowReference("确定下载导入模板吗?", String.Empty, MessageBoxIcon.Question, PageManager1.GetCustomEventReference(false, "Confirm_OK"), PageManager1.GetCustomEventReference("Confirm_Cancel"))); + } + + /// + /// 下载导入模板 + /// + /// + /// + protected void PageManager1_CustomEvent(object sender, CustomEventArgs e) + { + if (e.EventArgument == "Confirm_OK") + { + 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 } diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataIn.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataIn.aspx.designer.cs index e30ff7cd..d5120922 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataIn.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/TrainingRecordsDataIn.aspx.designer.cs @@ -31,130 +31,85 @@ namespace FineUIPro.Web.CQMS.Comprehensive { protected global::FineUIPro.PageManager PageManager1; /// - /// id 控件。 + /// SimpleForm1 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.HiddenField id; + protected global::FineUIPro.Form SimpleForm1; /// - /// Panel1 控件。 + /// Toolbar2 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.Panel Panel1; + protected global::FineUIPro.Toolbar Toolbar2; /// - /// Toolbar1 控件。 + /// hdFileName 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.Toolbar Toolbar1; + protected global::FineUIPro.HiddenField hdFileName; /// - /// hdfileName 控件。 + /// btnAudit 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.HiddenField hdfileName; + protected global::FineUIPro.Button btnAudit; /// - /// FileExcel 控件。 + /// btnImport 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.FileUpload FileExcel; + protected global::FineUIPro.Button btnImport; /// - /// imgbtnImport 控件。 + /// btnDownLoad 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.Button imgbtnImport; + protected global::FineUIPro.Button btnDownLoad; /// - /// ToolbarFill1 控件。 + /// hdCheckResult 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.ToolbarFill ToolbarFill1; + protected global::FineUIPro.HiddenField hdCheckResult; /// - /// ckUpdate 控件。 + /// fuAttachUrl 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.CheckBox ckUpdate; + protected global::FineUIPro.FileUpload fuAttachUrl; /// - /// btnSave 控件。 + /// gvErrorInfo 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - 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; + protected global::FineUIPro.Grid gvErrorInfo; /// /// lblPageIndex 控件。 @@ -164,104 +119,5 @@ namespace FineUIPro.Web.CQMS.Comprehensive { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Label lblPageIndex; - - /// - /// 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/File/Excel/DataIn/图纸会审记录导入模板.xls b/SGGL/FineUIPro.Web/File/Excel/DataIn/图纸会审记录导入模板.xls new file mode 100644 index 00000000..8f0c6317 Binary files /dev/null and b/SGGL/FineUIPro.Web/File/Excel/DataIn/图纸会审记录导入模板.xls differ diff --git a/SGGL/FineUIPro.Web/File/Excel/DataIn/培训记录导入模板.xls b/SGGL/FineUIPro.Web/File/Excel/DataIn/培训记录导入模板.xls new file mode 100644 index 00000000..57e6721b Binary files /dev/null and b/SGGL/FineUIPro.Web/File/Excel/DataIn/培训记录导入模板.xls differ diff --git a/SGGL/FineUIPro.Web/File/Excel/DataIn/培训记录导入模板.xlsx b/SGGL/FineUIPro.Web/File/Excel/DataIn/培训记录导入模板.xlsx deleted file mode 100644 index ed68bb54..00000000 Binary files a/SGGL/FineUIPro.Web/File/Excel/DataIn/培训记录导入模板.xlsx and /dev/null differ diff --git a/SGGL/FineUIPro.Web/File/Excel/DataIn/施工组织设计及施工方案导入模板.xls b/SGGL/FineUIPro.Web/File/Excel/DataIn/施工组织设计及施工方案导入模板.xls new file mode 100644 index 00000000..0b5b85ae Binary files /dev/null and b/SGGL/FineUIPro.Web/File/Excel/DataIn/施工组织设计及施工方案导入模板.xls differ diff --git a/SGGL/FineUIPro.Web/File/Excel/DataIn/检验试验计划导入模板.xls b/SGGL/FineUIPro.Web/File/Excel/DataIn/检验试验计划导入模板.xls new file mode 100644 index 00000000..30acee98 Binary files /dev/null and b/SGGL/FineUIPro.Web/File/Excel/DataIn/检验试验计划导入模板.xls differ diff --git a/SGGL/FineUIPro.Web/File/Excel/DataIn/现场签证管理导入模板.xls b/SGGL/FineUIPro.Web/File/Excel/DataIn/现场签证管理导入模板.xls index 83cbd376..1270fd0d 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/File/Excel/DataIn/设计交底导入模板.xls b/SGGL/FineUIPro.Web/File/Excel/DataIn/设计交底导入模板.xls new file mode 100644 index 00000000..917d4797 Binary files /dev/null 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 aa09bb51..004db80f 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -436,12 +436,14 @@ + + @@ -456,6 +458,7 @@ + @@ -471,6 +474,7 @@ + @@ -7430,6 +7434,13 @@ DesignDetailsApprove.aspx + + DesignDetailsDataIn.aspx + ASPXCodeBehind + + + DesignDetailsDataIn.aspx + DesignDetailsEdit.aspx ASPXCodeBehind @@ -7472,6 +7483,13 @@ GeneralPlanApproval.aspx + + GeneralPlanApprovalDataIn.aspx + ASPXCodeBehind + + + GeneralPlanApprovalDataIn.aspx + GeneralPlanApprovalEdit.aspx ASPXCodeBehind @@ -7570,6 +7588,13 @@ InspectionTestPlan.aspx + + InspectionTestPlanDataIn.aspx + ASPXCodeBehind + + + InspectionTestPlanDataIn.aspx + InspectionTestPlanEdit.aspx ASPXCodeBehind @@ -7675,6 +7700,13 @@ ReviewDrawings.aspx + + ReviewDrawingsDataIn.aspx + ASPXCodeBehind + + + ReviewDrawingsDataIn.aspx + ReviewDrawingsEdit.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj.user b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj.user index 63ca13cc..9e91deff 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj.user +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj.user @@ -1,7 +1,7 @@  - Release|Any CPU + Debug|Any CPU true false diff --git a/SGGL/FineUIPro.Web/Web.config b/SGGL/FineUIPro.Web/Web.config index 963148f2..9fc55c34 100644 --- a/SGGL/FineUIPro.Web/Web.config +++ b/SGGL/FineUIPro.Web/Web.config @@ -12,7 +12,7 @@ - + @@ -77,7 +77,7 @@ - + diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index c8570287..027a6033 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -90845,6 +90845,8 @@ namespace Model private string _AuditMan; + private string _RemarCode; + private EntityRef _Base_Project; private EntityRef _Sys_User; @@ -90881,6 +90883,8 @@ namespace Model partial void OnStatusChanged(); partial void OnAuditManChanging(string value); partial void OnAuditManChanged(); + partial void OnRemarCodeChanging(string value); + partial void OnRemarCodeChanged(); #endregion public Comprehensive_DesignDetails() @@ -91178,6 +91182,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RemarCode", DbType="NVarChar(50)")] + public string RemarCode + { + get + { + return this._RemarCode; + } + set + { + if ((this._RemarCode != value)) + { + this.OnRemarCodeChanging(value); + this.SendPropertyChanging(); + this._RemarCode = value; + this.SendPropertyChanged("RemarCode"); + this.OnRemarCodeChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Comprehensive_DesignDetails_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)] public Base_Project Base_Project { @@ -92296,6 +92320,8 @@ namespace Model private string _UnitWorkId; + private string _RemarkCode; + private EntityRef _Base_CNProfessional; private EntityRef _Base_Project; @@ -92336,6 +92362,8 @@ namespace Model partial void OnCompileDateChanged(); partial void OnUnitWorkIdChanging(string value); partial void OnUnitWorkIdChanged(); + partial void OnRemarkCodeChanging(string value); + partial void OnRemarkCodeChanged(); #endregion public Comprehensive_GeneralPlanApproval() @@ -92639,6 +92667,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RemarkCode", DbType="NVarChar(50)")] + public string RemarkCode + { + get + { + return this._RemarkCode; + } + set + { + if ((this._RemarkCode != value)) + { + this.OnRemarkCodeChanging(value); + this.SendPropertyChanging(); + this._RemarkCode = value; + this.SendPropertyChanged("RemarkCode"); + this.OnRemarkCodeChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Comprehensive_GeneralPlanApproval_Base_CNProfessional", Storage="_Base_CNProfessional", ThisKey="CNProfessionalId", OtherKey="CNProfessionalId", IsForeignKey=true)] public Base_CNProfessional Base_CNProfessional { @@ -96645,6 +96693,8 @@ namespace Model private System.Nullable _IsReview; + private string _RemarkCode; + private EntityRef _Base_CNProfessional; private EntityRef _Base_Project; @@ -96691,6 +96741,8 @@ namespace Model partial void OnExpertReviewManChanged(); partial void OnIsReviewChanging(System.Nullable value); partial void OnIsReviewChanged(); + partial void OnRemarkCodeChanging(string value); + partial void OnRemarkCodeChanged(); #endregion public Comprehensive_MajorPlanApproval() @@ -97054,6 +97106,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RemarkCode", DbType="NVarChar(50)")] + public string RemarkCode + { + get + { + return this._RemarkCode; + } + set + { + if ((this._RemarkCode != value)) + { + this.OnRemarkCodeChanging(value); + this.SendPropertyChanging(); + this._RemarkCode = value; + this.SendPropertyChanged("RemarkCode"); + this.OnRemarkCodeChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Comprehensive_MajorPlanApproval_Base_CNProfessional", Storage="_Base_CNProfessional", ThisKey="CNProfessionalId", OtherKey="CNProfessionalId", IsForeignKey=true)] public Base_CNProfessional Base_CNProfessional { @@ -98482,6 +98554,8 @@ namespace Model private System.Nullable _ReportTime; + private string _RemarkCode; + private EntityRef _Sys_User; private EntityRef _Base_Project; @@ -98518,6 +98592,8 @@ namespace Model partial void OnAuditManChanged(); partial void OnReportTimeChanging(System.Nullable value); partial void OnReportTimeChanged(); + partial void OnRemarkCodeChanging(string value); + partial void OnRemarkCodeChanged(); #endregion public Comprehensive_PressurePipe() @@ -98800,6 +98876,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RemarkCode", DbType="NVarChar(50)")] + public string RemarkCode + { + get + { + return this._RemarkCode; + } + set + { + if ((this._RemarkCode != value)) + { + this.OnRemarkCodeChanging(value); + this.SendPropertyChanging(); + this._RemarkCode = value; + this.SendPropertyChanged("RemarkCode"); + this.OnRemarkCodeChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Comprehensive_PressurePipe_Sys_User", Storage="_Sys_User", ThisKey="CompileMan", OtherKey="UserId", IsForeignKey=true)] public Sys_User Sys_User { @@ -99213,6 +99309,8 @@ namespace Model private string _AuditMan; + private string _RemarkCode; + private EntityRef _Base_Project; private EntityRef _Base_Unit; @@ -99253,6 +99351,8 @@ namespace Model partial void OnStatusChanged(); partial void OnAuditManChanging(string value); partial void OnAuditManChanged(); + partial void OnRemarkCodeChanging(string value); + partial void OnRemarkCodeChanged(); #endregion public Comprehensive_QualityAccident() @@ -99575,6 +99675,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RemarkCode", DbType="NVarChar(50)")] + public string RemarkCode + { + get + { + return this._RemarkCode; + } + set + { + if ((this._RemarkCode != value)) + { + this.OnRemarkCodeChanging(value); + this.SendPropertyChanging(); + this._RemarkCode = value; + this.SendPropertyChanged("RemarkCode"); + this.OnRemarkCodeChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Comprehensive_QualityAccident_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)] public Base_Project Base_Project { @@ -99980,6 +100100,8 @@ namespace Model private System.Nullable _CreateDate; + private string _RemarkCode; + #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -100006,6 +100128,8 @@ namespace Model partial void OnCreateManChanged(); partial void OnCreateDateChanging(System.Nullable value); partial void OnCreateDateChanged(); + partial void OnRemarkCodeChanging(string value); + partial void OnRemarkCodeChanged(); #endregion public Comprehensive_ReviewDrawings() @@ -100233,6 +100357,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RemarkCode", DbType="NVarChar(50)")] + public string RemarkCode + { + get + { + return this._RemarkCode; + } + set + { + if ((this._RemarkCode != value)) + { + this.OnRemarkCodeChanging(value); + this.SendPropertyChanging(); + this._RemarkCode = value; + this.SendPropertyChanged("RemarkCode"); + this.OnRemarkCodeChanged(); + } + } + } + public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; @@ -100302,6 +100446,8 @@ namespace Model private string _Status; + private string _RemarkCode; + private EntityRef _Sys_User; private EntityRef _Base_CNProfessional; @@ -100358,6 +100504,8 @@ namespace Model partial void OnRemarkChanged(); partial void OnStatusChanging(string value); partial void OnStatusChanged(); + partial void OnRemarkCodeChanging(string value); + partial void OnRemarkCodeChanged(); #endregion public Comprehensive_SiteVisaManagement() @@ -100810,6 +100958,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RemarkCode", DbType="NVarChar(50)")] + public string RemarkCode + { + get + { + return this._RemarkCode; + } + set + { + if ((this._RemarkCode != value)) + { + this.OnRemarkCodeChanging(value); + this.SendPropertyChanging(); + this._RemarkCode = value; + this.SendPropertyChanged("RemarkCode"); + this.OnRemarkCodeChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Comprehensive_SiteVisaManagement_Sys_User", Storage="_Sys_User", ThisKey="CompileMan", OtherKey="UserId", IsForeignKey=true)] public Sys_User Sys_User { @@ -101287,6 +101455,8 @@ namespace Model private string _PositionNum; + private string _RemarkCode; + private EntityRef _Sys_User; private EntityRef _Base_Project; @@ -101323,6 +101493,8 @@ namespace Model partial void OnReportTimeChanged(); partial void OnPositionNumChanging(string value); partial void OnPositionNumChanged(); + partial void OnRemarkCodeChanging(string value); + partial void OnRemarkCodeChanged(); #endregion public Comprehensive_SpecialEquipment() @@ -101605,6 +101777,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RemarkCode", DbType="NVarChar(50)")] + public string RemarkCode + { + get + { + return this._RemarkCode; + } + set + { + if ((this._RemarkCode != value)) + { + this.OnRemarkCodeChanging(value); + this.SendPropertyChanging(); + this._RemarkCode = value; + this.SendPropertyChanged("RemarkCode"); + this.OnRemarkCodeChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="Comprehensive_SpecialEquipment_Sys_User", Storage="_Sys_User", ThisKey="CompileMan", OtherKey="UserId", IsForeignKey=true)] public Sys_User Sys_User { @@ -102006,6 +102198,8 @@ namespace Model private string _Remark; + private string _RemarkCode; + private EntityRef _Base_CNProfessional; private EntityRef _Base_Project; @@ -102032,6 +102226,8 @@ namespace Model partial void OnKeynoteSpeakerChanged(); partial void OnRemarkChanging(string value); partial void OnRemarkChanged(); + partial void OnRemarkCodeChanging(string value); + partial void OnRemarkCodeChanged(); #endregion public Comprehensive_TrainingRecords() @@ -102229,6 +102425,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RemarkCode", DbType="NVarChar(50)")] + public string RemarkCode + { + get + { + return this._RemarkCode; + } + set + { + if ((this._RemarkCode != value)) + { + this.OnRemarkCodeChanging(value); + this.SendPropertyChanging(); + this._RemarkCode = value; + this.SendPropertyChanged("RemarkCode"); + this.OnRemarkCodeChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Comprehensive_TrainingRecords_Base_CNProfessional", Storage="_Base_CNProfessional", ThisKey="CNProfessionalId", OtherKey="CNProfessionalId", IsForeignKey=true)] public Base_CNProfessional Base_CNProfessional { @@ -208440,6 +208656,8 @@ namespace Model private System.Nullable _CreateDate; + private string _RemarkCode; + #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -208468,6 +208686,8 @@ namespace Model partial void OnCreateManChanged(); partial void OnCreateDateChanging(System.Nullable value); partial void OnCreateDateChanged(); + partial void OnRemarkCodeChanging(string value); + partial void OnRemarkCodeChanged(); #endregion public Inspection_Test_Plan() @@ -208715,6 +208935,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RemarkCode", DbType="NVarChar(50)")] + public string RemarkCode + { + get + { + return this._RemarkCode; + } + set + { + if ((this._RemarkCode != value)) + { + this.OnRemarkCodeChanging(value); + this.SendPropertyChanging(); + this._RemarkCode = value; + this.SendPropertyChanged("RemarkCode"); + this.OnRemarkCodeChanged(); + } + } + } + public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; diff --git a/SGGL/WebAPI/WebAPI.csproj.user b/SGGL/WebAPI/WebAPI.csproj.user index bd497c6b..5fe155da 100644 --- a/SGGL/WebAPI/WebAPI.csproj.user +++ b/SGGL/WebAPI/WebAPI.csproj.user @@ -1,7 +1,7 @@  - Release|Any CPU + Debug|Any CPU true