diff --git a/DataBase/版本日志/SGGLDB_2025-06-20-geh.sql b/DataBase/版本日志/SGGLDB_2025-06-20-geh.sql new file mode 100644 index 0000000..9861973 Binary files /dev/null and b/DataBase/版本日志/SGGLDB_2025-06-20-geh.sql differ diff --git a/SUBQHSE/BLL/BLL.csproj b/SUBQHSE/BLL/BLL.csproj index e2b3966..e3ca3e0 100644 --- a/SUBQHSE/BLL/BLL.csproj +++ b/SUBQHSE/BLL/BLL.csproj @@ -299,6 +299,7 @@ + @@ -310,6 +311,8 @@ + + @@ -321,6 +324,7 @@ + diff --git a/SUBQHSE/BLL/CQMS/Comprehensive/ConTechnologyDisclosureService.cs b/SUBQHSE/BLL/CQMS/Comprehensive/ConTechnologyDisclosureService.cs new file mode 100644 index 0000000..4a7d6d3 --- /dev/null +++ b/SUBQHSE/BLL/CQMS/Comprehensive/ConTechnologyDisclosureService.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BLL +{ + /// + /// 施工技术交底管理 + /// + public class ConTechnologyDisclosureService + { + /// + /// 根据主键获取施工技术交底管理 + /// + /// + /// + public static Model.Comprehensive_ConTechnologyDisclosure GetConTechnologyDisclosureById(string conTechnologyDisclosureId) + { + return Funs.DB.Comprehensive_ConTechnologyDisclosure.FirstOrDefault(e => e.ConTechnologyDisclosureId == conTechnologyDisclosureId); + } + + /// + /// 添加施工技术交底管理 + /// + /// + public static void AddConTechnologyDisclosure(Model.Comprehensive_ConTechnologyDisclosure con) + { + Model.Comprehensive_ConTechnologyDisclosure newCon = new Model.Comprehensive_ConTechnologyDisclosure + { + ConTechnologyDisclosureId = con.ConTechnologyDisclosureId, + ProjectId = con.ProjectId, + CNProfessionalId = con.CNProfessionalId, + DisclosureCode = con.DisclosureCode, + DisclosureName = con.DisclosureName, + UnitId = con.UnitId, + DisclosureMan = con.DisclosureMan, + DisclosureDate = con.DisclosureDate, + UnitWorkId = con.UnitWorkId, + AttendMan = con.AttendMan, + DisclosurePersonNum = con.DisclosurePersonNum, + CompileMan = con.CompileMan, + CompileDate = con.CompileDate, + RemarkCode = con.RemarkCode + }; + Funs.DB.Comprehensive_ConTechnologyDisclosure.InsertOnSubmit(newCon); + Funs.DB.SubmitChanges(); + } + + /// + /// 修改施工技术交底管理 + /// + /// + public static void UpdateConTechnologyDisclosure(Model.Comprehensive_ConTechnologyDisclosure con) + { + Model.Comprehensive_ConTechnologyDisclosure newCon = Funs.DB.Comprehensive_ConTechnologyDisclosure.FirstOrDefault(e => e.ConTechnologyDisclosureId == con.ConTechnologyDisclosureId); + if (newCon != null) + { + newCon.CNProfessionalId = con.CNProfessionalId; + newCon.DisclosureCode = con.DisclosureCode; + newCon.DisclosureName = con.DisclosureName; + newCon.UnitId = con.UnitId; + newCon.DisclosureMan = con.DisclosureMan; + newCon.DisclosureDate = con.DisclosureDate; + newCon.UnitWorkId = con.UnitWorkId; + newCon.AttendMan = con.AttendMan; + newCon.DisclosurePersonNum = con.DisclosurePersonNum; + newCon.RemarkCode = con.RemarkCode; + Funs.DB.SubmitChanges(); + } + } + + /// + /// 根据Id删除施工技术交底管理 + /// + /// + public static void DeleteConTechnologyDisclosureById(string conTechnologyDisclosureId) + { + Model.Comprehensive_ConTechnologyDisclosure newCon = Funs.DB.Comprehensive_ConTechnologyDisclosure.FirstOrDefault(e => e.ConTechnologyDisclosureId == conTechnologyDisclosureId); + if (newCon != null) + { + Funs.DB.Comprehensive_ConTechnologyDisclosure.DeleteOnSubmit(newCon); + Funs.DB.SubmitChanges(); + } + } + } +} diff --git a/SUBQHSE/BLL/CQMS/Comprehensive/QualityAssuranceService.cs b/SUBQHSE/BLL/CQMS/Comprehensive/QualityAssuranceService.cs new file mode 100644 index 0000000..9f348a2 --- /dev/null +++ b/SUBQHSE/BLL/CQMS/Comprehensive/QualityAssuranceService.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BLL +{ + /// + /// 特设质保体系 + /// + public class QualityAssuranceService + { + /// + /// 根据主键获取特设质保体系 + /// + /// + /// + public static Model.Comprehensive_QualityAssurance GetQualityAssuranceById(string qualityAssuranceId) + { + return Funs.DB.Comprehensive_QualityAssurance.FirstOrDefault(e => e.QualityAssuranceId == qualityAssuranceId); + } + + /// + /// 添加特设质保体系 + /// + /// + public static void AddQualityAssurance(Model.Comprehensive_QualityAssurance qualityAssurance) + { + Model.SUBQHSEDB db = Funs.DB; + Model.Comprehensive_QualityAssurance newAssurance = new Model.Comprehensive_QualityAssurance + { + QualityAssuranceId = qualityAssurance.QualityAssuranceId, + ProjectId = qualityAssurance.ProjectId, + QualityAssuranceCode = qualityAssurance.QualityAssuranceCode, + QualityAssuranceName = qualityAssurance.QualityAssuranceName, + QualityAssuranceType = qualityAssurance.QualityAssuranceType, + ContentTexts = qualityAssurance.ContentTexts, + CompileMan = qualityAssurance.CompileMan, + CompileDate = qualityAssurance.CompileDate, + }; + db.Comprehensive_QualityAssurance.InsertOnSubmit(newAssurance); + db.SubmitChanges(); + } + + /// + /// 修改特设质保体系 + /// + /// + public static void UpdateQualityAssurance(Model.Comprehensive_QualityAssurance qualityAssurance) + { + Model.SUBQHSEDB db = Funs.DB; + Model.Comprehensive_QualityAssurance newAssurance = db.Comprehensive_QualityAssurance.FirstOrDefault(e => e.QualityAssuranceId == qualityAssurance.QualityAssuranceId); + if (newAssurance != null) + { + newAssurance.QualityAssuranceCode = qualityAssurance.QualityAssuranceCode; + newAssurance.QualityAssuranceName = qualityAssurance.QualityAssuranceName; + newAssurance.QualityAssuranceType = qualityAssurance.QualityAssuranceType; + newAssurance.ContentTexts = qualityAssurance.ContentTexts; + newAssurance.CompileMan = qualityAssurance.CompileMan; + newAssurance.CompileDate = qualityAssurance.CompileDate; + db.SubmitChanges(); + } + } + + /// + /// 根据主键删除特设质保体系 + /// + /// + public static void DeleteQualityAssuranceById(string qualityAssuranceId) + { + Model.SUBQHSEDB db = Funs.DB; + Model.Comprehensive_QualityAssurance qualityAssurance = db.Comprehensive_QualityAssurance.FirstOrDefault(e => e.QualityAssuranceId == qualityAssuranceId); + if (qualityAssurance != null) + { + db.Comprehensive_QualityAssurance.DeleteOnSubmit(qualityAssurance); + db.SubmitChanges(); + } + } + } +} diff --git a/SUBQHSE/BLL/CQMS/Comprehensive/ReviewDrawingsService.cs b/SUBQHSE/BLL/CQMS/Comprehensive/ReviewDrawingsService.cs new file mode 100644 index 0000000..3321311 --- /dev/null +++ b/SUBQHSE/BLL/CQMS/Comprehensive/ReviewDrawingsService.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Collections; + +namespace BLL +{ + public class ReviewDrawingsService + { + public static bool Insert(Model.Comprehensive_ReviewDrawings model) + { + try + { + Funs.DB.Comprehensive_ReviewDrawings.InsertOnSubmit(model); + Funs.DB.SubmitChanges(); + return true; + } + catch (Exception ex) + { + ErrLogInfo.WriteLog($"插入数据失败,原因:{ex.Message}"); + return false; + } + } + + public static bool Update(Model.Comprehensive_ReviewDrawings model) + { + try + { + var result = Funs.DB.Comprehensive_ReviewDrawings.FirstOrDefault(a => a.Id == model.Id); + if (result != null) + { + result.CNProfessionalId = model.CNProfessionalId; + result.DraCode = model.DraCode; + result.ReviewDate = model.ReviewDate; + result.UnitWorkId = model.UnitWorkId; + result.ReceiveUnits = model.ReceiveUnits; + result.Status = model.Status; + result.Remarks = model.Remarks; + Funs.DB.SubmitChanges(); + } + return true; + } + catch (Exception ex) + { + ErrLogInfo.WriteLog($"更新表数据失败,原因:{ex.Message}"); + return false; + } + } + + public static bool Delete(List newId) + { + try + { + var result = Funs.DB.Comprehensive_ReviewDrawings.Where(a => newId.Contains(a.Id)).ToList(); + if (result.Count > 0) + { + Funs.DB.Comprehensive_ReviewDrawings.DeleteAllOnSubmit(result); + Funs.DB.SubmitChanges(); + } + return true; + } + catch (Exception ex) + { + ErrLogInfo.WriteLog($"删除数据失败,原因:{ex.Message}"); + return false; + } + } + + public static bool Delete(string newId) + { + try + { + var result = Funs.DB.Comprehensive_ReviewDrawings.Where(a => a.Id == newId).ToList(); + if (result.Count > 0) + { + Funs.DB.Comprehensive_ReviewDrawings.DeleteAllOnSubmit(result); + Funs.DB.SubmitChanges(); + } + return true; + } + catch (Exception ex) + { + ErrLogInfo.WriteLog($"删除数据失败,原因:{ex.Message}"); + return false; + } + } + + public static Model.Comprehensive_ReviewDrawings Detail(string newId) + { + var result = Funs.DB.Comprehensive_ReviewDrawings.FirstOrDefault(a => a.Id == newId); + return result; + } + } +} diff --git a/SUBQHSE/BLL/Common/Const.cs b/SUBQHSE/BLL/Common/Const.cs index 339e882..9dafc2e 100644 --- a/SUBQHSE/BLL/Common/Const.cs +++ b/SUBQHSE/BLL/Common/Const.cs @@ -6732,5 +6732,25 @@ namespace BLL /// public const string CQMSRectifyMenuId = "D72BB321-11A8-485B-BAC7-367C7FCA7FBA"; /// + /// /// + /// 施工技术交底管理导入模板原始虚拟路径 + /// + public const string ConTechnologyDisclosureTemUrl = "File\\Excel\\DataIn\\施工技术交底管理导入模板.xls"; + /// + /// 施工技术交底管理 + /// + public const string ConTechnologyDisclosureMenuId = "A16CFA9D-2783-4573-95F9-EBA2B682B7EA"; + /// + /// 特设质保体系 + /// + public const string CQMS_QualityAssuranceMenuId = "2C49EC5E-BF6F-4C44-BA02-9BD183CF68C6"; + /// + /// 图纸会审管理 + /// + public const string ReviewDrawingsMenuId = "856D53B3-C5FB-443F-917B-39E83BE685DB"; + /// + /// 图纸会审记录导入模板文件原始虚拟路径 + /// + public const string ReviewDrawingsTemplateUrl = "File\\Excel\\DataIn\\图纸会审管理导入模板.xls"; } } \ No newline at end of file diff --git a/SUBQHSE/BLL/Common/Sys_CQMS_DataInTempService.cs b/SUBQHSE/BLL/Common/Sys_CQMS_DataInTempService.cs new file mode 100644 index 0000000..cd5b7a8 --- /dev/null +++ b/SUBQHSE/BLL/Common/Sys_CQMS_DataInTempService.cs @@ -0,0 +1,171 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BLL +{ + public class Sys_CQMS_DataInTempService + { /// + /// 根据主键获取导入临时表信息 + /// + /// Id + /// + public static Model.Sys_CQMS_DataInTemp GetDataInTempByTempId(string tempId) + { + return Funs.DB.Sys_CQMS_DataInTemp.FirstOrDefault(x => x.TempId == tempId); + } + + /// + /// 增加导入临时表记录 + /// + /// 委托实体 + public static void AddDataInTemp(Model.Sys_CQMS_DataInTemp dataInTemp) + { + Model.SUBQHSEDB db = Funs.DB; + Model.Sys_CQMS_DataInTemp newDataInTemp = new Model.Sys_CQMS_DataInTemp(); + newDataInTemp.TempId = dataInTemp.TempId; + newDataInTemp.ProjectId = dataInTemp.ProjectId; + newDataInTemp.UserId = dataInTemp.UserId; + newDataInTemp.Time = dataInTemp.Time; + newDataInTemp.RowNo = dataInTemp.RowNo; + newDataInTemp.Type = dataInTemp.Type; + newDataInTemp.Value1 = dataInTemp.Value1; + newDataInTemp.Value2 = dataInTemp.Value2; + newDataInTemp.Value3 = dataInTemp.Value3; + newDataInTemp.Value4 = dataInTemp.Value4; + newDataInTemp.Value5 = dataInTemp.Value5; + newDataInTemp.Value6 = dataInTemp.Value6; + newDataInTemp.Value7 = dataInTemp.Value7; + newDataInTemp.Value8 = dataInTemp.Value8; + newDataInTemp.Value9 = dataInTemp.Value9; + newDataInTemp.Value10 = dataInTemp.Value10; + newDataInTemp.Value11 = dataInTemp.Value11; + newDataInTemp.Value12 = dataInTemp.Value12; + newDataInTemp.Value13 = dataInTemp.Value13; + newDataInTemp.Value14 = dataInTemp.Value14; + newDataInTemp.Value15 = dataInTemp.Value15; + newDataInTemp.Value16 = dataInTemp.Value16; + newDataInTemp.Value17 = dataInTemp.Value17; + newDataInTemp.Value18 = dataInTemp.Value18; + newDataInTemp.Value19 = dataInTemp.Value19; + newDataInTemp.Value20 = dataInTemp.Value20; + + newDataInTemp.ToopValue = dataInTemp.ToopValue; + db.Sys_CQMS_DataInTemp.InsertOnSubmit(newDataInTemp); + db.SubmitChanges(); + } + + + public static void AddDataInTemp(List dataInTemps) + { + Model.SUBQHSEDB db = Funs.DB; + foreach (var dataInTemp in dataInTemps) + { + Model.Sys_CQMS_DataInTemp newDataInTemp = new Model.Sys_CQMS_DataInTemp(); + newDataInTemp.TempId = dataInTemp.TempId; + newDataInTemp.ProjectId = dataInTemp.ProjectId; + newDataInTemp.UserId = dataInTemp.UserId; + newDataInTemp.Time = dataInTemp.Time; + newDataInTemp.RowNo = dataInTemp.RowNo; + newDataInTemp.Type = dataInTemp.Type; + newDataInTemp.Value1 = dataInTemp.Value1; + newDataInTemp.Value2 = dataInTemp.Value2; + newDataInTemp.Value3 = dataInTemp.Value3; + newDataInTemp.Value4 = dataInTemp.Value4; + newDataInTemp.Value5 = dataInTemp.Value5; + newDataInTemp.Value6 = dataInTemp.Value6; + newDataInTemp.Value7 = dataInTemp.Value7; + newDataInTemp.Value8 = dataInTemp.Value8; + newDataInTemp.Value9 = dataInTemp.Value9; + newDataInTemp.Value10 = dataInTemp.Value10; + newDataInTemp.Value11 = dataInTemp.Value11; + newDataInTemp.Value12 = dataInTemp.Value12; + newDataInTemp.Value13 = dataInTemp.Value13; + newDataInTemp.Value14 = dataInTemp.Value14; + newDataInTemp.Value15 = dataInTemp.Value15; + newDataInTemp.Value16 = dataInTemp.Value16; + newDataInTemp.Value17 = dataInTemp.Value17; + newDataInTemp.Value18 = dataInTemp.Value18; + newDataInTemp.Value19 = dataInTemp.Value19; + newDataInTemp.Value20 = dataInTemp.Value20; + + newDataInTemp.ToopValue = dataInTemp.ToopValue; + db.Sys_CQMS_DataInTemp.InsertOnSubmit(newDataInTemp); + } + db.SubmitChanges(); + } + + + + /// + /// 修改导入临时表记录 + /// + /// 焊接实体 + public static void UpdateDataInTemp(Model.Sys_CQMS_DataInTemp dataInTemp) + { + Model.SUBQHSEDB db = Funs.DB; + Model.Sys_CQMS_DataInTemp newDataInTemp = db.Sys_CQMS_DataInTemp.FirstOrDefault(e => e.TempId == dataInTemp.TempId); + if (newDataInTemp != null) + { + newDataInTemp.UserId = dataInTemp.UserId; + newDataInTemp.Time = dataInTemp.Time; + newDataInTemp.Value1 = dataInTemp.Value1; + newDataInTemp.Value2 = dataInTemp.Value2; + newDataInTemp.Value3 = dataInTemp.Value3; + newDataInTemp.Value4 = dataInTemp.Value4; + newDataInTemp.Value5 = dataInTemp.Value5; + newDataInTemp.Value6 = dataInTemp.Value6; + newDataInTemp.Value7 = dataInTemp.Value7; + newDataInTemp.Value8 = dataInTemp.Value8; + newDataInTemp.Value9 = dataInTemp.Value9; + newDataInTemp.Value10 = dataInTemp.Value10; + newDataInTemp.Value11 = dataInTemp.Value11; + newDataInTemp.Value12 = dataInTemp.Value12; + newDataInTemp.Value13 = dataInTemp.Value13; + newDataInTemp.Value14 = dataInTemp.Value14; + newDataInTemp.Value15 = dataInTemp.Value15; + newDataInTemp.Value16 = dataInTemp.Value16; + newDataInTemp.Value17 = dataInTemp.Value17; + newDataInTemp.Value18 = dataInTemp.Value18; + newDataInTemp.Value19 = dataInTemp.Value19; + newDataInTemp.Value20 = dataInTemp.Value20; + newDataInTemp.ToopValue = dataInTemp.ToopValue; + newDataInTemp.Type = dataInTemp.Type; + db.SubmitChanges(); + } + } + + /// + /// 根据主键删除导入临时表记录 + /// + /// 委托主键 + public static void DeleteDataInTempByDataInTempID(string tempId) + { + Model.SUBQHSEDB db = Funs.DB; + Model.Sys_CQMS_DataInTemp dataInTemp = db.Sys_CQMS_DataInTemp.FirstOrDefault(e => e.TempId == tempId); + if (dataInTemp != null) + { + db.Sys_CQMS_DataInTemp.DeleteOnSubmit(dataInTemp); + db.SubmitChanges(); + } + } + + /// + /// 根据项目用户主键删除导入临时表记录 + /// + /// + /// + public static void DeleteDataInTempByProjectIdUserId(string projectId, string userId, string type) + { + Model.SUBQHSEDB db = Funs.DB; + var dataInTemp = from x in db.Sys_CQMS_DataInTemp where x.ProjectId == projectId && x.UserId == userId && x.Type == type select x; + if (dataInTemp.Count() > 0) + { + db.Sys_CQMS_DataInTemp.DeleteAllOnSubmit(dataInTemp); + db.SubmitChanges(); + } + } + } +} \ No newline at end of file diff --git a/SUBQHSE/BLL/DropListService.cs b/SUBQHSE/BLL/DropListService.cs index 4e46986..cbcd28f 100644 --- a/SUBQHSE/BLL/DropListService.cs +++ b/SUBQHSE/BLL/DropListService.cs @@ -415,5 +415,17 @@ } return lis; } + + public static ListItem[] drpQualityAssuranceTypeList() + { + ListItem[] list = new ListItem[6]; + list[0] = new ListItem("压力管道安装", "压力管道安装"); + list[1] = new ListItem("压力容器制造", "压力容器制造"); + list[2] = new ListItem("压力容器安装", "压力容器安装"); + list[3] = new ListItem("锅炉安装", "锅炉安装"); + list[4] = new ListItem("起重机械安装", "起重机械安装"); + list[5] = new ListItem("电梯安装", "电梯安装"); + return list; + } } } diff --git a/SUBQHSE/BLL/ProjectData/UnitWorkService.cs b/SUBQHSE/BLL/ProjectData/UnitWorkService.cs index d753d0b..3488f34 100644 --- a/SUBQHSE/BLL/ProjectData/UnitWorkService.cs +++ b/SUBQHSE/BLL/ProjectData/UnitWorkService.cs @@ -641,5 +641,24 @@ namespace BLL return id; } + + public static string GetUnitWorkIdsByUnitWorkNames(string projectId, string unitWorks) + { + if (!string.IsNullOrEmpty(unitWorks)) + { + string[] ins = unitWorks.Split(','); + string unitIds = string.Empty; + foreach (string s in ins) + { + var q = GetUnitWorkByUnitWorkName(projectId, s.Trim()).UnitWorkId; + unitIds += q + ","; + } + return unitIds.Substring(0, unitIds.LastIndexOf(',')); + } + else + { + return string.Empty; + } + } } } diff --git a/SUBQHSE/BLL/SysManage/UnitService.cs b/SUBQHSE/BLL/SysManage/UnitService.cs index ffced59..8e590b6 100644 --- a/SUBQHSE/BLL/SysManage/UnitService.cs +++ b/SUBQHSE/BLL/SysManage/UnitService.cs @@ -946,5 +946,21 @@ namespace BLL return q; } } + /// + /// 单位表下拉框 + /// + /// 下拉框名字 + /// 是否显示请选择 + public static void GetUnit(FineUIPro.DropDownList dropName, string projectId, bool isShowPlease) + { + dropName.DataValueField = "UnitId"; + dropName.DataTextField = "UnitName"; + dropName.DataSource = GetUnitByProjectIdList(projectId); + dropName.DataBind(); + if (isShowPlease) + { + Funs.FineUIPleaseSelect(dropName); + } + } } } diff --git a/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosure.aspx b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosure.aspx new file mode 100644 index 0000000..096d5c4 --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosure.aspx @@ -0,0 +1,144 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ConTechnologyDisclosure.aspx.cs" Inherits="FineUIPro.Web.CQMS.Comprehensive.ConTechnologyDisclosure" %> + +<%@ Register Src="~/Controls/UnitProjectTControl.ascx" TagName="UnitProjectTControl" TagPrefix="uc1" %> + + + + + + + 施工技术交底管理 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%----%> + + + + + + + + + + diff --git a/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosure.aspx.cs b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosure.aspx.cs new file mode 100644 index 0000000..3dc4344 --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosure.aspx.cs @@ -0,0 +1,477 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +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 ConTechnologyDisclosure : PageBase + { + #region 项目主键 + /// + /// 项目主键 + /// + public string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + #endregion + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + //Funs.DropDownPageSize(this.ddlPageSize); + this.ProjectId = this.CurrUser.LoginProjectId; + if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId) + { + this.ProjectId = Request.Params["projectId"]; + } + this.ucTree.UnitId = this.CurrUser.UnitId; + this.ucTree.ProjectId = this.ProjectId; + if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) + { + this.panelLeftRegion.Hidden = true; + ////权限按钮方法 + this.GetButtonPower(); + } + + BLL.UnitService.InitUnitDownList(this.sdrpUnitId, this.CurrUser.LoginProjectId, true); + BLL.CNProfessionalService.InitCNProfessionalDownList(this.drpProfessionalId, true); + BindGrid(); + } + } + + /// + /// 公司级树加载 + /// + /// + /// + protected void changeTree(object sender, EventArgs e) + { + this.ProjectId = this.ucTree.ProjectId; + this.BindGrid(); + + this.GetButtonPower(); + if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) + { + btnNew.Hidden = true; + btnImport.Hidden = true; + } + } + + public void BindGrid() + { + if (string.IsNullOrEmpty(this.ProjectId)) + { + return; + } + + string strSql = @"select C.ConTechnologyDisclosureId, C.ProjectId, C.CNProfessionalId, C.DisclosureCode, C.DisclosureName,C.UnitId,C.DisclosureMan,C.DisclosureDate, C.UnitWorkId,C.AttendMan, + C.CompileMan, C.CompileDate, C.RemarkCode,CN.ProfessionalName,u.UnitName,C.RemarkCode,C.DisclosurePersonNum + from Comprehensive_ConTechnologyDisclosure C + left join Base_CNProfessional CN on C.CNProfessionalId=CN.CNProfessionalId + left join Base_Unit u on u.UnitId = C.UnitId + where C.ProjectId = @ProjectId"; + List listStr = new List(); + listStr.Add(new SqlParameter("@ProjectId", this.ProjectId)); + if (sdrpUnitId.SelectedValue != BLL.Const._Null) + { + strSql += " AND C.UnitId=@UnitId"; + listStr.Add(new SqlParameter("@UnitId", sdrpUnitId.SelectedValue)); + } + if (this.drpProfessionalId.SelectedValue != BLL.Const._Null) + { + strSql += " AND C.CNProfessionalId =@CNProfessionalId"; + listStr.Add(new SqlParameter("@CNProfessionalId", drpProfessionalId.SelectedValue)); + } + if (!string.IsNullOrEmpty(this.txtCode.Text.Trim())) + { + strSql += " AND C.DisclosureCode LIKE @DisclosureCode"; + listStr.Add(new SqlParameter("@DisclosureCode", "%" + txtCode.Text.Trim() + "%")); + } + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + Grid1.RecordCount = tb.Rows.Count; + //tb = GetFilteredTable(Grid1.FilteredData, tb); + var table = this.GetPagedDataTable(Grid1, tb); + Grid1.DataSource = table; + Grid1.DataBind(); + } + #endregion + + #region 分页、排序 + /// + /// 分页下拉 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + + /// + /// 分页索引事件 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e) + { + Grid1.SortDirection = e.SortDirection; + Grid1.SortField = e.SortField; + BindGrid(); + } + #endregion + + #region 查询 + /// + /// 查询 + /// + /// + /// + protected void btnSearch_Click(object sender, EventArgs e) + { + BindGrid(); + } + #endregion + + #region 关闭弹出窗口 + /// + /// 关闭弹出窗口 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + } + #endregion + + #region 增加 + /// + /// 新增按钮事件 + /// + /// + /// + protected void btnNew_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ConTechnologyDisclosureEdit.aspx", "编辑 - "))); + } + #endregion + + #region 编辑 + /// + /// 右键编辑 + /// + /// + /// + protected void btnMenuModify_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录", MessageBoxIcon.Warning); + return; + } + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ConTechnologyDisclosureEdit.aspx?id={0}", Grid1.SelectedRowID, "编辑 - "))); + } + + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + btnMenuModify_Click(sender, e); + } + #endregion + + #region 删除 + /// + /// 右键删除 + /// + /// + /// + protected void btnMenuDel_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length > 0) + { + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + var con = BLL.ConTechnologyDisclosureService.GetConTechnologyDisclosureById(rowID); + if (con != null) + { + BLL.ConTechnologyDisclosureService.DeleteConTechnologyDisclosureById(rowID); + } + } + BindGrid(); + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + } + #endregion + + #region 格式化字符串 + /// + /// 获取单位工程名称 + /// + /// + /// + protected string ConvertUnitWork(object CarryUnitWorks) + { + string CarryUnitWorkName = string.Empty; + if (CarryUnitWorks != null) + { + string[] Ids = CarryUnitWorks.ToString().Split(','); + foreach (string t in Ids) + { + var UnitWork = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(t); + if (UnitWork != null) + { + CarryUnitWorkName += UnitWork.UnitWorkName + ","; + } + } + } + if (CarryUnitWorkName != string.Empty) + { + return CarryUnitWorkName.Substring(0, CarryUnitWorkName.Length - 1); + } + else + { + return ""; + } + } + #endregion + + #region 导入 + /// + /// 导入按钮 + /// + /// + /// + protected void btnImport_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("ConTechnologyDisclosureDataInNew.aspx", "导入 - "))); + } + #endregion + + #region 导出按钮 + /// 导出按钮 + ///
+ /// + /// + protected void btnOut_Click(object sender, EventArgs e) + { + string rootPath = Server.MapPath("~/"); + string initTemplatePath = Const.ConTechnologyDisclosureTemUrl; + string uploadfilepath = string.Empty; + string newUrl = string.Empty; + uploadfilepath = rootPath + initTemplatePath; + + var lists = (from x in Funs.DB.Comprehensive_ConTechnologyDisclosure + where x.ProjectId == this.ProjectId + select x); + if (sdrpUnitId.SelectedValue != BLL.Const._Null) + { + lists = lists.Where(x => x.UnitId == sdrpUnitId.SelectedValue); + } + if (this.drpProfessionalId.SelectedValue != BLL.Const._Null) + { + lists = lists.Where(x => x.CNProfessionalId == this.drpProfessionalId.SelectedValue); + } + if (!string.IsNullOrEmpty(this.txtCode.Text.Trim())) + { + lists = lists.Where(x => x.DisclosureCode.Contains(this.txtCode.Text.Trim())); + } + lists = lists.OrderBy(x => x.RemarkCode); + if (lists != null) + { + string projectName = BLL.ProjectService.GetShortNameByProjectId(this.ProjectId); + newUrl = uploadfilepath.Replace("施工技术交底管理导入模板", "施工技术交底管理(" + projectName + DateTime.Now.ToString("yyyyMMdd") + ")"); + if (File.Exists(newUrl)) + { + File.Delete(newUrl); + } + File.Copy(uploadfilepath, newUrl); + // 第一步:读取文件流 + NPOI.SS.UserModel.IWorkbook workbook; + using (FileStream stream = new FileStream(newUrl, FileMode.Open, FileAccess.Read)) + { + //workbook = new NPOI.XSSF.UserModel.XSSFWorkbook(stream); + workbook = new NPOI.HSSF.UserModel.HSSFWorkbook(stream); + } + // 创建单元格样式 + NPOI.SS.UserModel.ICellStyle cellStyle = workbook.CreateCellStyle(); + cellStyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin; + cellStyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin; + cellStyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin; + cellStyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin; + cellStyle.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center; + cellStyle.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center; + cellStyle.WrapText = true;//自动换行 + var font = workbook.CreateFont(); + font.FontHeightInPoints = 11; + cellStyle.SetFont(font); + // 第二步:创建新数据行 + NPOI.SS.UserModel.ISheet sheet = workbook.GetSheetAt(0); + NPOI.SS.UserModel.IRow row = sheet.GetRow(0); + NPOI.SS.UserModel.ICell cell; + int i = 2; + foreach (var item in lists) + { + // 第二步:创建新数据行 + row = sheet.CreateRow(i); + // 添加数据 + cell = row.CreateCell(0); + cell.CellStyle = cellStyle; + string proName = string.Empty; + var cnp = BLL.CNProfessionalService.GetCNProfessional(item.CNProfessionalId); + if (cnp != null) + { + proName = cnp.ProfessionalName; + } + cell.SetCellValue(proName);//专业 + + cell = row.CreateCell(1); + cell.CellStyle = cellStyle; + cell.SetCellValue(item.DisclosureCode);//交底文件编号 + + cell = row.CreateCell(2); + cell.CellStyle = cellStyle; + cell.SetCellValue(item.DisclosureName);//交底施工方案 + + cell = row.CreateCell(3); + cell.CellStyle = cellStyle; + string unitName = string.Empty; + if (!string.IsNullOrEmpty(item.UnitId)) + { + unitName = BLL.UnitService.GetUnitNameByUnitId(item.UnitId); + } + cell.SetCellValue(unitName);//交底负责单位 + + cell = row.CreateCell(4); + cell.CellStyle = cellStyle; + cell.SetCellValue(item.DisclosureMan);//交底人 + + cell = row.CreateCell(5); + cell.CellStyle = cellStyle; + cell.SetCellValue(item.DisclosureDate.HasValue ? string.Format("{0:yyyy-MM-dd}", item.DisclosureDate) : "");//交底日期 + + cell = row.CreateCell(6); + cell.CellStyle = cellStyle; + string unitWork = string.Empty; + if (!string.IsNullOrEmpty(item.UnitWorkId)) + { + unitWork = ConvertUnitWork(item.UnitWorkId); + } + cell.SetCellValue(unitWork);//单位工程 + + cell = row.CreateCell(7); + cell.CellStyle = cellStyle; + cell.SetCellValue(item.AttendMan);//参加人员 + + cell = row.CreateCell(8); + cell.CellStyle = cellStyle; + cell.SetCellValue(item.RemarkCode.HasValue ? item.RemarkCode.ToString() : "");//标志编号 + + cell = row.CreateCell(9); + cell.CellStyle = cellStyle; + cell.SetCellValue(item.DisclosurePersonNum.HasValue ? item.DisclosurePersonNum.ToString() : "");//交底人数 + i++; + } + // 第三步:写入文件流 + using (FileStream stream = new FileStream(newUrl, FileMode.Create, FileAccess.Write)) + { + workbook.Write(stream); + workbook.Close(); + } + string fileName = Path.GetFileName(newUrl); + FileInfo info = new FileInfo(newUrl); + long fileSize = info.Length; + Response.Clear(); + Response.ContentType = "application/x-zip-compressed"; + Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + Response.AddHeader("Content-Length", fileSize.ToString()); + Response.TransmitFile(newUrl, 0, fileSize); + Response.Flush(); + Response.Close(); + File.Delete(newUrl); + } + else + { + Alert.ShowInTop("当前无记录,无法导出!", MessageBoxIcon.Warning); + } + } + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + if (Request.Params["value"] == BLL.Const._Null) + { + return; + } + var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.ConTechnologyDisclosureMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + this.btnNew.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnMenuModify.Hidden = false; + this.Grid1.EnableRowDoubleClickEvent = true; + } + else + { + this.Grid1.EnableRowDoubleClickEvent = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnMenuDel.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnSave)) + { + this.btnImport.Hidden = false; + } + } + } + #endregion + } +} \ No newline at end of file diff --git a/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosure.aspx.designer.cs b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosure.aspx.designer.cs new file mode 100644 index 0000000..525d513 --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosure.aspx.designer.cs @@ -0,0 +1,242 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Comprehensive +{ + + + public partial class ConTechnologyDisclosure + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// panelLeftRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// ContentPanel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ContentPanel ContentPanel1; + + /// + /// ucTree 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Web.Controls.UnitProjectTControl ucTree; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// ToolSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar ToolSearch; + + /// + /// sdrpUnitId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList sdrpUnitId; + + /// + /// drpProfessionalId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpProfessionalId; + + /// + /// txtCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCode; + + /// + /// btnSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSearch; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// btnImport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnImport; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// lblPageIndex 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblPageIndex; + + /// + /// Label2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label2; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Window2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window2; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuModify 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuModify; + + /// + /// btnMenuDel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDel; + } +} diff --git a/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureDataIn.aspx b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureDataIn.aspx new file mode 100644 index 0000000..2a8aa7f --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureDataIn.aspx @@ -0,0 +1,68 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ConTechnologyDisclosureDataIn.aspx.cs" Inherits="FineUIPro.Web.CQMS.Comprehensive.ConTechnologyDisclosureDataIn" %> + + + + + + + 导入施工技术交底管理 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureDataIn.aspx.cs b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureDataIn.aspx.cs new file mode 100644 index 0000000..237223f --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureDataIn.aspx.cs @@ -0,0 +1,487 @@ +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 ConTechnologyDisclosureDataIn : 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], 9); + 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_ConTechnologyDisclosure + 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; + + for (int i = 1; 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 row3 = pds.Rows[i][3].ToString(); + if (string.IsNullOrEmpty(row3)) + { + result += (i + 2).ToString() + "," + "交底负责单位" + "," + "此项为必填项!" + "|"; + } + else + { + var unit = units.Where(x => x.UnitName == row3.Trim()).FirstOrDefault(); + if (unit == null) + { + result += (i + 2).ToString() + "," + "交底负责单位" + "," + "[" + row3 + "]不存在!" + "|"; + } + } + + string row5 = pds.Rows[i][5].ToString(); + if (!string.IsNullOrEmpty(row5)) + { + try + { + DateTime date = Convert.ToDateTime(row5.Trim()); + } + catch (Exception) + { + result += (i + 2).ToString() + "," + "交底日期" + "," + "[" + row5 + "]错误!" + "|"; + } + } + + string row6 = pds.Rows[i][6].ToString(); + if (!string.IsNullOrEmpty(row6)) + { + string[] reunit = row6.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 row8 = pds.Rows[i][8].ToString(); + if (string.IsNullOrEmpty(row8)) + { + result += (i + 2).ToString() + "," + "标志编号" + "," + "此项为必填项!" + "|"; + } + else + { + try + { + int t = Convert.ToInt32(row8); + } + catch (Exception) + { + result += (i + 2).ToString() + "," + "标识编号" + "," + "[" + row8 + "]错误!" + "|"; + } + } + } + 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], 10); + } + 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_ConTechnologyDisclosure + 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; + + for (int i = 1; i < ir; i++) + { + Model.Comprehensive_ConTechnologyDisclosure oldViewInfo = new Model.Comprehensive_ConTechnologyDisclosure(); + string row0 = pds.Rows[i][0].ToString().Trim(); + string row3 = pds.Rows[i][3].ToString().Trim(); + var cn = cns.Where(y => y.ProfessionalName == row0).FirstOrDefault(); + oldViewInfo = oldViewInfos.Where(x => x.RemarkCode ==Funs.GetNewInt( pds.Rows[i][8].ToString().Trim()) + ).FirstOrDefault(); + if (oldViewInfo == null) + { + Model.Comprehensive_ConTechnologyDisclosure des = new Model.Comprehensive_ConTechnologyDisclosure(); + des.ConTechnologyDisclosureId = SQLHelper.GetNewID(typeof(Model.Comprehensive_ConTechnologyDisclosure)); + des.ProjectId = this.CurrUser.LoginProjectId; + des.CNProfessionalId = cn.CNProfessionalId; + des.DisclosureCode = pds.Rows[i][1].ToString().Trim(); + des.DisclosureName= pds.Rows[i][2].ToString().Trim(); + des.UnitId = units.Where(x => x.UnitName == row3.Trim()).FirstOrDefault().UnitId; + des.DisclosureMan = pds.Rows[i][4].ToString().Trim(); + des.DisclosureDate = Funs.GetNewDateTime(pds.Rows[i][5].ToString().Trim()); + if (!string.IsNullOrEmpty(pds.Rows[i][6].ToString().Trim())) + { + des.UnitWorkId = BLL.UnitWorkService.GetUnitWorkIdsByUnitWorkNames(this.CurrUser.LoginProjectId, pds.Rows[i][6].ToString().Trim()); + } + des.AttendMan = pds.Rows[i][7].ToString().Trim(); + des.RemarkCode = Funs.GetNewInt(pds.Rows[i][8].ToString().Trim()); + des.DisclosurePersonNum = Funs.GetNewInt(pds.Rows[i][9].ToString().Trim()); + des.CompileMan = this.CurrUser.UserId; + des.CompileDate = DateTime.Now; + BLL.ConTechnologyDisclosureService.AddConTechnologyDisclosure(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.ConTechnologyDisclosureTemUrl; + string filePath = Const.ConTechnologyDisclosureTemUrl; + 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/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureDataIn.aspx.designer.cs b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureDataIn.aspx.designer.cs new file mode 100644 index 0000000..dd6eab0 --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureDataIn.aspx.designer.cs @@ -0,0 +1,123 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Comprehensive { + + + public partial class ConTechnologyDisclosureDataIn { + + /// + /// 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/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureDataInNew.aspx b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureDataInNew.aspx new file mode 100644 index 0000000..ae36403 --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureDataInNew.aspx @@ -0,0 +1,176 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ConTechnologyDisclosureDataInNew.aspx.cs" Inherits="FineUIPro.Web.CQMS.Comprehensive.ConTechnologyDisclosureDataInNew" %> + + + + + + + 导入施工技术交底 + + + + + + + +
+ + + + + + + + + + + <%----%> + + + + + + + + <%----%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureDataInNew.aspx.cs b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureDataInNew.aspx.cs new file mode 100644 index 0000000..d42945a --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureDataInNew.aspx.cs @@ -0,0 +1,545 @@ +using BLL; +using BLL.Common; +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 ConTechnologyDisclosureDataInNew : 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", "ConTechnologyDisclosure")); + 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 == "ConTechnologyDisclosure" + 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("ConTechnologyDisclosureDataInNewEdit.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("ConTechnologyDisclosureDataInNewEdit.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 = "ConTechnologyDisclosure"; + 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, "ConTechnologyDisclosure"); })); + 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_ConTechnologyDisclosure + 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 == "ConTechnologyDisclosure" + 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_ConTechnologyDisclosure Ins = new Model.Comprehensive_ConTechnologyDisclosure(); + if (!string.IsNullOrEmpty(tempData.Value1.Trim())) + { + var cn = cns.Where(x => x.ProfessionalName == tempData.Value1.Trim()).FirstOrDefault(); + if (cn == null) + { + errInfo += "专业[" + tempData.Value1.Trim() + "]不存在;"; + } + else + { + Ins.CNProfessionalId = cn.CNProfessionalId; + } + } + else + { + errInfo += "专业为必填项;"; + } + if (!string.IsNullOrEmpty(tempData.Value2.Trim())) + { + Ins.DisclosureCode = tempData.Value2.Trim(); + } + else + { + errInfo += "交底文件编号为必填项;"; + } + if (!string.IsNullOrEmpty(tempData.Value3.Trim())) + { + Ins.DisclosureName = tempData.Value3.Trim(); + } + if (!string.IsNullOrEmpty(tempData.Value4.Trim())) + { + var unit = units.FirstOrDefault(x => x.UnitName == tempData.Value4.Trim()); + if (unit == null) + { + errInfo += "交底负责单位[" + tempData.Value4.Trim() + "]不存在;"; + } + else + { + Ins.UnitId = unit.UnitId; + } + } + else + { + errInfo += "交底负责单位为必填项;"; + } + if (!string.IsNullOrEmpty(tempData.Value5.Trim())) + { + Ins.DisclosureMan = tempData.Value5.Trim(); + } + if (!string.IsNullOrEmpty(tempData.Value6.Trim())) + { + try + { + Ins.DisclosureDate = Funs.GetNewDateTime(tempData.Value6.Trim()); + if (Ins.DisclosureCode == null) + { + errInfo += "交底日期[" + tempData.Value6.Trim() + "]格式错误;"; + } + } + catch (Exception) + { + errInfo += "交底日期[" + tempData.Value6.Trim() + "]格式错误;"; + } + } + if (!string.IsNullOrEmpty(tempData.Value7.Trim())) + { + string unitIds = string.Empty; + string[] reunit = tempData.Value7.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.Value8.Trim())) + { + Ins.AttendMan = tempData.Value8.Trim(); + } + if (!string.IsNullOrEmpty(tempData.Value9.Trim())) + { + try + { + Ins.RemarkCode = Convert.ToInt32(tempData.Value9.Trim()); + if (Ins.RemarkCode == null) + { + errInfo += "标志编号[" + tempData.Value9.Trim() + "]格式错误;"; + } + } + catch (Exception) + { + errInfo += "标志编号[" + tempData.Value9.Trim() + "]格式错误;"; + } + } + else + { + errInfo += "标志编号为必填项;"; + } + if (!string.IsNullOrEmpty(tempData.Value10.Trim())) + { + try + { + Ins.DisclosurePersonNum = Convert.ToInt32(tempData.Value10.Trim()); + if (Ins.DisclosurePersonNum == null) + { + errInfo += "交底人数[" + tempData.Value10.Trim() + "]格式错误;"; + } + } + catch (Exception) + { + errInfo += "交底人数[" + tempData.Value10.Trim() + "]格式错误;"; + } + } + 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.Value9)); + if (isExitISOValue != null) ///已存在 + { + Ins.ConTechnologyDisclosureId = isExitISOValue.ConTechnologyDisclosureId; + BLL.ConTechnologyDisclosureService.UpdateConTechnologyDisclosure(Ins); + } + else + { + Ins.ConTechnologyDisclosureId = SQLHelper.GetNewID(typeof(Model.Comprehensive_ConTechnologyDisclosure)); + BLL.ConTechnologyDisclosureService.AddConTechnologyDisclosure(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, "ConTechnologyDisclosure"); + 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.ConTechnologyDisclosureTemUrl; + string filePath = Const.ConTechnologyDisclosureTemUrl; + 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/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureDataInNew.aspx.designer.cs b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureDataInNew.aspx.designer.cs new file mode 100644 index 0000000..9a62033 --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureDataInNew.aspx.designer.cs @@ -0,0 +1,251 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Comprehensive +{ + + + public partial class ConTechnologyDisclosureDataInNew + { + + /// + /// 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/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureDataInNewEdit.aspx b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureDataInNewEdit.aspx new file mode 100644 index 0000000..57bfb32 --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureDataInNewEdit.aspx @@ -0,0 +1,70 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ConTechnologyDisclosureDataInNewEdit.aspx.cs" Inherits="FineUIPro.Web.CQMS.Comprehensive.ConTechnologyDisclosureDataInNewEdit" %> + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureDataInNewEdit.aspx.cs b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureDataInNewEdit.aspx.cs new file mode 100644 index 0000000..24ef7bd --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureDataInNewEdit.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 ConTechnologyDisclosureDataInNewEdit : 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 == "ConTechnologyDisclosure" 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 = "ConTechnologyDisclosure"; + 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/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureDataInNewEdit.aspx.designer.cs b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureDataInNewEdit.aspx.designer.cs new file mode 100644 index 0000000..7c407b9 --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureDataInNewEdit.aspx.designer.cs @@ -0,0 +1,179 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Comprehensive +{ + + + public partial class ConTechnologyDisclosureDataInNewEdit + { + + /// + /// 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; + + /// + /// txtValue9 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue9; + + /// + /// txtValue10 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue10; + + /// + /// txtValue8 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtValue8; + + /// + /// ckAll 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.CheckBox ckAll; + + /// + /// lbErrCout 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea lbErrCout; + } +} diff --git a/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureEdit.aspx b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureEdit.aspx new file mode 100644 index 0000000..a34735d --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureEdit.aspx @@ -0,0 +1,66 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ConTechnologyDisclosureEdit.aspx.cs" Inherits="FineUIPro.Web.CQMS.Comprehensive.ConTechnologyDisclosureEdit" %> + + + + + + + 编辑施工技术交底管理 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + --%> + + + + + + <%----%> + + + diff --git a/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureEdit.aspx.cs b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureEdit.aspx.cs new file mode 100644 index 0000000..e0038e7 --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureEdit.aspx.cs @@ -0,0 +1,169 @@ +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 ConTechnologyDisclosureEdit : PageBase + { + #region 定义变量 + /// + /// 主键 + /// + public string ConTechnologyDisclosureId + { + get + { + return (string)ViewState["ConTechnologyDisclosureId"]; + } + set + { + ViewState["ConTechnologyDisclosureId"] = value; + } + } + #endregion + + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + GetButtonPower(); + BLL.UnitWorkService.InitUnitWorkDownList(this.drpUnitWorkIds, this.CurrUser.LoginProjectId, false); + BLL.UnitService.InitUnitDownList(this.drpUnitId, this.CurrUser.LoginProjectId, false); + BLL.CNProfessionalService.InitCNProfessionalDownList(this.drpCNProfessionalId, true); + + this.ConTechnologyDisclosureId = Request.Params["id"]; + Model.Comprehensive_ConTechnologyDisclosure con = BLL.ConTechnologyDisclosureService.GetConTechnologyDisclosureById(this.ConTechnologyDisclosureId); + if (con != null) + { + this.ConTechnologyDisclosureId = con.ConTechnologyDisclosureId; + if (!string.IsNullOrEmpty(con.CNProfessionalId)) + { + this.drpCNProfessionalId.SelectedValue = con.CNProfessionalId; + } + this.txtDisclosureCode.Text = con.DisclosureCode; + this.txtDisclosureName.Text = con.DisclosureName; + if (!string.IsNullOrEmpty(con.UnitId)) + { + this.drpUnitId.SelectedValue = con.UnitId; + } + this.txtDisclosureMan.Text = con.DisclosureMan; + this.txtDisclosureDate.Text = con.DisclosureDate.HasValue ? string.Format("{0:yyyy-MM-dd}", con.DisclosureDate) : ""; + if (!string.IsNullOrEmpty(con.UnitWorkId)) + { + this.drpUnitWorkIds.SelectedValueArray = con.UnitWorkId.Split(','); + } + this.txtAttendMan.Text = con.AttendMan; + this.txtRemarkCode.Text = con.RemarkCode.HasValue ? con.RemarkCode.ToString() : ""; + this.txtDisclosurePersonNum.Text = con.DisclosurePersonNum.HasValue ? con.DisclosurePersonNum.ToString() : ""; + } + else + { + this.txtDisclosureDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); + } + } + } + #endregion + + #region 保存 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + if (drpCNProfessionalId.SelectedValue == BLL.Const._Null) + { + Alert.ShowInTop("请选择专业!", MessageBoxIcon.Warning); + return; + } + if (this.drpUnitId.SelectedValue == BLL.Const._Null) + { + Alert.ShowInTop("请选择交底负责单位!", MessageBoxIcon.Warning); + return; + } + + var q = Funs.DB.Comprehensive_ConTechnologyDisclosure.FirstOrDefault(x => x.ProjectId == this.CurrUser.LoginProjectId && x.RemarkCode == Funs.GetNewInt(this.txtRemarkCode.Text.Trim()) && (x.ConTechnologyDisclosureId != this.ConTechnologyDisclosureId || (this.ConTechnologyDisclosureId == null && x.ConTechnologyDisclosureId != null))); + if (q != null) + { + Alert.ShowInTop("标志编号已存在!", MessageBoxIcon.Warning); + return; + } + + Model.Comprehensive_ConTechnologyDisclosure newCon = new Model.Comprehensive_ConTechnologyDisclosure(); + newCon.ProjectId = this.CurrUser.LoginProjectId; + newCon.CNProfessionalId = this.drpCNProfessionalId.SelectedValue; + newCon.DisclosureCode = this.txtDisclosureCode.Text.Trim(); + newCon.DisclosureName = this.txtDisclosureName.Text.Trim(); + newCon.UnitId = this.drpUnitId.SelectedValue; + newCon.DisclosureMan = this.txtDisclosureMan.Text.Trim(); + newCon.DisclosureDate = Funs.GetNewDateTime(this.txtDisclosureDate.Text.Trim()); + + string ids = string.Empty; + var lists = this.drpUnitWorkIds.SelectedValueArray; + foreach (var item in lists) + { + ids += item + ","; + } + if (!string.IsNullOrEmpty(ids)) + { + ids = ids.Substring(0, ids.LastIndexOf(",")); + } + newCon.UnitWorkId = ids; + newCon.AttendMan = this.txtAttendMan.Text.Trim(); + newCon.RemarkCode = Funs.GetNewInt(this.txtRemarkCode.Text.Trim()); + newCon.DisclosurePersonNum = Funs.GetNewInt(this.txtDisclosurePersonNum.Text.Trim()); + + if (string.IsNullOrEmpty(this.ConTechnologyDisclosureId)) + { + newCon.ConTechnologyDisclosureId = SQLHelper.GetNewID(typeof(Model.Comprehensive_ConTechnologyDisclosure)); + + newCon.CompileMan = this.CurrUser.UserId; + newCon.CompileDate = DateTime.Now; + BLL.ConTechnologyDisclosureService.AddConTechnologyDisclosure(newCon); + } + else + { + newCon.ConTechnologyDisclosureId = this.ConTechnologyDisclosureId; + BLL.ConTechnologyDisclosureService.UpdateConTechnologyDisclosure(newCon); + } + ShowNotify("保存成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + if (Request.Params["value"] == BLL.Const._Null) + { + return; + } + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ConTechnologyDisclosureMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnSave)) + { + this.btnSave.Hidden = false; + } + } + } + #endregion + } +} \ No newline at end of file diff --git a/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureEdit.aspx.designer.cs b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureEdit.aspx.designer.cs new file mode 100644 index 0000000..5675225 --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ConTechnologyDisclosureEdit.aspx.designer.cs @@ -0,0 +1,152 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Comprehensive +{ + + + public partial class ConTechnologyDisclosureEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// drpCNProfessionalId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpCNProfessionalId; + + /// + /// txtDisclosureCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDisclosureCode; + + /// + /// txtDisclosureName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDisclosureName; + + /// + /// drpUnitId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpUnitId; + + /// + /// txtDisclosureMan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDisclosureMan; + + /// + /// txtDisclosureDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtDisclosureDate; + + /// + /// drpUnitWorkIds 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpUnitWorkIds; + + /// + /// txtRemarkCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtRemarkCode; + + /// + /// txtDisclosurePersonNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtDisclosurePersonNum; + + /// + /// txtAttendMan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtAttendMan; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + } +} diff --git a/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/QualityAssurance.aspx b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/QualityAssurance.aspx new file mode 100644 index 0000000..0b8702f --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/QualityAssurance.aspx @@ -0,0 +1,137 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="QualityAssurance.aspx.cs" Inherits="FineUIPro.Web.CQMS.Comprehensive.QualityAssurance" %> +<%@ Register Src="~/Controls/UnitProjectTControl.ascx" TagName="UnitProjectTControl" TagPrefix="uc1" %> + + + + + + + 特设质保体系 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/QualityAssurance.aspx.cs b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/QualityAssurance.aspx.cs new file mode 100644 index 0000000..f5120d0 --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/QualityAssurance.aspx.cs @@ -0,0 +1,286 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.CQMS.Comprehensive +{ + public partial class QualityAssurance : PageBase + { + #region 项目主键 + /// + /// 项目主键 + /// + public string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + #endregion + + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + Funs.DropDownPageSize(this.ddlPageSize); + //活动类型 + this.ProjectId = this.CurrUser.LoginProjectId; + if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId) + { + this.ProjectId = Request.Params["projectId"]; + } + + this.ucTree.UnitId = this.CurrUser.UnitId; + this.ucTree.ProjectId = this.ProjectId; + + if (this.CurrUser != null && this.CurrUser.PageSize.HasValue) + { + Grid1.PageSize = this.CurrUser.PageSize.Value; + } + this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + //类别 + this.drpType.DataValueField = "Value"; + this.drpType.DataTextField = "Text"; + this.drpType.DataSource = BLL.DropListService.drpQualityAssuranceTypeList(); + this.drpType.DataBind(); + Funs.FineUIPleaseSelect(this.drpType); + // 绑定表格 + this.BindGrid(); + if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) + { + this.panelLeftRegion.Hidden = true; + // this.Grid1.Columns[0].Hidden = true; + ////权限按钮方法 + this.GetButtonPower(); + } + } + } + protected void changeTree(object sender, EventArgs e) + { + this.ProjectId = this.ucTree.ProjectId; + this.BindGrid(); + + this.GetButtonPower(); + if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) + { + this.btnNew.Hidden = true; + this.btnMenuEdit.Hidden = true; + this.btnMenuDelete.Hidden = true; + } + } + + /// + /// 绑定数据 + /// + private void BindGrid() + { + if (!string.IsNullOrEmpty(this.ProjectId) || !string.IsNullOrEmpty(ucTree.UnitId)) + { + string strSql = @"SELECT C.QualityAssuranceId, + C.ProjectId, + C.QualityAssuranceCode, + C.QualityAssuranceName, + C.QualityAssuranceType, + C.ContentTexts, + C.CompileMan, + C.CompileDate, + U.UserName AS CompileManName + FROM Comprehensive_QualityAssurance C + LEFT JOIN Sys_User U ON U.UserId = C.CompileMan where 1=1"; + List listStr = new List(); + if (!string.IsNullOrEmpty(this.ProjectId)) + { + strSql += " AND C.ProjectId = @projectId"; + listStr.Add(new SqlParameter("@projectId", this.ProjectId)); + } + if (!string.IsNullOrEmpty(this.txtCode.Text.Trim())) + { + strSql += " AND C.QualityAssuranceCode LIKE @code"; + listStr.Add(new SqlParameter("@code", this.txtCode.Text.Trim())); + } + if (!string.IsNullOrEmpty(this.txtName.Text.Trim())) + { + strSql += " AND C.QualityAssuranceName LIKE @name"; + listStr.Add(new SqlParameter("@name", this.txtName.Text.Trim())); + } + if (this.drpType.SelectedValue != BLL.Const._Null) + { + strSql += " AND C.QualityAssuranceType = @type"; + listStr.Add(new SqlParameter("@type", this.drpType.SelectedValue)); + } + 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(); + } + } + + #region 分页 排序 + /// + /// 改变索引事件 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + BindGrid(); + } + + /// + /// 分页下拉选择事件 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue); + BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e) + { + this.BindGrid(); + } + #endregion + #endregion + + #region 查询 + /// + /// 查询 + /// + /// + /// + protected void TextBox_TextChanged(object sender, EventArgs e) + { + this.BindGrid(); + } + #endregion + + #region 编辑 + /// + /// 双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + this.EditData(); + } + protected void btnNew_OnClick(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("QualityAssuranceEdit.aspx"))); + } + + /// + /// 右键编辑事件 + /// + /// + /// + protected void btnMenuEdit_Click(object sender, EventArgs e) + { + this.EditData(); + } + + /// + /// 编辑数据方法 + /// + private void EditData() + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("QualityAssuranceEdit.aspx?qualityAssuranceId={0}", Grid1.SelectedRowID, "编辑 - "))); + } + #endregion + + #region 删除 + /// + /// 右键删除事件 + /// + /// + /// + protected void btnMenuDelete_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length > 0) + { + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + var getV = BLL.QualityAssuranceService.GetQualityAssuranceById(rowID); + if (getV != null) + { + BLL.LogService.AddSys_Log(this.CurrUser, getV.QualityAssuranceCode, getV.QualityAssuranceId, Const.CQMS_QualityAssuranceMenuId, BLL.Const.BtnDelete); + BLL.QualityAssuranceService.DeleteQualityAssuranceById(rowID); + } + } + this.BindGrid(); + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + } + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + if (Request.Params["value"] == "0") + { + return; + } + if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId) && !string.IsNullOrEmpty(this.ProjectId)) + { + this.btnNew.Hidden = true; + this.btnMenuDelete.Hidden = true; + return; + } + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.CQMS_QualityAssuranceMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + this.btnNew.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnMenuEdit.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnMenuDelete.Hidden = false; + } + } + } + #endregion + } +} \ No newline at end of file diff --git a/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/QualityAssurance.aspx.designer.cs b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/QualityAssurance.aspx.designer.cs new file mode 100644 index 0000000..f32e882 --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/QualityAssurance.aspx.designer.cs @@ -0,0 +1,224 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Comprehensive +{ + + + public partial class QualityAssurance + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// panelLeftRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// ContentPanel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ContentPanel ContentPanel1; + + /// + /// ucTree 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Web.Controls.UnitProjectTControl ucTree; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// txtCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCode; + + /// + /// txtName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtName; + + /// + /// drpType 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpType; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// lblNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblNumber; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// WindowAtt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowAtt; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuEdit; + + /// + /// btnMenuDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDelete; + } +} diff --git a/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/QualityAssuranceEdit.aspx b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/QualityAssuranceEdit.aspx new file mode 100644 index 0000000..9247bcf --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/QualityAssuranceEdit.aspx @@ -0,0 +1,72 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="QualityAssuranceEdit.aspx.cs" Inherits="FineUIPro.Web.CQMS.Comprehensive.QualityAssuranceEdit" ValidateRequest="false" %> + + + + + + + 编辑特设质保体系 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/QualityAssuranceEdit.aspx.cs b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/QualityAssuranceEdit.aspx.cs new file mode 100644 index 0000000..395fc43 --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/QualityAssuranceEdit.aspx.cs @@ -0,0 +1,201 @@ +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 QualityAssuranceEdit : PageBase + { + #region 定义项 + /// + /// 主键 + /// + public string QualityAssuranceId + { + get + { + return (string)ViewState["QualityAssuranceId"]; + } + set + { + ViewState["QualityAssuranceId"] = value; + } + } + /// + /// 项目主键 + /// + public string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + + /// + /// 主键 + /// + //public string UnitId + //{ + // get + // { + // return (string)ViewState["UnitId"]; + // } + // set + // { + // ViewState["UnitId"] = value; + // } + //} + #endregion + + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.ProjectId = this.CurrUser.LoginProjectId; + //this.UnitId = Request.Params["UnitId"]; + this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); + this.InitDropDownList(); + + this.QualityAssuranceId = Request.Params["QualityAssuranceId"]; + if (!string.IsNullOrEmpty(this.QualityAssuranceId)) + { + var getData = BLL.QualityAssuranceService.GetQualityAssuranceById(this.QualityAssuranceId); + if (getData != null) + { + this.ProjectId = getData.ProjectId; + //this.UnitId = getData.UnitId; + if (this.ProjectId != this.CurrUser.LoginProjectId) + { + this.InitDropDownList(); + } + this.txtCode.Text = getData.QualityAssuranceCode; + this.txtName.Text = getData.QualityAssuranceName; + if (!string.IsNullOrEmpty(getData.QualityAssuranceType)) + { + this.drpType.SelectedValue = getData.QualityAssuranceType; + } + this.txtContents.Text = HttpUtility.HtmlDecode(getData.ContentTexts); + if (!string.IsNullOrEmpty(getData.CompileMan)) + { + this.drpCompileMan.SelectedValue = getData.CompileMan; + } + this.txtCompileDate.Text = getData.CompileDate.HasValue ? string.Format("{0:yyyy-MM-dd}", getData.CompileDate) : ""; + } + } + else + { + this.drpCompileMan.SelectedValue = this.CurrUser.UserId; + this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); + //var codeTemplateRule = BLL.ProjectData_CodeTemplateRuleService.GetProjectData_CodeTemplateRuleByMenuIdProjectId(BLL.Const.ProjectThemeActivitiesMenuId, this.ProjectId); + //if (codeTemplateRule != null) + //{ + // this.txtContents.Text = HttpUtility.HtmlDecode(codeTemplateRule.Template); + //} + } + } + } + #endregion + + /// + /// 初始化下拉框 + /// + private void InitDropDownList() + { + //类别 + this.drpType.DataValueField = "Value"; + this.drpType.DataTextField= "Text"; + this.drpType.DataSource= BLL.DropListService.drpQualityAssuranceTypeList(); + this.drpType.DataBind(); + Funs.FineUIPleaseSelect(this.drpType); + + UserService.InitUserDropDownList(this.drpCompileMan, this.ProjectId, true); + this.drpCompileMan.SelectedValue = this.CurrUser.UserId; + } + + #region 保存 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + if (this.drpType.SelectedValue==BLL.Const._Null) + { + Alert.ShowInTop("请选择类别", MessageBoxIcon.Warning); + return; + } + this.SaveData(BLL.Const.BtnSave); + PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); + } + + /// + /// 保存数据 + /// + /// + private void SaveData(string type) + { + Model.Comprehensive_QualityAssurance newData = new Model.Comprehensive_QualityAssurance + { + ProjectId = this.ProjectId, + QualityAssuranceCode = this.txtCode.Text.Trim(), + QualityAssuranceName = this.txtName.Text.Trim(), + CompileDate = Funs.GetNewDateTime(this.txtCompileDate.Text.Trim()), + }; + if (this.drpType.SelectedValue != BLL.Const._Null) + { + newData.QualityAssuranceType = this.drpType.SelectedValue; + } + if (this.drpCompileMan.SelectedValue != BLL.Const._Null) + { + newData.CompileMan = this.drpCompileMan.SelectedValue; + } + newData.ContentTexts = HttpUtility.HtmlEncode(this.txtContents.Text); + if (!string.IsNullOrEmpty(this.QualityAssuranceId)) + { + newData.QualityAssuranceId = this.QualityAssuranceId; + BLL.QualityAssuranceService.UpdateQualityAssurance(newData); + BLL.LogService.AddSys_Log(this.CurrUser, newData.QualityAssuranceCode, newData.QualityAssuranceId, BLL.Const.CQMS_QualityAssuranceMenuId, BLL.Const.BtnModify); + } + else + { + this.QualityAssuranceId = SQLHelper.GetNewID(typeof(Model.Comprehensive_QualityAssurance)); + newData.QualityAssuranceId = this.QualityAssuranceId; + BLL.QualityAssuranceService.AddQualityAssurance(newData); + BLL.LogService.AddSys_Log(this.CurrUser, newData.QualityAssuranceCode, newData.QualityAssuranceId, BLL.Const.CQMS_QualityAssuranceMenuId, BLL.Const.BtnAdd); + } + } + #endregion + + #region 附件上传 + /// + /// 上传附件 + /// + /// + /// + protected void btnAttachUrl_Click(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(this.QualityAssuranceId)) + { + SaveData(BLL.Const.BtnSave); + } + PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/QualityAssuranceAttachUrl&menuId={1}", QualityAssuranceId, BLL.Const.CQMS_QualityAssuranceMenuId))); + } + #endregion + } +} \ No newline at end of file diff --git a/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/QualityAssuranceEdit.aspx.designer.cs b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/QualityAssuranceEdit.aspx.designer.cs new file mode 100644 index 0000000..4d9a5e0 --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/QualityAssuranceEdit.aspx.designer.cs @@ -0,0 +1,152 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Comprehensive +{ + + + public partial class QualityAssuranceEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// txtCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCode; + + /// + /// txtName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtName; + + /// + /// drpType 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpType; + + /// + /// drpCompileMan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpCompileMan; + + /// + /// txtCompileDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtCompileDate; + + /// + /// Label1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label1; + + /// + /// txtContents 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HtmlEditor txtContents; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// btnAttachUrl 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAttachUrl; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + + /// + /// WindowAtt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowAtt; + } +} diff --git a/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawings.aspx b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawings.aspx new file mode 100644 index 0000000..a4cac2b --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawings.aspx @@ -0,0 +1,152 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ReviewDrawings.aspx.cs" Inherits="FineUIPro.Web.CQMS.Comprehensive.ReviewDrawings" %> + +<%@ Register Src="~/Controls/UnitProjectTControl.ascx" TagName="UnitProjectTControl" TagPrefix="uc1" %> + + + + + + + 图纸会审管理 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + + + + --%> + <%----%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawings.aspx.cs b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawings.aspx.cs new file mode 100644 index 0000000..37ee6ea --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawings.aspx.cs @@ -0,0 +1,513 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Linq; + +namespace FineUIPro.Web.CQMS.Comprehensive +{ + public partial class ReviewDrawings : PageBase + { + #region 项目主键 + /// + /// 项目主键 + /// + public string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + #endregion + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + //Funs.DropDownPageSize(this.ddlPageSize); + this.ProjectId = this.CurrUser.LoginProjectId; + if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId) + { + this.ProjectId = Request.Params["projectId"]; + } + this.ucTree.UnitId = this.CurrUser.UnitId; + this.ucTree.ProjectId = this.ProjectId; + if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) + { + this.panelLeftRegion.Hidden = true; + ////权限按钮方法 + this.GetButtonPower(); + } + BLL.CNProfessionalService.InitCNProfessionalDownList(this.sdrpCNProfessionalId, true); + BindGrid(); + } + } + /// + /// 公司级树加载 + /// + /// + /// + protected void changeTree(object sender, EventArgs e) + { + this.ProjectId = this.ucTree.ProjectId; + this.BindGrid(); + + this.GetButtonPower(); + if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) + { + btnNew.Hidden = true; + btnImport.Hidden = true; + } + } + /// + /// 数据绑定 + /// + public void BindGrid() + { + if (string.IsNullOrEmpty(this.ProjectId)) + { + return; + } + string strSql = @"SELECT C.*,CN.ProfessionalName" + + @" FROM Comprehensive_ReviewDrawings C " + + @" LEFT JOIN Base_CNProfessional CN ON C.CNProfessionalId=CN.CNProfessionalId" + + @" WHERE C.ProjectId = @ProjectId"; + List listStr = new List(); + listStr.Add(new SqlParameter("@ProjectId", this.ProjectId)); + + if (sdrpCNProfessionalId.SelectedValue != BLL.Const._Null) + { + strSql += " AND C.CNProfessionalId=@CNProfessionalId"; + listStr.Add(new SqlParameter("@CNProfessionalId", sdrpCNProfessionalId.SelectedValue)); + } + if (!string.IsNullOrEmpty(this.txtDraCode.Text.Trim())) + { + strSql += " AND C.DraCode='" + txtDraCode.Text.Trim() + "'"; + + } + + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + Grid1.RecordCount = tb.Rows.Count; + //tb = GetFilteredTable(Grid1.FilteredData, tb); + var table = this.GetPagedDataTable(Grid1, tb); + Grid1.DataSource = table; + Grid1.DataBind(); + } + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + if (Request.Params["value"] == BLL.Const._Null) + { + return; + } + var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.ReviewDrawingsMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + this.btnNew.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnMenuModify.Hidden = false; + this.Grid1.EnableRowDoubleClickEvent = true; + } + else + { + this.Grid1.EnableRowDoubleClickEvent = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnMenuDel.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnSave)) + { + this.btnImport.Hidden = false; + } + } + } + #endregion + + #region 查询 + /// + /// 查询 + /// + /// + /// + protected void btnSearch_Click(object sender, EventArgs e) + { + BindGrid(); + } + #endregion + + #region 分页、排序 + /// + /// 分页下拉 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + Grid1.SortDirection = e.SortDirection; + Grid1.SortField = e.SortField; + BindGrid(); + } + + /// + /// 分页 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + BindGrid(); + } + #endregion + + #region 新增 + /// + /// 新增按钮事件 + /// + /// + /// + protected void btnNew_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ReviewDrawingsEdit.aspx", "编辑 - "))); + } + #endregion + + #region 编辑 + /// + /// 右键修改 + /// + /// + /// + protected void btnMenuModify_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录", MessageBoxIcon.Warning); + return; + } + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ReviewDrawingsEdit.aspx?Id={0}", Grid1.SelectedRowID, "编辑 - "))); + } + + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + this.btnMenuModify_Click(sender, e); + } + #endregion + + #region 删除 + /// + /// 右键删除 + /// + /// + /// + protected void btnMenuDel_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length > 0) + { + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + var InspectionPerson = BLL.ReviewDrawingsService.Detail(rowID); + if (InspectionPerson != null) + { + BLL.ReviewDrawingsService.Delete(rowID); + } + } + BindGrid(); + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + } + #endregion + + #region 关闭弹出窗口 + /// + /// 关闭弹出窗口 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + } + #endregion + + #region 格式化字符串 + /// + /// 获取单位工程名称 + /// + /// + /// + protected string ConvertUnitWork(object CarryUnitWorks) + { + string CarryUnitWorkName = string.Empty; + if (CarryUnitWorks != null) + { + string[] Ids = CarryUnitWorks.ToString().Split(','); + foreach (string t in Ids) + { + var UnitWork = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(t); + if (UnitWork != null) + { + CarryUnitWorkName += UnitWork.UnitWorkName + ","; + } + } + } + if (CarryUnitWorkName != string.Empty) + { + return CarryUnitWorkName.Substring(0, CarryUnitWorkName.Length - 1); + } + else + { + return ""; + } + } + + /// + /// 获取单位名称 + /// + /// + /// + protected string ConvertCarryUnit(object CarryUnitIds) + { + string CarryUnitName = string.Empty; + if (CarryUnitIds != null) + { + string[] Ids = CarryUnitIds.ToString().Split(','); + foreach (string t in Ids) + { + var type = BLL.UnitService.GetUnitByUnitId(t); + if (type != null) + { + CarryUnitName += type.UnitName + ","; + } + } + } + if (CarryUnitName != string.Empty) + { + return CarryUnitName.Substring(0, CarryUnitName.Length - 1); + } + else + { + return ""; + } + } + #endregion + + public static string ConvertState(object Status) + { + if (Status != null) + { + if (Status.ToString().Trim() == BLL.Const.Comprehensive_ReCompile) + { + return "重报"; + } + else if (Status.ToString().Trim() == BLL.Const.Comprehensive_ReJect) + { + return "驳回"; + } + else if (Status.ToString().Trim() == BLL.Const.Comprehensive_Compile) + { + return "编制"; + } + else if (Status.ToString().Trim() == BLL.Const.Comprehensive_Audit) + { + return "待审批"; + } + else if (Status.ToString().Trim() == BLL.Const.Comprehensive_Complete) + { + return "审批完成"; + } + } + + return "编制"; + } + + + + #region 导入 + /// + /// 导入按钮 + /// + /// + /// + protected void btnImport_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("ReviewDrawingsDataInNew.aspx", "导入 - "))); + } + #endregion + + #region 导出按钮 + /// 导出按钮 + /// + /// + /// + protected void btnOut_Click(object sender, EventArgs e) + { + string rootPath = Server.MapPath("~/"); + string initTemplatePath = Const.ReviewDrawingsTemplateUrl; + string uploadfilepath = string.Empty; + string newUrl = string.Empty; + uploadfilepath = rootPath + initTemplatePath; + + var lists = (from x in Funs.DB.Comprehensive_ReviewDrawings + where x.ProjectId == this.ProjectId + select x); + if (sdrpCNProfessionalId.SelectedValue != BLL.Const._Null) + { + lists = lists.Where(x => x.CNProfessionalId == sdrpCNProfessionalId.SelectedValue); + } + if (!string.IsNullOrEmpty(this.txtDraCode.Text.Trim())) + { + lists = lists.Where(x => x.DraCode.Contains(this.txtDraCode.Text.Trim())); + } + lists = lists.OrderBy(x => x.RemarkCode); + if (lists != null) + { + string projectName = BLL.ProjectService.GetShortNameByProjectId(this.ProjectId); + newUrl = uploadfilepath.Replace("图纸会审管理导入模板", "图纸会审管理(" + projectName + DateTime.Now.ToString("yyyyMMdd") + ")"); + if (File.Exists(newUrl)) + { + File.Delete(newUrl); + } + File.Copy(uploadfilepath, newUrl); + // 第一步:读取文件流 + NPOI.SS.UserModel.IWorkbook workbook; + using (FileStream stream = new FileStream(newUrl, FileMode.Open, FileAccess.Read)) + { + //workbook = new NPOI.XSSF.UserModel.XSSFWorkbook(stream); + workbook = new NPOI.HSSF.UserModel.HSSFWorkbook(stream); + } + // 创建单元格样式 + NPOI.SS.UserModel.ICellStyle cellStyle = workbook.CreateCellStyle(); + cellStyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin; + cellStyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin; + cellStyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin; + cellStyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin; + cellStyle.Alignment = NPOI.SS.UserModel.HorizontalAlignment.Center; + cellStyle.VerticalAlignment = NPOI.SS.UserModel.VerticalAlignment.Center; + cellStyle.WrapText = true;//自动换行 + var font = workbook.CreateFont(); + font.FontHeightInPoints = 11; + cellStyle.SetFont(font); + // 第二步:创建新数据行 + NPOI.SS.UserModel.ISheet sheet = workbook.GetSheetAt(0); + NPOI.SS.UserModel.IRow row = sheet.GetRow(0); + NPOI.SS.UserModel.ICell cell; + int i = 2; + foreach (var item in lists) + { + // 第二步:创建新数据行 + row = sheet.CreateRow(i); + // 添加数据 + cell = row.CreateCell(0); + cell.CellStyle = cellStyle; + string proName = string.Empty; + var cnp = BLL.CNProfessionalService.GetCNProfessional(item.CNProfessionalId); + if (cnp != null) + { + proName = cnp.ProfessionalName; + } + cell.SetCellValue(proName);//专业 + + cell = row.CreateCell(1); + cell.CellStyle = cellStyle; + cell.SetCellValue(item.DraCode);//编号 + + cell = row.CreateCell(2); + cell.CellStyle = cellStyle; + string unitWorkName = string.Empty; + if (!string.IsNullOrEmpty(item.UnitWorkId)) + { + unitWorkName = ConvertUnitWork(item.UnitWorkId); + } + cell.SetCellValue(unitWorkName);//单位工程 + + cell = row.CreateCell(3); + cell.CellStyle = cellStyle; + cell.SetCellValue(item.ReviewDate.HasValue ? string.Format("{0:yyyy-MM-dd}", item.ReviewDate) : "");//图纸会审日期 + + cell = row.CreateCell(4); + cell.CellStyle = cellStyle; + string unitName = string.Empty; + if (!string.IsNullOrEmpty(item.ReceiveUnits)) + { + unitName = ConvertCarryUnit(item.ReceiveUnits); + } + cell.SetCellValue(unitName);//参加单位 + + cell = row.CreateCell(5); + cell.CellStyle = cellStyle; + cell.SetCellValue(item.Remarks);//备注 + + cell = row.CreateCell(6); + cell.CellStyle = cellStyle; + cell.SetCellValue(item.RemarkCode.HasValue ? item.RemarkCode.ToString() : "");//标志编号 + + i++; + } + // 第三步:写入文件流 + using (FileStream stream = new FileStream(newUrl, FileMode.Create, FileAccess.Write)) + { + workbook.Write(stream); + workbook.Close(); + } + string fileName = Path.GetFileName(newUrl); + FileInfo info = new FileInfo(newUrl); + long fileSize = info.Length; + Response.Clear(); + Response.ContentType = "application/x-zip-compressed"; + Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8)); + Response.AddHeader("Content-Length", fileSize.ToString()); + Response.TransmitFile(newUrl, 0, fileSize); + Response.Flush(); + Response.Close(); + File.Delete(newUrl); + } + else + { + Alert.ShowInTop("当前无记录,无法导出!", MessageBoxIcon.Warning); + } + } + #endregion + } +} \ No newline at end of file diff --git a/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawings.aspx.designer.cs b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawings.aspx.designer.cs new file mode 100644 index 0000000..dccc48d --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawings.aspx.designer.cs @@ -0,0 +1,260 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Comprehensive +{ + + + public partial class ReviewDrawings + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// panelLeftRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// ContentPanel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ContentPanel ContentPanel1; + + /// + /// ucTree 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Web.Controls.UnitProjectTControl ucTree; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// ToolSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar ToolSearch; + + /// + /// sdrpCNProfessionalId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList sdrpCNProfessionalId; + + /// + /// txtDraCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDraCode; + + /// + /// btnSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSearch; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// btnImport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnImport; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// lblPageIndex 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblPageIndex; + + /// + /// Label2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label2; + + /// + /// Label3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label Label3; + + /// + /// lbtnFileUrl 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.LinkButton lbtnFileUrl; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Window2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window2; + + /// + /// WindowAtt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowAtt; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuModify 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuModify; + + /// + /// btnMenuDel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDel; + } +} diff --git a/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataIn.aspx b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataIn.aspx new file mode 100644 index 0000000..ed085e0 --- /dev/null +++ b/SUBQHSE/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/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataIn.aspx.cs b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataIn.aspx.cs new file mode 100644 index 0000000..baf711e --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataIn.aspx.cs @@ -0,0 +1,494 @@ +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 || x.SuperUnitWork == 0) + select x; + + for (int i = 1; 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() + "," + "标志编号" + "," + "此项为必填项!" + "|"; + } + else + { + try + { + int t = Convert.ToInt32(row6); + } + catch (Exception) + { + result += (i + 2).ToString() + "," + "标志编号" + "," + "[" + row6 + "]错误!" + "|"; + } + } + } + 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 || x.SuperUnitWork == 0) + select x; + + for (int i = 1; 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 == Funs.GetNewInt(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 = Funs.GetNewInt(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/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataIn.aspx.designer.cs b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataIn.aspx.designer.cs new file mode 100644 index 0000000..12a7755 --- /dev/null +++ b/SUBQHSE/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/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataInNew.aspx b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataInNew.aspx new file mode 100644 index 0000000..993b618 --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataInNew.aspx @@ -0,0 +1,166 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ReviewDrawingsDataInNew.aspx.cs" Inherits="FineUIPro.Web.CQMS.Comprehensive.ReviewDrawingsDataInNew" %> + + + + + + + + + + + + + +
+ + + + + + + + + + + <%----%> + + + + + + + + <%----%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataInNew.aspx.cs b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataInNew.aspx.cs new file mode 100644 index 0000000..963c905 --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataInNew.aspx.cs @@ -0,0 +1,530 @@ +using BLL; +using BLL.Common; +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 ReviewDrawingsDataInNew : 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", "ReviewDrawings")); + 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 == "ReviewDrawings" + 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("ReviewDrawingsDataInNewEdit.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("ReviewDrawingsDataInNewEdit.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 = "ReviewDrawings"; + 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(); + + 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, "ReviewDrawings"); })); + 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_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 || x.SuperUnitWork == 0) + select x; + + var dataInTemp = from x in Funs.DB.Sys_CQMS_DataInTemp + where x.ProjectId == LoginProjectId && x.UserId == UserId && x.Type == "ReviewDrawings" + 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_ReviewDrawings Ins = new Model.Comprehensive_ReviewDrawings(); + if (!string.IsNullOrEmpty(tempData.Value1.Trim())) + { + var cn = cns.Where(x => x.ProfessionalName == tempData.Value1.Trim()).FirstOrDefault(); + if (cn == null) + { + errInfo += "专业[" + tempData.Value1.Trim() + "]不存在;"; + } + else + { + Ins.CNProfessionalId = cn.CNProfessionalId; + } + } + else + { + errInfo += "专业为必填项;"; + } + if (!string.IsNullOrEmpty(tempData.Value2.Trim())) + { + Ins.DraCode = tempData.Value2.Trim(); + } + 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())) + { + try + { + Ins.ReviewDate = Funs.GetNewDateTime(tempData.Value4.Trim()); + if (Ins.ReviewDate == null) + { + errInfo += "图纸会审日期[" + tempData.Value4.Trim() + "]错误;"; + } + } + catch (Exception) + { + errInfo += "图纸会审日期[" + tempData.Value4.Trim() + "]错误;"; + } + } + else + { + errInfo += "图纸会审日期为必填项;"; + } + if (!string.IsNullOrEmpty(tempData.Value5.Trim())) + { + string unitIds = string.Empty; + string[] reunit = tempData.Value5.Trim().Split(','); + foreach (string unitName in reunit) + { + var u = units.Where(x => x.UnitName == unitName.Trim()).FirstOrDefault(); + if (u == null) + { + errInfo += "参加单位[" + unitName.Trim() + "]不存在;"; + } + else + { + var q = BLL.UnitService.getUnitByUnitName(unitName.Trim()).UnitId; + unitIds += q + ","; + } + } + if (!string.IsNullOrEmpty(unitIds)) + { + unitIds = unitIds.Substring(0, unitIds.LastIndexOf(",")); + } + Ins.ReceiveUnits = unitIds; + } + if (!string.IsNullOrEmpty(tempData.Value6.Trim())) + { + Ins.Remarks = tempData.Value6.Trim(); + } + if (!string.IsNullOrEmpty(tempData.Value7.Trim())) + { + try + { + Ins.RemarkCode = Convert.ToInt32(tempData.Value7.Trim()); + if (Ins.RemarkCode == null) + { + errInfo += "标志编号[" + tempData.Value7.Trim() + "]格式错误;"; + } + } + catch (Exception) + { + errInfo += "标志编号[" + tempData.Value7.Trim() + "]格式错误;"; + } + } + else + { + errInfo += "标志编号为必填项;"; + } + Ins.CreateMan = this.CurrUser.UserId; + Ins.CreateDate = DateTime.Now.Date; + if (string.IsNullOrEmpty(errInfo)) ////所有信息正确的话 插入数据 + { + Ins.ProjectId = LoginProjectId; + var isExitISOValue = oldViewInfos.FirstOrDefault(x => x.RemarkCode == Funs.GetNewIntOrZero(tempData.Value7)); + if (isExitISOValue != null) ///已存在 + { + Ins.Id = isExitISOValue.Id; + BLL.ReviewDrawingsService.Update(Ins); + } + else + { + Ins.Id = SQLHelper.GetNewID(typeof(Model.Comprehensive_ReviewDrawings)); + BLL.ReviewDrawingsService.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, "ReviewDrawings"); + 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.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 + + 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/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataInNew.aspx.designer.cs b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataInNew.aspx.designer.cs new file mode 100644 index 0000000..194c954 --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataInNew.aspx.designer.cs @@ -0,0 +1,251 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Comprehensive +{ + + + public partial class ReviewDrawingsDataInNew + { + + /// + /// 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/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataInNewEdit.aspx b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataInNewEdit.aspx new file mode 100644 index 0000000..38d6378 --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataInNewEdit.aspx @@ -0,0 +1,60 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ReviewDrawingsDataInNewEdit.aspx.cs" Inherits="FineUIPro.Web.CQMS.Comprehensive.ReviewDrawingsDataInNewEdit" %> + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataInNewEdit.aspx.cs b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataInNewEdit.aspx.cs new file mode 100644 index 0000000..f69f8ef --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataInNewEdit.aspx.cs @@ -0,0 +1,179 @@ +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 ReviewDrawingsDataInNewEdit : 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.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 == "ReviewDrawings" 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(); + } + } + } + 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 = "ReviewDrawings"; + 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(); + 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/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataInNewEdit.aspx.designer.cs b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataInNewEdit.aspx.designer.cs new file mode 100644 index 0000000..4b5c1b0 --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsDataInNewEdit.aspx.designer.cs @@ -0,0 +1,152 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Comprehensive +{ + + + public partial class ReviewDrawingsDataInNewEdit + { + + /// + /// 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; + + /// + /// ckAll 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.CheckBox ckAll; + + /// + /// lbErrCout 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea lbErrCout; + } +} diff --git a/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsEdit.aspx b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsEdit.aspx new file mode 100644 index 0000000..aa10b6d --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsEdit.aspx @@ -0,0 +1,103 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ReviewDrawingsEdit.aspx.cs" Inherits="FineUIPro.Web.CQMS.Comprehensive.ReviewDrawingsEdit" %> + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + + + + + + + + + + + + + + + + + + + + + + + + --%> + + + + + + + + + + + <%-- + --%> + + + + + + + + diff --git a/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsEdit.aspx.cs b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsEdit.aspx.cs new file mode 100644 index 0000000..1193dbc --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsEdit.aspx.cs @@ -0,0 +1,471 @@ +using BLL; +using BLL.CQMS.Comprehensive; +using System; +using System.Linq; + +namespace FineUIPro.Web.CQMS.Comprehensive +{ + public partial class ReviewDrawingsEdit : PageBase + { + #region 定义变量 + /// + /// 主键 + /// + public string Id + { + get + { + return (string)ViewState["Id"]; + } + set + { + ViewState["Id"] = value; + } + } + #endregion + + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + GetButtonPower(); + BLL.CNProfessionalService.InitCNProfessionalDownList(this.drpCNProfessionalId, true); + BLL.UnitWorkService.InitUnitWorkDownList(this.drpUnitWorkIds, this.CurrUser.LoginProjectId, false); + BLL.UnitService.GetUnit(this.drpUnitIds, this.CurrUser.LoginProjectId, false); + //LoadAuditSelect(); + //this.agree.Hidden = true; + //this.options.Hidden = true; + + //this.btnSave.Hidden = true; + //this.btnSubmit.Hidden = true; + this.Id = Request.Params["Id"]; + var model = BLL.ReviewDrawingsService.Detail(this.Id); + if (model != null) + { + this.Id = model.Id; + this.hdAttachUrl.Text = this.Id; + if (!string.IsNullOrEmpty(model.CNProfessionalId)) + { + this.drpCNProfessionalId.SelectedValue = model.CNProfessionalId; + } + if (!string.IsNullOrEmpty(model.UnitWorkId)) + { + this.drpUnitWorkIds.SelectedValueArray = model.UnitWorkId.Split(','); + } + this.txtDraCode.Text = model.DraCode; + + this.txtReviewDate.Text = model.ReviewDate.HasValue ? string.Format("{0:yyyy-MM-dd}", model.ReviewDate) : ""; + + if (!string.IsNullOrEmpty(model.ReceiveUnits)) + { + this.drpUnitIds.SelectedValueArray = model.ReceiveUnits.Split(','); + } + this.txtRemarks.Text = model.Remarks; + this.txtRemarkCode.Text = model.RemarkCode.HasValue ? model.RemarkCode.ToString() : ""; + + //var currApprove = DesignDrawingsApproveService.GetCurrentApprove(model.Id); + //if (currApprove != null) + //{ //重新编制 编制人 可以 显示 提交 保存按钮 + + // this.drpAudit.SelectedValue = currApprove.ApproveMan; + // if (currApprove.ApproveType == BLL.Const.Comprehensive_ReCompile && model.CreateMan == CurrUser.UserId) + // { + // this.btnSubmit.Hidden = false; + // this.btnSave.Hidden = false; + // }//审核状态 审核人 可以显示 提交 保存按钮 + // else if (currApprove.ApproveType == BLL.Const.Comprehensive_Audit && currApprove.ApproveMan == CurrUser.UserId) + // { + // //审核状态不可编辑 + // Readonly(); + // this.agree.Hidden = false; + // this.options.Hidden = false; + // this.btnSubmit.Hidden = false; + // this.btnSave.Hidden = false; + // } + //}//没有当前审核人,已完成状态 或者 待提交状态 + //else + //{ + // if (model.Status == BLL.Const.Comprehensive_Compile && model.CreateMan == CurrUser.UserId) + // { + // this.btnSubmit.Hidden = false; + // this.btnSave.Hidden = false; + // } + //} + } + //else + //{ + //this.btnSave.Hidden = false; + //this.btnSubmit.Hidden = false; + //} + } + } + + + + + /// + /// 禁止编辑 + /// + public void Readonly() + { + this.txtDraCode.Readonly = true; + this.txtReviewDate.Readonly = true; + this.drpCNProfessionalId.Readonly = true; + this.drpUnitWorkIds.Readonly = true; + this.drpUnitIds.Readonly = true; + this.txtRemarks.Readonly = true; + this.txtReviewDate.Readonly = true; + //this.drpAudit.Readonly = true; + this.txtRemarkCode.Readonly = true; + //this.btnAttach.Enabled = false; + + } + + /// + /// 加载专业工程师 + /// + //public void LoadAuditSelect() + //{ + + // var db = Funs.DB; + // var userList = from x in db.Sys_User + // join y in db.Project_ProjectUnit + // on x.UnitId equals y.UnitId + // join p in db.Project_ProjectUser + // on x.UserId equals p.UserId + // where y.UnitId == Const.UnitId_CWCEC && p.ProjectId == CurrUser.LoginProjectId && y.ProjectId == CurrUser.LoginProjectId + // where p.RoleId.Contains(Const.ZBCNEngineer) + // select new { UserId = x.UserId, UserName = x.UserName }; + // drpAudit.DataValueField = "UserId"; + // drpAudit.DataTextField = "UserName"; + // this.drpAudit.DataSource = userList.ToList(); + // this.drpAudit.DataBind(); + //} + + + + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + if (Request.Params["value"] == "0") + { + return; + } + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ReviewDrawingsMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnSave)) + { + this.btnSave.Hidden = false; + } + } + } + #endregion + + #region 附件上传 + /// + /// 附件上传 + /// + /// + /// + protected void btnAttach_Click(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(this.hdAttachUrl.Text)) //新增记录 + { + this.hdAttachUrl.Text = SQLHelper.GetNewID(typeof(Model.Comprehensive_DesignDrawings)); + } + Model.Comprehensive_DesignDrawings designDrawings = BLL.DesignDrawingsService.GetDesignDrawingsById(this.Id); + //if (designDrawings.Status == BLL.Const.Comprehensive_Complete) + //{ + // PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=-1&toKeyId={0}&path=FileUpload/CQMS/designDrawings&menuId={1}", this.hdAttachUrl.Text, BLL.Const.ReviewDrawingsMenuId))); + //} + //else + //{ + PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/CQMS/designDrawings&menuId={1}", this.hdAttachUrl.Text, BLL.Const.ReviewDrawingsMenuId))); + //} + } + #endregion + + #region 保存 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + if (drpCNProfessionalId.SelectedValue == BLL.Const._Null) + { + Alert.ShowInTop("请选择专业!", MessageBoxIcon.Warning); + return; + } + var q = Funs.DB.Comprehensive_ReviewDrawings.FirstOrDefault(x => x.ProjectId == this.CurrUser.LoginProjectId && x.RemarkCode == Funs.GetNewInt(this.txtRemarkCode.Text.Trim()) && (x.Id != this.Id || (this.Id == null && x.Id != null))); + if (q != null) + { + Alert.ShowInTop("标志编号已存在!", MessageBoxIcon.Warning); + return; + } + var designDrawings = new Model.Comprehensive_ReviewDrawings(); + designDrawings.ProjectId = this.CurrUser.LoginProjectId; + designDrawings.CNProfessionalId = this.drpCNProfessionalId.SelectedValue; + designDrawings.DraCode = this.txtDraCode.Text.Trim(); + designDrawings.ReviewDate = Funs.GetNewDateTime(this.txtReviewDate.Text); + designDrawings.Remarks = this.txtRemarks.Text.Trim(); + designDrawings.CreateMan = this.CurrUser.UserId; + designDrawings.CreateDate = DateTime.Now; + //if (!string.IsNullOrEmpty(this.drpAudit.SelectedValue)) + //{ + // designDrawings.AuditMan = drpAudit.SelectedValue; + //} //审核人 + string ids = string.Empty; + var lists = this.drpUnitWorkIds.SelectedValueArray; + foreach (var item in lists) + { + ids += item + ","; + } + if (!string.IsNullOrEmpty(ids)) + { + ids = ids.Substring(0, ids.LastIndexOf(",")); + } + designDrawings.UnitWorkId = ids; + + string unitIds = string.Empty; + var unitLists = this.drpUnitIds.SelectedValueArray; + foreach (var item in unitLists) + { + unitIds += item + ","; + } + if (!string.IsNullOrEmpty(unitIds)) + { + unitIds = unitIds.Substring(0, unitIds.LastIndexOf(",")); + } + designDrawings.ReceiveUnits = unitIds; + designDrawings.RemarkCode = Funs.GetNewInt(this.txtRemarkCode.Text.Trim()); + if (!string.IsNullOrEmpty(this.Id)) + { + designDrawings.Id = this.Id; + + var model = Funs.DB.Comprehensive_ReviewDrawings.Where(u => u.Id == this.Id).FirstOrDefault(); + if (model != null) + { + + designDrawings.Status = model.Status; + } + BLL.ReviewDrawingsService.Update(designDrawings); + } + else + { + if (!string.IsNullOrEmpty(this.hdAttachUrl.Text)) + { + designDrawings.Id = this.hdAttachUrl.Text; + } + else + { + designDrawings.Id = SQLHelper.GetNewID(typeof(Model.Comprehensive_DesignDrawings)); + this.hdAttachUrl.Text = designDrawings.Id; + } + + designDrawings.Status = BLL.Const.Comprehensive_Compile; + BLL.ReviewDrawingsService.Insert(designDrawings); + } + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + + } + + + //protected void btnSubmit_Click(object sender, EventArgs e) + //{ + // if (drpCNProfessionalId.SelectedValue == BLL.Const._Null) + // { + // Alert.ShowInTop("请选择专业!", MessageBoxIcon.Warning); + // return; + // } + // var q = Funs.DB.Comprehensive_ReviewDrawings.FirstOrDefault(x => x.ProjectId == this.CurrUser.LoginProjectId && x.RemarkCode == Funs.GetNewInt(this.txtRemarkCode.Text.Trim()) && (x.Id != this.Id || (this.Id == null && x.Id != null))); + // if (q != null) + // { + // Alert.ShowInTop("标志编号已存在!", MessageBoxIcon.Warning); + // return; + // } + // var designDrawings = new Model.Comprehensive_ReviewDrawings(); + // designDrawings.ProjectId = this.CurrUser.LoginProjectId; + // designDrawings.CNProfessionalId = this.drpCNProfessionalId.SelectedValue; + // designDrawings.DraCode = this.txtDraCode.Text.Trim(); + // designDrawings.ReviewDate = Funs.GetNewDateTime(this.txtReviewDate.Text); + // designDrawings.Remarks = this.txtRemarks.Text.Trim(); + // designDrawings.CreateMan = this.CurrUser.UserId; + // designDrawings.CreateDate = DateTime.Now; + // if (!string.IsNullOrEmpty(this.drpAudit.SelectedValue)) + // { + // designDrawings.AuditMan = drpAudit.SelectedValue; + // } //审核人 + // string ids = string.Empty; + // var lists = this.drpUnitWorkIds.SelectedValueArray; + // foreach (var item in lists) + // { + // ids += item + ","; + // } + // if (!string.IsNullOrEmpty(ids)) + // { + // ids = ids.Substring(0, ids.LastIndexOf(",")); + // } + // designDrawings.UnitWorkId = ids; + + // string unitIds = string.Empty; + // var unitLists = this.drpUnitIds.SelectedValueArray; + // foreach (var item in unitLists) + // { + // unitIds += item + ","; + // } + // if (!string.IsNullOrEmpty(unitIds)) + // { + // unitIds = unitIds.Substring(0, unitIds.LastIndexOf(",")); + // } + // designDrawings.ReceiveUnits = unitIds; + // designDrawings.RemarkCode = Funs.GetNewInt(this.txtRemarkCode.Text.Trim()); + // if (!string.IsNullOrEmpty(this.Id)) + // { + // designDrawings.Id = this.Id; + // BLL.DesignDrawingsService.UpdateDesignDrawings(designDrawings); + // var oldDesignDrawings = Funs.DB.Comprehensive_ReviewDrawings.Where(u => u.Id == this.Id).FirstOrDefault(); + // if (oldDesignDrawings == null) //数据库没有记录 直接点提交 当前状态为 审核状态 + // { + // designDrawings.CreateMan = this.CurrUser.UserId; + // designDrawings.Status = BLL.Const.Comprehensive_Audit; + // BLL.ReviewDrawingsService.Insert(designDrawings); + // } + // else + // { + + // if (oldDesignDrawings.Status == BLL.Const.Comprehensive_Compile)//编制状态提交变审核 + // { + // designDrawings.Status = BLL.Const.Comprehensive_Audit; + // } + // else if (oldDesignDrawings.Status == BLL.Const.Comprehensive_ReCompile)//重新编制状态提交变审核 + // { + // designDrawings.Status = BLL.Const.Comprehensive_Audit; + // } + // else //审核状态 提交 变 完成 或者 重新编制 + // { + // if (Convert.ToBoolean(rblIsAgree.SelectedValue)) + // { + // designDrawings.Status = BLL.Const.Comprehensive_Complete; + // } + // else + // { + // designDrawings.Status = BLL.Const.Comprehensive_ReCompile; + // } + // } + + // BLL.ReviewDrawingsService.Update(designDrawings); + + // } + // } + // else + // { + // if (!string.IsNullOrEmpty(this.hdAttachUrl.Text)) + // { + // designDrawings.Id = this.hdAttachUrl.Text; + // } + // else + // { + // designDrawings.Id = SQLHelper.GetNewID(typeof(Model.Comprehensive_DesignDrawings)); + // this.hdAttachUrl.Text = designDrawings.Id; + // } + + // designDrawings.Status = BLL.Const.Comprehensive_Audit; + // BLL.ReviewDrawingsService.Insert(designDrawings); + // } + + + + + + // #region 审核记录 + + // var currApprove = DesignDrawingsApproveService.GetCurrentApprove(designDrawings.Id); + // if (currApprove == null) //为获取到为 当前编制状态 直接提交 + // { + // var approve = new Model.Comprehensive_DesignDrawingsApprove(); + // approve.DesignDrawingsId = designDrawings.Id; + // approve.ApproveMan = this.CurrUser.UserId; + // approve.ApproveType = Const.Comprehensive_Compile; + // approve.ApproveDate = DateTime.Now; + // DesignDrawingsApproveService.EditApprove(approve); //新增编制记录 + + + // Model.Comprehensive_DesignDrawingsApprove newApprove = new Model.Comprehensive_DesignDrawingsApprove(); + // newApprove.DesignDrawingsId = designDrawings.Id; + // newApprove.ApproveMan = this.drpAudit.SelectedValue; + // newApprove.ApproveType = Const.InspectionManagement_Audit; + // DesignDrawingsApproveService.EditApprove(newApprove); //新增专业工程师审核记录 + + // } + // else if (currApprove.ApproveMan == CurrUser.UserId) + // { + // if (currApprove.ApproveType == BLL.Const.Comprehensive_ReCompile) + // { + // currApprove.ApproveDate = DateTime.Now; + // currApprove.IsAgree = true; + // DesignDrawingsApproveService.EditApprove(currApprove); //新增专业工程师审核记录 + // Model.Comprehensive_DesignDrawingsApprove newApprove = new Model.Comprehensive_DesignDrawingsApprove(); + // newApprove.DesignDrawingsId = designDrawings.Id; + // newApprove.ApproveMan = this.drpAudit.SelectedValue; + // newApprove.ApproveType = Const.InspectionManagement_Audit; + // DesignDrawingsApproveService.EditApprove(newApprove); //新增专业工程师审核记录 + // } + // else + // { + // currApprove.ApproveDate = DateTime.Now; //更新审核时间 + // currApprove.IsAgree = Convert.ToBoolean(rblIsAgree.SelectedValue); + // currApprove.ApproveIdea = this.txtidea.Text; + // DesignDrawingsApproveService.EditApprove(currApprove); + + // if (Convert.ToBoolean(rblIsAgree.SelectedValue)) //同意时 审批完成 + // { + // Model.Comprehensive_DesignDrawingsApprove reApprove = new Model.Comprehensive_DesignDrawingsApprove(); + // reApprove.DesignDrawingsId = currApprove.DesignDrawingsId; + // reApprove.ApproveDate = DateTime.Now.AddSeconds(10); + // reApprove.ApproveMan = CurrUser.UserId; + // reApprove.ApproveType = Const.Comprehensive_Complete; + // reApprove.ApproveIdea = txtidea.Text; + // DesignDrawingsApproveService.EditApprove(reApprove); + // } + // else + // { + // Model.Comprehensive_DesignDrawingsApprove reApprove = new Model.Comprehensive_DesignDrawingsApprove(); + // reApprove.DesignDrawingsId = currApprove.DesignDrawingsId; + // reApprove.ApproveMan = designDrawings.CreateMan; + // reApprove.ApproveType = Const.Comprehensive_ReCompile; + // DesignDrawingsApproveService.EditApprove(reApprove); + // } + // } + // } + + // PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + + // #endregion + + + + //} + + /// + /// 保存方法 + /// + + #endregion + } +} \ No newline at end of file diff --git a/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsEdit.aspx.designer.cs b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsEdit.aspx.designer.cs new file mode 100644 index 0000000..80586bf --- /dev/null +++ b/SUBQHSE/FineUIPro.Web/CQMS/Comprehensive/ReviewDrawingsEdit.aspx.designer.cs @@ -0,0 +1,170 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.Comprehensive +{ + + + public partial class ReviewDrawingsEdit + { + + /// + /// form1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// drpCNProfessionalId control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::FineUIPro.DropDownList drpCNProfessionalId; + + /// + /// drpUnitWorkIds control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::FineUIPro.DropDownList drpUnitWorkIds; + + /// + /// txtDraCode control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::FineUIPro.TextBox txtDraCode; + + /// + /// txtReviewDate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::FineUIPro.DatePicker txtReviewDate; + + /// + /// drpUnitIds control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::FineUIPro.DropDownList drpUnitIds; + + /// + /// txtRemarkCode control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::FineUIPro.NumberBox txtRemarkCode; + + /// + /// txtRemarks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::FineUIPro.TextArea txtRemarks; + + /// + /// Panel2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::FineUIPro.Panel Panel2; + + /// + /// Label1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::FineUIPro.Label Label1; + + /// + /// btnAttach control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::FineUIPro.Button btnAttach; + + /// + /// Toolbar1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// hdAttachUrl control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::FineUIPro.HiddenField hdAttachUrl; + + /// + /// btnSave control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::FineUIPro.Button btnSave; + + /// + /// WindowAtt control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::FineUIPro.Window WindowAtt; + } +} diff --git a/SUBQHSE/FineUIPro.Web/File/Excel/DataIn/图纸会审管理导入模板.xls b/SUBQHSE/FineUIPro.Web/File/Excel/DataIn/图纸会审管理导入模板.xls new file mode 100644 index 0000000..d334e6a Binary files /dev/null and b/SUBQHSE/FineUIPro.Web/File/Excel/DataIn/图纸会审管理导入模板.xls differ diff --git a/SUBQHSE/FineUIPro.Web/FineUIPro.Web.csproj b/SUBQHSE/FineUIPro.Web/FineUIPro.Web.csproj index 27d29ae..8c94aeb 100644 --- a/SUBQHSE/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SUBQHSE/FineUIPro.Web/FineUIPro.Web.csproj @@ -398,6 +398,11 @@ + + + + + @@ -418,6 +423,8 @@ + + @@ -445,6 +452,11 @@ + + + + + @@ -7490,6 +7502,16 @@ WorkContactFile.aspx + + + + + + + + + + DataDistribution.aspx ASPXCodeBehind @@ -7630,6 +7652,10 @@ ContactListEdit.aspx + + + + QualitySampleFirstAccFile.aspx ASPXCodeBehind @@ -7819,6 +7845,16 @@ QualityAccidentEdit.aspx + + + + + + + + + + SiteVisaManagement.aspx ASPXCodeBehind diff --git a/SUBQHSE/Model/Model.cs b/SUBQHSE/Model/Model.cs index 1f74829..abed5fd 100644 --- a/SUBQHSE/Model/Model.cs +++ b/SUBQHSE/Model/Model.cs @@ -2564,6 +2564,9 @@ namespace Model partial void InsertSys_Const(Sys_Const instance); partial void UpdateSys_Const(Sys_Const instance); partial void DeleteSys_Const(Sys_Const instance); + partial void InsertSys_CQMS_DataInTemp(Sys_CQMS_DataInTemp instance); + partial void UpdateSys_CQMS_DataInTemp(Sys_CQMS_DataInTemp instance); + partial void DeleteSys_CQMS_DataInTemp(Sys_CQMS_DataInTemp instance); partial void InsertSys_DataInTemp(Sys_DataInTemp instance); partial void UpdateSys_DataInTemp(Sys_DataInTemp instance); partial void DeleteSys_DataInTemp(Sys_DataInTemp instance); @@ -9780,6 +9783,14 @@ namespace Model } } + public System.Data.Linq.Table Sys_CQMS_DataInTemp + { + get + { + return this.GetTable(); + } + } + public System.Data.Linq.Table Sys_DataInTemp { get @@ -28333,6 +28344,8 @@ namespace Model private EntitySet _Sys_CodeRecords; + private EntitySet _Sys_CQMS_DataInTemp; + private EntitySet _Sys_DataInTemp; private EntitySet _Sys_FlowOperate; @@ -28779,6 +28792,7 @@ namespace Model this._SY_Hazard_HazardList = new EntitySet(new Action(this.attach_SY_Hazard_HazardList), new Action(this.detach_SY_Hazard_HazardList)); this._SY_SitePerson_DayReport = new EntitySet(new Action(this.attach_SY_SitePerson_DayReport), new Action(this.detach_SY_SitePerson_DayReport)); this._Sys_CodeRecords = new EntitySet(new Action(this.attach_Sys_CodeRecords), new Action(this.detach_Sys_CodeRecords)); + this._Sys_CQMS_DataInTemp = new EntitySet(new Action(this.attach_Sys_CQMS_DataInTemp), new Action(this.detach_Sys_CQMS_DataInTemp)); this._Sys_DataInTemp = new EntitySet(new Action(this.attach_Sys_DataInTemp), new Action(this.detach_Sys_DataInTemp)); this._Sys_FlowOperate = new EntitySet(new Action(this.attach_Sys_FlowOperate), new Action(this.detach_Sys_FlowOperate)); this._Sys_RoleItem = new EntitySet(new Action(this.attach_Sys_RoleItem), new Action(this.detach_Sys_RoleItem)); @@ -33573,6 +33587,19 @@ namespace Model } } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Sys_CQMS_DataInTemp_Base_Project", Storage="_Sys_CQMS_DataInTemp", ThisKey="ProjectId", OtherKey="ProjectId", DeleteRule="NO ACTION")] + public EntitySet Sys_CQMS_DataInTemp + { + get + { + return this._Sys_CQMS_DataInTemp; + } + set + { + this._Sys_CQMS_DataInTemp.Assign(value); + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Sys_DataInTemp_Base_Project", Storage="_Sys_DataInTemp", ThisKey="ProjectId", OtherKey="ProjectId", DeleteRule="NO ACTION")] public EntitySet Sys_DataInTemp { @@ -37594,6 +37621,18 @@ namespace Model entity.Base_Project = null; } + private void attach_Sys_CQMS_DataInTemp(Sys_CQMS_DataInTemp entity) + { + this.SendPropertyChanging(); + entity.Base_Project = this; + } + + private void detach_Sys_CQMS_DataInTemp(Sys_CQMS_DataInTemp entity) + { + this.SendPropertyChanging(); + entity.Base_Project = null; + } + private void attach_Sys_DataInTemp(Sys_DataInTemp entity) { this.SendPropertyChanging(); @@ -403496,6 +403535,774 @@ namespace Model } } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Sys_CQMS_DataInTemp")] + public partial class Sys_CQMS_DataInTemp : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _TempId; + + private string _ProjectId; + + private string _UserId; + + private System.Nullable _Time; + + private System.Nullable _RowNo; + + private string _Value1; + + private string _Value2; + + private string _Value3; + + private string _Value4; + + private string _Value5; + + private string _Value6; + + private string _Value7; + + private string _Value8; + + private string _Value9; + + private string _Value10; + + private string _Value11; + + private string _Value12; + + private string _Value13; + + private string _Value14; + + private string _Value15; + + private string _Value16; + + private string _Value17; + + private string _Value18; + + private string _Value19; + + private string _Value20; + + private string _ToopValue; + + private string _Type; + + private EntityRef _Base_Project; + + private EntityRef _Sys_User; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnTempIdChanging(string value); + partial void OnTempIdChanged(); + partial void OnProjectIdChanging(string value); + partial void OnProjectIdChanged(); + partial void OnUserIdChanging(string value); + partial void OnUserIdChanged(); + partial void OnTimeChanging(System.Nullable value); + partial void OnTimeChanged(); + partial void OnRowNoChanging(System.Nullable value); + partial void OnRowNoChanged(); + partial void OnValue1Changing(string value); + partial void OnValue1Changed(); + partial void OnValue2Changing(string value); + partial void OnValue2Changed(); + partial void OnValue3Changing(string value); + partial void OnValue3Changed(); + partial void OnValue4Changing(string value); + partial void OnValue4Changed(); + partial void OnValue5Changing(string value); + partial void OnValue5Changed(); + partial void OnValue6Changing(string value); + partial void OnValue6Changed(); + partial void OnValue7Changing(string value); + partial void OnValue7Changed(); + partial void OnValue8Changing(string value); + partial void OnValue8Changed(); + partial void OnValue9Changing(string value); + partial void OnValue9Changed(); + partial void OnValue10Changing(string value); + partial void OnValue10Changed(); + partial void OnValue11Changing(string value); + partial void OnValue11Changed(); + partial void OnValue12Changing(string value); + partial void OnValue12Changed(); + partial void OnValue13Changing(string value); + partial void OnValue13Changed(); + partial void OnValue14Changing(string value); + partial void OnValue14Changed(); + partial void OnValue15Changing(string value); + partial void OnValue15Changed(); + partial void OnValue16Changing(string value); + partial void OnValue16Changed(); + partial void OnValue17Changing(string value); + partial void OnValue17Changed(); + partial void OnValue18Changing(string value); + partial void OnValue18Changed(); + partial void OnValue19Changing(string value); + partial void OnValue19Changed(); + partial void OnValue20Changing(string value); + partial void OnValue20Changed(); + partial void OnToopValueChanging(string value); + partial void OnToopValueChanged(); + partial void OnTypeChanging(string value); + partial void OnTypeChanged(); + #endregion + + public Sys_CQMS_DataInTemp() + { + this._Base_Project = default(EntityRef); + this._Sys_User = default(EntityRef); + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TempId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string TempId + { + get + { + return this._TempId; + } + set + { + if ((this._TempId != value)) + { + this.OnTempIdChanging(value); + this.SendPropertyChanging(); + this._TempId = value; + this.SendPropertyChanged("TempId"); + this.OnTempIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50)")] + public string ProjectId + { + get + { + return this._ProjectId; + } + set + { + if ((this._ProjectId != value)) + { + if (this._Base_Project.HasLoadedOrAssignedValue) + { + throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); + } + this.OnProjectIdChanging(value); + this.SendPropertyChanging(); + this._ProjectId = value; + this.SendPropertyChanged("ProjectId"); + this.OnProjectIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UserId", DbType="NVarChar(50)")] + public string UserId + { + get + { + return this._UserId; + } + set + { + if ((this._UserId != value)) + { + if (this._Sys_User.HasLoadedOrAssignedValue) + { + throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); + } + this.OnUserIdChanging(value); + this.SendPropertyChanging(); + this._UserId = value; + this.SendPropertyChanged("UserId"); + this.OnUserIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Time", DbType="DateTime")] + public System.Nullable Time + { + get + { + return this._Time; + } + set + { + if ((this._Time != value)) + { + this.OnTimeChanging(value); + this.SendPropertyChanging(); + this._Time = value; + this.SendPropertyChanged("Time"); + this.OnTimeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RowNo", DbType="Int")] + public System.Nullable RowNo + { + get + { + return this._RowNo; + } + set + { + if ((this._RowNo != value)) + { + this.OnRowNoChanging(value); + this.SendPropertyChanging(); + this._RowNo = value; + this.SendPropertyChanged("RowNo"); + this.OnRowNoChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Value1", DbType="NVarChar(100)")] + public string Value1 + { + get + { + return this._Value1; + } + set + { + if ((this._Value1 != value)) + { + this.OnValue1Changing(value); + this.SendPropertyChanging(); + this._Value1 = value; + this.SendPropertyChanged("Value1"); + this.OnValue1Changed(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Value2", DbType="NVarChar(100)")] + public string Value2 + { + get + { + return this._Value2; + } + set + { + if ((this._Value2 != value)) + { + this.OnValue2Changing(value); + this.SendPropertyChanging(); + this._Value2 = value; + this.SendPropertyChanged("Value2"); + this.OnValue2Changed(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Value3", DbType="NVarChar(100)")] + public string Value3 + { + get + { + return this._Value3; + } + set + { + if ((this._Value3 != value)) + { + this.OnValue3Changing(value); + this.SendPropertyChanging(); + this._Value3 = value; + this.SendPropertyChanged("Value3"); + this.OnValue3Changed(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Value4", DbType="NVarChar(100)")] + public string Value4 + { + get + { + return this._Value4; + } + set + { + if ((this._Value4 != value)) + { + this.OnValue4Changing(value); + this.SendPropertyChanging(); + this._Value4 = value; + this.SendPropertyChanged("Value4"); + this.OnValue4Changed(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Value5", DbType="NVarChar(100)")] + public string Value5 + { + get + { + return this._Value5; + } + set + { + if ((this._Value5 != value)) + { + this.OnValue5Changing(value); + this.SendPropertyChanging(); + this._Value5 = value; + this.SendPropertyChanged("Value5"); + this.OnValue5Changed(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Value6", DbType="NVarChar(100)")] + public string Value6 + { + get + { + return this._Value6; + } + set + { + if ((this._Value6 != value)) + { + this.OnValue6Changing(value); + this.SendPropertyChanging(); + this._Value6 = value; + this.SendPropertyChanged("Value6"); + this.OnValue6Changed(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Value7", DbType="NVarChar(100)")] + public string Value7 + { + get + { + return this._Value7; + } + set + { + if ((this._Value7 != value)) + { + this.OnValue7Changing(value); + this.SendPropertyChanging(); + this._Value7 = value; + this.SendPropertyChanged("Value7"); + this.OnValue7Changed(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Value8", DbType="NVarChar(100)")] + public string Value8 + { + get + { + return this._Value8; + } + set + { + if ((this._Value8 != value)) + { + this.OnValue8Changing(value); + this.SendPropertyChanging(); + this._Value8 = value; + this.SendPropertyChanged("Value8"); + this.OnValue8Changed(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Value9", DbType="NVarChar(100)")] + public string Value9 + { + get + { + return this._Value9; + } + set + { + if ((this._Value9 != value)) + { + this.OnValue9Changing(value); + this.SendPropertyChanging(); + this._Value9 = value; + this.SendPropertyChanged("Value9"); + this.OnValue9Changed(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Value10", DbType="NVarChar(100)")] + public string Value10 + { + get + { + return this._Value10; + } + set + { + if ((this._Value10 != value)) + { + this.OnValue10Changing(value); + this.SendPropertyChanging(); + this._Value10 = value; + this.SendPropertyChanged("Value10"); + this.OnValue10Changed(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Value11", DbType="NVarChar(100)")] + public string Value11 + { + get + { + return this._Value11; + } + set + { + if ((this._Value11 != value)) + { + this.OnValue11Changing(value); + this.SendPropertyChanging(); + this._Value11 = value; + this.SendPropertyChanged("Value11"); + this.OnValue11Changed(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Value12", DbType="NVarChar(100)")] + public string Value12 + { + get + { + return this._Value12; + } + set + { + if ((this._Value12 != value)) + { + this.OnValue12Changing(value); + this.SendPropertyChanging(); + this._Value12 = value; + this.SendPropertyChanged("Value12"); + this.OnValue12Changed(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Value13", DbType="NVarChar(100)")] + public string Value13 + { + get + { + return this._Value13; + } + set + { + if ((this._Value13 != value)) + { + this.OnValue13Changing(value); + this.SendPropertyChanging(); + this._Value13 = value; + this.SendPropertyChanged("Value13"); + this.OnValue13Changed(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Value14", DbType="NVarChar(100)")] + public string Value14 + { + get + { + return this._Value14; + } + set + { + if ((this._Value14 != value)) + { + this.OnValue14Changing(value); + this.SendPropertyChanging(); + this._Value14 = value; + this.SendPropertyChanged("Value14"); + this.OnValue14Changed(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Value15", DbType="NVarChar(100)")] + public string Value15 + { + get + { + return this._Value15; + } + set + { + if ((this._Value15 != value)) + { + this.OnValue15Changing(value); + this.SendPropertyChanging(); + this._Value15 = value; + this.SendPropertyChanged("Value15"); + this.OnValue15Changed(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Value16", DbType="NVarChar(100)")] + public string Value16 + { + get + { + return this._Value16; + } + set + { + if ((this._Value16 != value)) + { + this.OnValue16Changing(value); + this.SendPropertyChanging(); + this._Value16 = value; + this.SendPropertyChanged("Value16"); + this.OnValue16Changed(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Value17", DbType="NVarChar(100)")] + public string Value17 + { + get + { + return this._Value17; + } + set + { + if ((this._Value17 != value)) + { + this.OnValue17Changing(value); + this.SendPropertyChanging(); + this._Value17 = value; + this.SendPropertyChanged("Value17"); + this.OnValue17Changed(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Value18", DbType="NVarChar(100)")] + public string Value18 + { + get + { + return this._Value18; + } + set + { + if ((this._Value18 != value)) + { + this.OnValue18Changing(value); + this.SendPropertyChanging(); + this._Value18 = value; + this.SendPropertyChanged("Value18"); + this.OnValue18Changed(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Value19", DbType="NVarChar(100)")] + public string Value19 + { + get + { + return this._Value19; + } + set + { + if ((this._Value19 != value)) + { + this.OnValue19Changing(value); + this.SendPropertyChanging(); + this._Value19 = value; + this.SendPropertyChanged("Value19"); + this.OnValue19Changed(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Value20", DbType="NVarChar(100)")] + public string Value20 + { + get + { + return this._Value20; + } + set + { + if ((this._Value20 != value)) + { + this.OnValue20Changing(value); + this.SendPropertyChanging(); + this._Value20 = value; + this.SendPropertyChanged("Value20"); + this.OnValue20Changed(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ToopValue", DbType="NVarChar(4000)")] + public string ToopValue + { + get + { + return this._ToopValue; + } + set + { + if ((this._ToopValue != value)) + { + this.OnToopValueChanging(value); + this.SendPropertyChanging(); + this._ToopValue = value; + this.SendPropertyChanged("ToopValue"); + this.OnToopValueChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Type", DbType="NVarChar(50)")] + public string Type + { + get + { + return this._Type; + } + set + { + if ((this._Type != value)) + { + this.OnTypeChanging(value); + this.SendPropertyChanging(); + this._Type = value; + this.SendPropertyChanged("Type"); + this.OnTypeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Sys_CQMS_DataInTemp_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)] + public Base_Project Base_Project + { + get + { + return this._Base_Project.Entity; + } + set + { + Base_Project previousValue = this._Base_Project.Entity; + if (((previousValue != value) + || (this._Base_Project.HasLoadedOrAssignedValue == false))) + { + this.SendPropertyChanging(); + if ((previousValue != null)) + { + this._Base_Project.Entity = null; + previousValue.Sys_CQMS_DataInTemp.Remove(this); + } + this._Base_Project.Entity = value; + if ((value != null)) + { + value.Sys_CQMS_DataInTemp.Add(this); + this._ProjectId = value.ProjectId; + } + else + { + this._ProjectId = default(string); + } + this.SendPropertyChanged("Base_Project"); + } + } + } + + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Sys_CQMS_DataInTemp_Sys_User", Storage="_Sys_User", ThisKey="UserId", OtherKey="UserId", IsForeignKey=true)] + public Sys_User Sys_User + { + get + { + return this._Sys_User.Entity; + } + set + { + Sys_User previousValue = this._Sys_User.Entity; + if (((previousValue != value) + || (this._Sys_User.HasLoadedOrAssignedValue == false))) + { + this.SendPropertyChanging(); + if ((previousValue != null)) + { + this._Sys_User.Entity = null; + previousValue.Sys_CQMS_DataInTemp.Remove(this); + } + this._Sys_User.Entity = value; + if ((value != null)) + { + value.Sys_CQMS_DataInTemp.Add(this); + this._UserId = value.UserId; + } + else + { + this._UserId = default(string); + } + this.SendPropertyChanged("Sys_User"); + } + } + } + + public event PropertyChangingEventHandler PropertyChanging; + + public event PropertyChangedEventHandler PropertyChanged; + + protected virtual void SendPropertyChanging() + { + if ((this.PropertyChanging != null)) + { + this.PropertyChanging(this, emptyChangingEventArgs); + } + } + + protected virtual void SendPropertyChanged(String propertyName) + { + if ((this.PropertyChanged != null)) + { + this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Sys_DataInTemp")] public partial class Sys_DataInTemp : INotifyPropertyChanging, INotifyPropertyChanged { @@ -409834,6 +410641,8 @@ namespace Model private EntitySet _SY_Technique_HazardList; + private EntitySet _Sys_CQMS_DataInTemp; + private EntitySet _Sys_DataInTemp; private EntitySet _Sys_FlowOperate; @@ -410358,6 +411167,7 @@ namespace Model this._SY_Hazard_HazardList_Sys_User1 = new EntitySet(new Action(this.attach_SY_Hazard_HazardList_Sys_User1), new Action(this.detach_SY_Hazard_HazardList_Sys_User1)); this._SY_SitePerson_DayReport = new EntitySet(new Action(this.attach_SY_SitePerson_DayReport), new Action(this.detach_SY_SitePerson_DayReport)); this._SY_Technique_HazardList = new EntitySet(new Action(this.attach_SY_Technique_HazardList), new Action(this.detach_SY_Technique_HazardList)); + this._Sys_CQMS_DataInTemp = new EntitySet(new Action(this.attach_Sys_CQMS_DataInTemp), new Action(this.detach_Sys_CQMS_DataInTemp)); this._Sys_DataInTemp = new EntitySet(new Action(this.attach_Sys_DataInTemp), new Action(this.detach_Sys_DataInTemp)); this._Sys_FlowOperate = new EntitySet(new Action(this.attach_Sys_FlowOperate), new Action(this.detach_Sys_FlowOperate)); this._Sys_Log = new EntitySet(new Action(this.attach_Sys_Log), new Action(this.detach_Sys_Log)); @@ -415811,6 +416621,19 @@ namespace Model } } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Sys_CQMS_DataInTemp_Sys_User", Storage="_Sys_CQMS_DataInTemp", ThisKey="UserId", OtherKey="UserId", DeleteRule="NO ACTION")] + public EntitySet Sys_CQMS_DataInTemp + { + get + { + return this._Sys_CQMS_DataInTemp; + } + set + { + this._Sys_CQMS_DataInTemp.Assign(value); + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Sys_DataInTemp_Sys_User", Storage="_Sys_DataInTemp", ThisKey="UserId", OtherKey="UserId", DeleteRule="NO ACTION")] public EntitySet Sys_DataInTemp { @@ -420393,6 +421216,18 @@ namespace Model entity.Sys_User = null; } + private void attach_Sys_CQMS_DataInTemp(Sys_CQMS_DataInTemp entity) + { + this.SendPropertyChanging(); + entity.Sys_User = this; + } + + private void detach_Sys_CQMS_DataInTemp(Sys_CQMS_DataInTemp entity) + { + this.SendPropertyChanging(); + entity.Sys_User = null; + } + private void attach_Sys_DataInTemp(Sys_DataInTemp entity) { this.SendPropertyChanging();