From ffffb5a4ebb413de70526a9665f6ac39f2097a87 Mon Sep 17 00:00:00 2001 From: wendy <408182087@qq.com> Date: Sat, 28 Sep 2024 16:02:26 +0800 Subject: [PATCH] =?UTF-8?q?20240928=20=E5=8D=95=E4=BD=8D=E5=B7=A5=E7=A8=8B?= =?UTF-8?q?=E5=88=92=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../版本日志/SGGLDB_WH_V2024-09-28-bwj.sql | 13 + SGGL/BLL/BLL.csproj | 1 + SGGL/BLL/CQMS/WBS/DivisionDivideService.cs | 10 + SGGL/BLL/CQMS/WBS/SubProjectsService.cs | 103 ++++++ SGGL/BLL/Common/Const.cs | 5 + SGGL/BLL/ProjectData/UnitWorkService.cs | 9 + .../WBS/Control/DivisionDivideAndCrop.aspx | 76 ++-- .../WBS/Control/DivisionDivideAndCrop.aspx.cs | 140 +++++-- .../DivisionDivideAndCrop.aspx.designer.cs | 36 ++ .../CQMS/WBS/Control/DivisionDivideList.aspx | 14 +- .../WBS/Control/DivisionDivideList.aspx.cs | 29 +- .../DivisionDivideList.aspx.designer.cs | 8 +- .../WBS/Control/DivisionSubProjects.aspx.cs | 2 +- .../WBS/Control/DivisionSubProjectsNew.aspx | 82 +++++ .../Control/DivisionSubProjectsNew.aspx.cs | 232 ++++++++++++ .../DivisionSubProjectsNew.aspx.designer.cs | 123 +++++++ .../Control/DivisionSubProjectsNewEdit.aspx | 81 +++++ .../DivisionSubProjectsNewEdit.aspx.cs | 344 ++++++++++++++++++ ...ivisionSubProjectsNewEdit.aspx.designer.cs | 159 ++++++++ SGGL/FineUIPro.Web/ErrLog.txt | 132 ------- SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 16 + SGGL/FineUIPro.Web/Web.config | 2 +- SGGL/FineUIPro.Web/common/Menu_CQMS.xml | 2 +- 23 files changed, 1410 insertions(+), 209 deletions(-) create mode 100644 DataBase/版本日志/SGGLDB_WH_V2024-09-28-bwj.sql create mode 100644 SGGL/BLL/CQMS/WBS/SubProjectsService.cs create mode 100644 SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionSubProjectsNew.aspx create mode 100644 SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionSubProjectsNew.aspx.cs create mode 100644 SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionSubProjectsNew.aspx.designer.cs create mode 100644 SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionSubProjectsNewEdit.aspx create mode 100644 SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionSubProjectsNewEdit.aspx.cs create mode 100644 SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionSubProjectsNewEdit.aspx.designer.cs diff --git a/DataBase/版本日志/SGGLDB_WH_V2024-09-28-bwj.sql b/DataBase/版本日志/SGGLDB_WH_V2024-09-28-bwj.sql new file mode 100644 index 00000000..c7db4282 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_WH_V2024-09-28-bwj.sql @@ -0,0 +1,13 @@ + +update Sys_Menu set Url='CQMS/WBS/Control/DivisionSubProjectsNew.aspx' where MenuId='17E206A1-E06B-40C0-8DCB-E3AAA2E3B339' +go + +insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +values('2037FD04-23E2-4286-9F85-AAF1D11384D5','17E206A1-E06B-40C0-8DCB-E3AAA2E3B339','',1) +insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +values('C9D8D3DE-90A9-43AD-8694-85A017DCA9DC','17E206A1-E06B-40C0-8DCB-E3AAA2E3B339','޸',2) +insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +values('0B422E48-08B6-4262-B541-CE149B452E84','17E206A1-E06B-40C0-8DCB-E3AAA2E3B339','ɾ',3) +insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +values('2469D37C-F6A0-49EB-AB85-62F88180C9B4','17E206A1-E06B-40C0-8DCB-E3AAA2E3B339','',4) +go diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index 190fdd7a..01394877 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -301,6 +301,7 @@ + diff --git a/SGGL/BLL/CQMS/WBS/DivisionDivideService.cs b/SGGL/BLL/CQMS/WBS/DivisionDivideService.cs index 106819b4..0da5073b 100644 --- a/SGGL/BLL/CQMS/WBS/DivisionDivideService.cs +++ b/SGGL/BLL/CQMS/WBS/DivisionDivideService.cs @@ -62,5 +62,15 @@ namespace BLL Funs.DB.SubmitChanges(); } } + + /// + /// 根据单位工程Id获取数据 + /// + /// + /// + public static List GetDivisionDivideByUnitWorkId(string unitWorkId) + { + return (from x in Funs.DB.WBS_DivisionDivide where x.UnitWorkId == unitWorkId select x).ToList(); + } } } diff --git a/SGGL/BLL/CQMS/WBS/SubProjectsService.cs b/SGGL/BLL/CQMS/WBS/SubProjectsService.cs new file mode 100644 index 00000000..32f86579 --- /dev/null +++ b/SGGL/BLL/CQMS/WBS/SubProjectsService.cs @@ -0,0 +1,103 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Model; + +namespace BLL +{ + /// + /// 分部分项工程 + /// + public class SubProjectsService + { + /// + /// 根据主键获取分部分项工程 + /// + /// + /// + public static Model.Division_SubProjects GetSubProjectsById(string divisionId) + { + return Funs.DB.Division_SubProjects.FirstOrDefault(e => e.DivisionId == divisionId); + } + + /// + /// 根据项目Id获取分部分项工程数量 + /// + /// + /// + public static int GetSubProjectsByProjectId(string projectId) + { + return (from x in Funs.DB.Division_SubProjects where x.ProjectId == projectId select x).Count(); + } + + /// + /// 添加分部分项 + /// + /// + public static void AddSubProjects(Division_SubProjects subProjects) + { + Model.Division_SubProjects newSubProjects = new Division_SubProjects + { + DivisionId = subProjects.DivisionId, + ProjectId = subProjects.ProjectId, + ParentId = subProjects.ParentId, + DivisionLevel = subProjects.DivisionLevel, + BranchEngineeringCode = subProjects.BranchEngineeringCode, + BranchEngineeringName = subProjects.BranchEngineeringName, + SubBranchEngineeringName = subProjects.SubBranchEngineeringName, + ProEngineeringCode = subProjects.ProEngineeringCode, + ProEngineeringName = subProjects.ProEngineeringName, + ProEngineeringNum = subProjects.ProEngineeringNum, + Remark = subProjects.Remark, + Status=subProjects.Status, + AddUser=subProjects.AddUser, + OperateTime=subProjects.OperateTime, + Sort=subProjects.Sort + }; + Funs.DB.Division_SubProjects.InsertOnSubmit(newSubProjects); + Funs.DB.SubmitChanges(); + } + + /// + /// 修改分部分项 + /// + /// + public static void UpdateSubProjects(Division_SubProjects subProjects) + { + Model.Division_SubProjects newSubProjects = Funs.DB.Division_SubProjects.FirstOrDefault(e => e.DivisionId == subProjects.DivisionId); + if (newSubProjects!=null) + { + newSubProjects.ParentId = subProjects.ParentId; + newSubProjects.DivisionLevel = subProjects.DivisionLevel; + newSubProjects.BranchEngineeringCode = subProjects.BranchEngineeringCode; + newSubProjects.BranchEngineeringName = subProjects.BranchEngineeringName; + newSubProjects.SubBranchEngineeringName = subProjects.SubBranchEngineeringName; + newSubProjects.ProEngineeringCode = subProjects.ProEngineeringCode; + newSubProjects.ProEngineeringName = subProjects.ProEngineeringName; + newSubProjects.ProEngineeringNum = subProjects.ProEngineeringNum; + newSubProjects.Remark = subProjects.Remark; + newSubProjects.Status = subProjects.Status; + newSubProjects.AddUser = subProjects.AddUser; + newSubProjects.OperateTime = subProjects.OperateTime; + newSubProjects.Sort = subProjects.Sort; + Funs.DB.SubmitChanges(); + } + } + + /// + /// 根据主键删除分部分项工程 + /// + /// + public static void DeleteSubProjectsById(string divisionId) + { + var subProjects = Funs.DB.Division_SubProjects.FirstOrDefault(e => e.DivisionId == divisionId); + if (subProjects != null) + { + Funs.DB.Division_SubProjects.DeleteOnSubmit(subProjects); + Funs.DB.SubmitChanges(); + } + } + } +} diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index 3fb3a13c..b263b971 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -3793,6 +3793,11 @@ namespace BLL /// public const string DivisionDivideListMenuId = "BA250432-492B-49A3-8BB6-D04BF74D2EDD"; + /// + /// 分部分项工程数据库 + /// + public const string DivisionSubProjectsMenuId = "17E206A1-E06B-40C0-8DCB-E3AAA2E3B339"; + #endregion #region 工序验收 diff --git a/SGGL/BLL/ProjectData/UnitWorkService.cs b/SGGL/BLL/ProjectData/UnitWorkService.cs index cf918b4a..8e681db9 100644 --- a/SGGL/BLL/ProjectData/UnitWorkService.cs +++ b/SGGL/BLL/ProjectData/UnitWorkService.cs @@ -672,5 +672,14 @@ namespace BLL return (from x in Funs.DB.WBS_UnitWork where x.SuperUnitWork == superUnitWork select x).Count() > 0; } + /// + /// 根据单位工程获取子单位工程信息 + /// + /// + /// + public static List GetUnitWorksBySupUnitWork(string supUnitWork) + { + return (from x in Funs.DB.WBS_UnitWork where x.SuperUnitWork == supUnitWork select x).ToList(); + } } } diff --git a/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionDivideAndCrop.aspx b/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionDivideAndCrop.aspx index 88ec040d..c09845a4 100644 --- a/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionDivideAndCrop.aspx +++ b/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionDivideAndCrop.aspx @@ -18,20 +18,19 @@ + + + - <%-- - - - --%> - + @@ -45,38 +44,24 @@ - - + <%----%> + - + - + - + - + - + - + - + - <%-- - - --%> - <%-- - - - - - - - - - --%> @@ -86,6 +71,33 @@ + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionDivideAndCrop.aspx.cs b/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionDivideAndCrop.aspx.cs index c8a9f825..e678f8a5 100644 --- a/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionDivideAndCrop.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionDivideAndCrop.aspx.cs @@ -155,7 +155,6 @@ namespace FineUIPro.Web.CQMS.WBS.Control #endregion #region 数据绑定和事件 - /// /// 数据绑定 /// @@ -166,7 +165,7 @@ namespace FineUIPro.Web.CQMS.WBS.Control List listStr = new List(); listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); SqlParameter[] parameter = listStr.ToArray(); - var zxsql = strSql + " union all " + strSql1 + " ) as t order by t.Sort,t.DivisionLevel asc"; + var zxsql = strSql + " union all " + strSql1 + " ) as t order by t.BranchEngineeringCode,t.Sort,t.DivisionLevel,t.ProEngineeringNum asc"; DataTable tb = SQLHelper.GetDataTableRunText(zxsql, parameter); Grid1.DataSource = tb; Grid1.DataBind(); @@ -177,28 +176,6 @@ namespace FineUIPro.Web.CQMS.WBS.Control this.Grid1.SelectedRowIDArray = selectIds.ToArray(); } } - - /// - /// 改变页索引 - /// - /// - /// - //protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) - //{ - // Grid1.PageIndex = e.NewPageIndex; - // BindGrid(); - //} - - /// - /// 分页下拉选择事件 - /// - /// - /// - //protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) - //{ - // Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); - // BindGrid(); - //} #endregion #region 保存 @@ -277,6 +254,118 @@ namespace FineUIPro.Web.CQMS.WBS.Control { PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("DivisionDivideAndCropDataIn.aspx", "导入 - "))); } + #endregion + + #region 拷贝 + /// + /// 拷贝 + /// + /// + /// + protected void btnCopy_Click(object sender, EventArgs e) + { + bool isOk = false; + if (!string.IsNullOrEmpty(this.trUnitWork.SelectedNodeID)) + { + var unitwork = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(this.trUnitWork.SelectedNodeID); + if (unitwork != null) + { + Model.WBS_UnitWork newSupUnitWork = new Model.WBS_UnitWork(); + newSupUnitWork.UnitWorkId = SQLHelper.GetNewID(typeof(Model.WBS_UnitWork)); + newSupUnitWork.UnitWorkCode = unitwork.UnitWorkCode; + newSupUnitWork.UnitWorkName = unitwork.UnitWorkName; + newSupUnitWork.ProjectId = this.CurrUser.LoginProjectId; + newSupUnitWork.SuperUnitWork = unitwork.SuperUnitWork; + BLL.UnitWorkService.AddUnitWork(newSupUnitWork); + isOk = true; + + var divisionDivides = BLL.DivisionDivideService.GetDivisionDivideByUnitWorkId(this.trUnitWork.SelectedNodeID); + if (divisionDivides != null) + { + foreach (var item in divisionDivides) + { + Model.WBS_DivisionDivide newDivisionDivide = new Model.WBS_DivisionDivide(); + newDivisionDivide.DivisionDivideId = SQLHelper.GetNewID(typeof(Model.WBS_DivisionDivide)); + newDivisionDivide.ProjectId = this.CurrUser.LoginProjectId; + newDivisionDivide.UnitWorkId = newSupUnitWork.UnitWorkId; + newDivisionDivide.DivisionId = item.DivisionId; + BLL.DivisionDivideService.AddDivisionDivide(newDivisionDivide); + isOk = true; + } + } + + var unitworkList = BLL.UnitWorkService.GetUnitWorksBySupUnitWork(this.trUnitWork.SelectedNodeID); + if (unitworkList.Count() > 0) + { + foreach (var item in unitworkList) + { + Model.WBS_UnitWork newUnitWork = new Model.WBS_UnitWork(); + newUnitWork.UnitWorkId = SQLHelper.GetNewID(typeof(Model.WBS_UnitWork)); + newUnitWork.UnitWorkCode = item.UnitWorkCode; + newUnitWork.UnitWorkName = item.UnitWorkName; + newUnitWork.ProjectId = this.CurrUser.LoginProjectId; + newUnitWork.SuperUnitWork = newSupUnitWork.UnitWorkId; + BLL.UnitWorkService.AddUnitWork(newUnitWork); + isOk = true; + + var divisionDivideLists = BLL.DivisionDivideService.GetDivisionDivideByUnitWorkId(item.UnitWorkId); + if (divisionDivideLists != null) + { + foreach (var divis in divisionDivideLists) + { + Model.WBS_DivisionDivide newDivisionDivide = new Model.WBS_DivisionDivide(); + newDivisionDivide.DivisionDivideId = SQLHelper.GetNewID(typeof(Model.WBS_DivisionDivide)); + newDivisionDivide.ProjectId = this.CurrUser.LoginProjectId; + newDivisionDivide.UnitWorkId = newUnitWork.UnitWorkId; + newDivisionDivide.DivisionId = divis.DivisionId; + BLL.DivisionDivideService.AddDivisionDivide(newDivisionDivide); + isOk = true; + } + } + } + } + } + } + if (isOk) + { + ShowNotify("拷贝成功!", MessageBoxIcon.Success); + } + else + { + ShowNotify("拷贝失败!", MessageBoxIcon.Success); + } + } + #endregion + + #region 修改 + /// + /// 修改 + /// + /// + /// + protected void btnEdit_Click(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(this.trUnitWork.SelectedNodeID)) + { + var unitWork = BLL.UnitWorkService.GetUnitWorkByUnitWorkId(this.trUnitWork.SelectedNodeID); + if (unitWork != null) + { + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("../../../ProjectData/UnitWorkEdit.aspx?Id={0}&&SuperId={1}", this.trUnitWork.SelectedNode.NodeID, unitWork.SuperUnitWork, "编辑 - "))); + } + } + } + #endregion + + #region 关闭弹出窗体 + /// + /// 关闭弹出窗体 + /// + /// + /// + protected void Window2_Close(object sender, WindowCloseEventArgs e) + { + InitTreeMenu(); + } #endregion #region 获取按钮权限 @@ -298,11 +387,12 @@ namespace FineUIPro.Web.CQMS.WBS.Control { this.btnSave.Hidden = false; this.btnImport.Hidden = false; + this.btnCopy.Hidden = false; + this.btnEdit.Hidden = false; } } } #endregion - } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionDivideAndCrop.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionDivideAndCrop.aspx.designer.cs index 688b60c9..3fc33fc4 100644 --- a/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionDivideAndCrop.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionDivideAndCrop.aspx.designer.cs @@ -110,5 +110,41 @@ namespace FineUIPro.Web.CQMS.WBS.Control { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window Window1; + + /// + /// Window2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window2; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnCopy 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnCopy; + + /// + /// btnEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnEdit; } } diff --git a/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionDivideList.aspx b/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionDivideList.aspx index 80bcfe81..fe926e6f 100644 --- a/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionDivideList.aspx +++ b/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionDivideList.aspx @@ -13,13 +13,13 @@ - - + + + <%-- + + --%> + <%----%> diff --git a/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionDivideList.aspx.cs b/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionDivideList.aspx.cs index d8fa6400..952f78fc 100644 --- a/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionDivideList.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionDivideList.aspx.cs @@ -23,6 +23,15 @@ namespace FineUIPro.Web.CQMS.WBS.Control { if (!IsPostBack) { + BLL.UnitWorkService.InitUnitWorkDownList(this.drpUnitWork, this.CurrUser.LoginProjectId, true); + + var subProjectLists = from x in Funs.DB.Division_SubProjects where x.ProjectId==this.CurrUser.LoginProjectId && x.ParentId==null select x; + this.drpBranchEngineering.DataTextField = "BranchEngineeringName"; + this.drpBranchEngineering.DataValueField = "DivisionId"; + this.drpBranchEngineering.DataSource = subProjectLists; + this.drpBranchEngineering.DataBind(); + Funs.FineUIPleaseSelect(this.drpBranchEngineering); + BindGrid(); } } @@ -35,15 +44,15 @@ namespace FineUIPro.Web.CQMS.WBS.Control string strSql = @"SELECT * FROM View_WBS_DivisionDivide WHERE ProjectId = @projectId"; List listStr = new List(); listStr.Add(new SqlParameter("@projectId", this.CurrUser.LoginProjectId)); - if (!string.IsNullOrEmpty(this.txtUnitWorkName.Text.Trim())) + if (this.drpUnitWork.SelectedValue != BLL.Const._Null) { - strSql += " AND SupUnitWorkName LIKE @unitWorkName "; - listStr.Add(new SqlParameter("@unitWorkName", "%" + this.txtUnitWorkName.Text.Trim() + "%")); + strSql += " AND (UnitWorkId =@unitWorkId or SuperUnitWork=@unitWorkId) "; + listStr.Add(new SqlParameter("@unitWorkId", this.drpUnitWork.SelectedValue)); } - if (!string.IsNullOrEmpty(this.txtBranchEngineeringName.Text.Trim())) + if (this.drpBranchEngineering.SelectedValue!=BLL.Const._Null) { - strSql += " AND BranchEngineeringName LIKE @BranchEngineeringName "; - listStr.Add(new SqlParameter("@BranchEngineeringName", "%" + this.txtBranchEngineeringName.Text.Trim() + "%")); + strSql += " AND (DivisionId = @divisionId or ParentId=@divisionId) "; + listStr.Add(new SqlParameter("@divisionId", this.drpBranchEngineering.SelectedValue)); } strSql += " ORDER BY SupUnitWorkCode,ChildUnitWorkCode,Sort,DivisionLevel "; SqlParameter[] parameter = listStr.ToArray(); @@ -85,13 +94,13 @@ namespace FineUIPro.Web.CQMS.WBS.Control var lists = (from x in Funs.DB.View_WBS_DivisionDivide where x.ProjectId == this.CurrUser.LoginProjectId select x); - if (!string.IsNullOrEmpty(this.txtUnitWorkName.Text.Trim())) + if (this.drpUnitWork.SelectedValue != BLL.Const._Null) { - lists = lists.Where(x => x.SuperUnitWork.Contains(this.txtUnitWorkName.Text.Trim())); + lists = lists.Where(x => x.UnitWorkId == this.drpUnitWork.SelectedValue || x.SuperUnitWork == this.drpUnitWork.SelectedValue); } - if (!string.IsNullOrEmpty(this.txtBranchEngineeringName.Text.Trim())) + if (this.drpBranchEngineering.SelectedValue != BLL.Const._Null) { - lists = lists.Where(x => x.BranchEngineeringName.Contains(this.txtBranchEngineeringName.Text.Trim())); + lists = lists.Where(x => x.DivisionId == this.drpBranchEngineering.SelectedValue || x.ParentId==this.drpBranchEngineering.SelectedValue); } lists = lists.OrderBy(x => x.SupUnitWorkCode).ThenBy(x => x.ChildUnitWorkCode).ThenBy(x => x.Sort).ThenBy(x => x.DivisionLevel); diff --git a/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionDivideList.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionDivideList.aspx.designer.cs index 8d72258d..41c0e431 100644 --- a/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionDivideList.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionDivideList.aspx.designer.cs @@ -58,22 +58,22 @@ namespace FineUIPro.Web.CQMS.WBS.Control { protected global::FineUIPro.Toolbar Toolbar1; /// - /// txtUnitWorkName 控件。 + /// drpUnitWork 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.TextBox txtUnitWorkName; + protected global::FineUIPro.DropDownList drpUnitWork; /// - /// txtBranchEngineeringName 控件。 + /// drpBranchEngineering 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.TextBox txtBranchEngineeringName; + protected global::FineUIPro.DropDownList drpBranchEngineering; /// /// btnSearch 控件。 diff --git a/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionSubProjects.aspx.cs b/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionSubProjects.aspx.cs index b80bb860..9466a4a0 100644 --- a/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionSubProjects.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionSubProjects.aspx.cs @@ -100,7 +100,7 @@ namespace FineUIPro.Web.CQMS.WBS.Control } /// - /// 新增 + /// 新增分部工程 /// protected void btnAdd_Click(object sender, EventArgs e) { diff --git a/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionSubProjectsNew.aspx b/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionSubProjectsNew.aspx new file mode 100644 index 00000000..6c0fa7c8 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionSubProjectsNew.aspx @@ -0,0 +1,82 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DivisionSubProjectsNew.aspx.cs" Inherits="FineUIPro.Web.CQMS.WBS.Control.DivisionSubProjectsNew" %> + + + + + + + 分部分项工程数据库 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- + --%> + <%----%> + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionSubProjectsNew.aspx.cs b/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionSubProjectsNew.aspx.cs new file mode 100644 index 00000000..77345482 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionSubProjectsNew.aspx.cs @@ -0,0 +1,232 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; + +namespace FineUIPro.Web.CQMS.WBS.Control +{ + public partial class DivisionSubProjectsNew : PageBase + { + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + GetButtonPower(); + BindGrid(); + } + } + + /// + /// 数据绑定 + /// + public void BindGrid() + { + string strSql = @"select * from(select a.DivisionId,a.ProjectId,a.ParentId,a.DivisionLevel,a.BranchEngineeringCode,a.BranchEngineeringName,a.SubBranchEngineeringName,a.ProEngineeringCode,a.ProEngineeringName,a.ProEngineeringNum,a.Remark,a.AddUser,a.OperateTime,a.Sort,a.Status from Division_SubProjects as a where isnull(a.ProjectId,'')='' "; + string strSql1 = @"select a.DivisionId,a.ProjectId,a.ParentId,a.DivisionLevel,a.BranchEngineeringCode,a.BranchEngineeringName,a.SubBranchEngineeringName,a.ProEngineeringCode,a.ProEngineeringName,a.ProEngineeringNum,a.Remark,a.AddUser,a.OperateTime,a.Sort,a.Status from Division_SubProjects as a inner join Base_Project as b on a.ProjectId=b.ProjectId where a.ProjectId=@ProjectId "; + List listStr = new List(); + listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); + SqlParameter[] parameter = listStr.ToArray(); + var zxsql = strSql + " union all " + strSql1 + " ) as t order by t.BranchEngineeringCode,t.Sort,t.DivisionLevel,t.ProEngineeringNum asc"; + DataTable tb = SQLHelper.GetDataTableRunText(zxsql, parameter); + Grid1.DataSource = tb; + Grid1.DataBind(); + } + #endregion + + #region 删除 + /// + /// 行点击 事件 + /// + protected void Grid1_RowCommand(object sender, GridCommandEventArgs e) + { + if (e.CommandName == "Delete") + { + string rowID = e.RowID; + if (!string.IsNullOrEmpty(rowID)) + { + BLL.SubProjectsService.DeleteSubProjectsById(rowID); + BindGrid(); + ShowNotify("删除成功!", MessageBoxIcon.Success); + } + } + } + + /// + /// 删除 + /// + protected void btnDelete_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(); + if (!string.IsNullOrEmpty(rowID)) + { + BLL.SubProjectsService.DeleteSubProjectsById(rowID); + } + } + BindGrid(); + ShowNotify("删除成功!", MessageBoxIcon.Success); + } + #endregion + + #region 新增 + /// + /// 新增分部工程 + /// + protected void btnAdd_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("DivisionSubProjectsNewEdit.aspx?type=1", "新增 - "))); + } + + /// + /// 新增分项工程 + /// + /// + /// + protected void btnParentAdd_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请选择一条数据!", MessageBoxIcon.Warning); + return; + } + var sub = BLL.SubProjectsService.GetSubProjectsById(this.Grid1.SelectedRowID); + if (sub!=null) + { + if (!string.IsNullOrEmpty(sub.ProEngineeringName)) + { + Alert.ShowInTop("分项工程下不能新增!", MessageBoxIcon.Warning); + return; + } + } + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("DivisionSubProjectsNewEdit.aspx?ParentId={0}&&type=2", this.Grid1.SelectedRowID, "新增分项工程 - "))); + } + #endregion + + #region 编辑 + /// + /// 编辑 + /// + protected void btnEdit_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请选择一条数据!", MessageBoxIcon.Warning); + return; + } + var rowId = this.Grid1.SelectedRowID; + var division = BLL.SubProjectsService.GetSubProjectsById(rowId); + if (division != null) + { + string type = string.Empty; + if (!string.IsNullOrEmpty(division.SubBranchEngineeringName)) + { + type = "1";//子分部工程 + } + else if (!string.IsNullOrEmpty(division.ProEngineeringName)) + { + type = "2";//分项工程 + } + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("DivisionSubProjectsNewEdit.aspx?DivisionId={0}&ParentId={1}&type={2}", rowId, division.ParentId, type, "新增分项工程 - "))); + } + } + #endregion + + #region 关闭弹出窗口 + /// + /// 关闭 + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + } + #endregion + + #region 右击新增子单位工程 + /// + /// 右击新增子单位工程 + /// + protected void btnMenuParentAdd_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请选择一条数据!", MessageBoxIcon.Warning); + return; + } + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("DivisionSubProjectsNewEdit.aspx?ParentId={0}&&type=1", this.Grid1.SelectedRowID, "新增子分部工程 - "))); + } + #endregion + + #region 行选择事件 + /// + /// 行选择事件 + /// + /// + /// + protected void Grid1_RowSelect(object sender, GridRowSelectEventArgs e) + { + string rowid = e.RowID.ToString(); + if (!string.IsNullOrEmpty(rowid)) + { + var sub = BLL.SubProjectsService.GetSubProjectsById(rowid); + if (sub != null) + { + if (!string.IsNullOrEmpty(sub.ParentId)) + { + this.btnMenuParentAdd.Hidden = true; + } + else + { + this.btnMenuParentAdd.Hidden = false; + } + } + } + } + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + if (Request.Params["value"] == "0") + { + return; + } + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.DivisionSubProjectsMenuId); + if (buttonList.Count > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + this.btnAdd.Hidden = false; + this.btnMenuParentAdd.Hidden = false; + this.btnParentAdd.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnEdit.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnDelete.Hidden = false; + } + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionSubProjectsNew.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionSubProjectsNew.aspx.designer.cs new file mode 100644 index 00000000..d8300afb --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionSubProjectsNew.aspx.designer.cs @@ -0,0 +1,123 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.WBS.Control { + + + public partial class DivisionSubProjectsNew { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// btnAdd 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAdd; + + /// + /// btnParentAdd 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnParentAdd; + + /// + /// btnEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnEdit; + + /// + /// btnDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnDelete; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuParentAdd 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuParentAdd; + } +} diff --git a/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionSubProjectsNewEdit.aspx b/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionSubProjectsNewEdit.aspx new file mode 100644 index 00000000..5ae4fc58 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionSubProjectsNewEdit.aspx @@ -0,0 +1,81 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DivisionSubProjectsNewEdit.aspx.cs" Inherits="FineUIPro.Web.CQMS.WBS.Control.DivisionSubProjectsNewEdit" %> + + + + + + + 编辑分部分项工程 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionSubProjectsNewEdit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionSubProjectsNewEdit.aspx.cs new file mode 100644 index 00000000..1b14544c --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionSubProjectsNewEdit.aspx.cs @@ -0,0 +1,344 @@ +using BLL; +using System; + +namespace FineUIPro.Web.CQMS.WBS.Control +{ + public partial class DivisionSubProjectsNewEdit :PageBase + { + #region 定义变量 + /// + /// 主键 + /// + public string DivisionId + { + get + { + return (string)ViewState["DivisionId"]; + } + set + { + ViewState["DivisionId"] = value; + } + } + + /// + /// 上级Id + /// + public string ParentId + { + get + { + return (string)ViewState["ParentId"]; + } + set + { + ViewState["ParentId"] = value; + } + } + + /// + /// 1-分部,2-分项 + /// + public string Type + { + get + { + return (string)ViewState["Type"]; + } + set + { + ViewState["Type"] = value; + } + } + #endregion + + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + GetButtonPower(); + this.Type = Request.Params["type"]; + this.DivisionId = Request.Params["DivisionId"]; + this.ParentId = Request.Params["ParentId"]; + if (!string.IsNullOrEmpty(this.ParentId)) + { + Model.Division_SubProjects subProjects = BLL.SubProjectsService.GetSubProjectsById(this.ParentId); + if (subProjects != null) + { + this.txtBranchEngineeringCode.Text = subProjects.BranchEngineeringCode; + this.txtBranchEngineeringName.Text = subProjects.BranchEngineeringName; + + if (this.Type == "1")//子分部工程 + { + this.txtSubBranchEngineeringName.Required = true; + this.txtSubBranchEngineeringName.ShowRedStar = true; + + if (!string.IsNullOrEmpty(this.DivisionId)) + { + var divis = BLL.SubProjectsService.GetSubProjectsById(this.DivisionId); + if (divis != null) + { + this.txtSubBranchEngineeringName.Text = divis.SubBranchEngineeringName; + this.txtSort.Text = divis.Sort.HasValue ? divis.Sort.ToString() : ""; + this.txtRemark.Text = divis.Remark; + } + } + else + { + //自动获取排序号 + int sort = BLL.SubProjectsService.GetSubProjectsByProjectId(this.CurrUser.LoginProjectId); + if (sort > 0) + { + this.txtSort.Text = (sort + 1).ToString(); + } + } + } + else if (this.Type == "2")//分项工程 + { + this.txtSubBranchEngineeringName.Required = true; + this.txtSubBranchEngineeringName.ShowRedStar = true; + this.txtProEngineeringName.Required = true; + this.txtProEngineeringName.ShowRedStar = true; + this.txtProEngineeringCode.Required = true; + this.txtProEngineeringCode.ShowRedStar = true; + this.txtProEngineeringNum.Required = true; + this.txtProEngineeringNum.ShowRedStar = true; + + var sub = BLL.SubProjectsService.GetSubProjectsById(subProjects.ParentId); + if (sub != null) + { + this.txtBranchEngineeringName.Text = sub.BranchEngineeringName; + } + this.txtSubBranchEngineeringName.Text = subProjects.SubBranchEngineeringName; + if (!string.IsNullOrEmpty(this.DivisionId)) + { + var divis = BLL.SubProjectsService.GetSubProjectsById(this.DivisionId); + if (divis != null) + { + this.txtProEngineeringName.Text = divis.ProEngineeringName; + this.txtProEngineeringCode.Text = divis.ProEngineeringCode; + this.txtProEngineeringNum.Text = divis.ProEngineeringNum; + this.txtSort.Text = divis.Sort.HasValue ? divis.Sort.ToString() : ""; + this.txtRemark.Text = divis.Remark; + } + } + else + { + //自动获取排序号 + int sort = BLL.SubProjectsService.GetSubProjectsByProjectId(this.CurrUser.LoginProjectId); + if (sort > 0) + { + this.txtSort.Text = (sort + 1).ToString(); + } + } + } + } + } + else //分部工程 + { + if (!string.IsNullOrEmpty(this.DivisionId)) + { + Model.Division_SubProjects subProjects = BLL.SubProjectsService.GetSubProjectsById(this.DivisionId); + if (subProjects != null) + { + this.txtBranchEngineeringCode.Text = subProjects.BranchEngineeringCode; + this.txtBranchEngineeringName.Text = subProjects.BranchEngineeringName; + this.txtRemark.Text = subProjects.Remark; + this.txtSort.Text = subProjects.Sort.HasValue ? subProjects.Sort.ToString() : ""; + } + } + else + { + //自动获取排序号 + int sort = BLL.SubProjectsService.GetSubProjectsByProjectId(this.CurrUser.LoginProjectId); + if (sort > 0) + { + this.txtSort.Text = (sort + 1).ToString(); + } + else + { + this.txtSort.Text = "1"; + } + } + } + if (!string.IsNullOrEmpty(this.ParentId)) + { + this.txtBranchEngineeringCode.Readonly = true; + this.txtBranchEngineeringName.Readonly = true; + if (this.Type == "1")//子分部工程 + { + this.Panel1.Hidden = true; + this.childBra.Hidden = false; + } + else if (this.Type == "2")//分项工程 + { + var pare = BLL.SubProjectsService.GetSubProjectsById(this.ParentId); + if (pare != null) + { + if (!string.IsNullOrEmpty(pare.ParentId)) + { + this.childBra.Hidden = false; + this.txtSubBranchEngineeringName.Readonly = true; + } + else + { + this.childBra.Hidden = true; + } + } + this.Panel1.Hidden = false; + } + } + else + { + this.Panel1.Hidden = true; + } + } + } + #endregion + + #region 保存 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + Model.Division_SubProjects newSubProjects = new Model.Division_SubProjects(); + newSubProjects.ProjectId = this.CurrUser.LoginProjectId; + newSubProjects.BranchEngineeringCode = this.txtBranchEngineeringCode.Text.Trim(); + newSubProjects.Remark = this.txtRemark.Text.Trim(); + newSubProjects.AddUser = this.CurrUser.UserId; + newSubProjects.OperateTime = DateTime.Now; + newSubProjects.Sort = Funs.GetNewInt(this.txtSort.Text.Trim()); + if (!string.IsNullOrEmpty(this.ParentId)) + { + newSubProjects.ParentId = this.ParentId; + if (this.Type == "1")//子分部工程 + { + newSubProjects.SubBranchEngineeringName = this.txtSubBranchEngineeringName.Text.Trim(); + if (!string.IsNullOrEmpty(this.DivisionId)) + { + var div = BLL.SubProjectsService.GetSubProjectsById(this.DivisionId); + if(div!=null) + { + newSubProjects.DivisionLevel = div.DivisionLevel; + } + newSubProjects.DivisionId = this.DivisionId; + BLL.SubProjectsService.UpdateSubProjects(newSubProjects); + } + else + { + var sub = BLL.SubProjectsService.GetSubProjectsById(this.ParentId); + if (sub.DivisionLevel == 1) + { + newSubProjects.DivisionLevel = 2; + } + newSubProjects.ProEngineeringName = this.txtProEngineeringName.Text.Trim(); + newSubProjects.DivisionId = SQLHelper.GetNewID(typeof(Model.Division_SubProjects)); + this.DivisionId = newSubProjects.DivisionId; + BLL.SubProjectsService.AddSubProjects(newSubProjects); + } + } + else if (this.Type == "2")//分项工程 + { + newSubProjects.ProEngineeringName = this.txtProEngineeringName.Text.Trim(); + newSubProjects.ProEngineeringCode = this.txtProEngineeringCode.Text.Trim(); + newSubProjects.ProEngineeringNum = this.txtProEngineeringNum.Text.Trim(); + + if (!string.IsNullOrEmpty(this.DivisionId)) + { + var div = BLL.SubProjectsService.GetSubProjectsById(this.DivisionId); + if (div != null) + { + newSubProjects.DivisionLevel = div.DivisionLevel; + } + newSubProjects.DivisionId = this.DivisionId; + BLL.SubProjectsService.UpdateSubProjects(newSubProjects); + } + else + { + var sub = BLL.SubProjectsService.GetSubProjectsById(this.ParentId); + if (sub.DivisionLevel == 1) + { + newSubProjects.DivisionLevel = 2; + } + else if (sub.DivisionLevel==2) + { + newSubProjects.DivisionLevel = 3; + } + newSubProjects.DivisionId = SQLHelper.GetNewID(typeof(Model.Division_SubProjects)); + this.DivisionId = newSubProjects.DivisionId; + BLL.SubProjectsService.AddSubProjects(newSubProjects); + } + } + } + else //分部工程 + { + newSubProjects.BranchEngineeringName = this.txtBranchEngineeringName.Text.Trim(); + newSubProjects.DivisionLevel = 1; + newSubProjects.ProEngineeringCode = "00"; + newSubProjects.ProEngineeringNum = newSubProjects.BranchEngineeringCode + "00"; + if (!string.IsNullOrEmpty(this.DivisionId)) + { + newSubProjects.DivisionId = this.DivisionId; + BLL.SubProjectsService.UpdateSubProjects(newSubProjects); + } + else + { + newSubProjects.DivisionId = SQLHelper.GetNewID(typeof(Model.Division_SubProjects)); + this.DivisionId = newSubProjects.DivisionId; + BLL.SubProjectsService.AddSubProjects(newSubProjects); + } + } + ShowNotify("保存成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + #endregion + + #region 分项工程编号触发事件 + /// + /// 分项工程编号触发事件 + /// + /// + /// + protected void txtProEngineeringCode_TextChanged(object sender, EventArgs e) + { + this.txtProEngineeringNum.Text = string.Empty; + if (!string.IsNullOrEmpty(this.txtBranchEngineeringCode.Text.Trim())&&!string.IsNullOrEmpty(this.txtProEngineeringCode.Text.Trim())) + { + this.txtProEngineeringNum.Text = this.txtBranchEngineeringCode.Text.Trim() + this.txtProEngineeringCode.Text.Trim(); + } + } + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + if (Request.Params["value"] == "0") + { + return; + } + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.DivisionSubProjectsMenuId); + if (buttonList.Count > 0) + { + if (buttonList.Contains(BLL.Const.BtnSave)) + { + this.btnSave.Hidden = false; + } + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionSubProjectsNewEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionSubProjectsNewEdit.aspx.designer.cs new file mode 100644 index 00000000..b5981711 --- /dev/null +++ b/SGGL/FineUIPro.Web/CQMS/WBS/Control/DivisionSubProjectsNewEdit.aspx.designer.cs @@ -0,0 +1,159 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.CQMS.WBS.Control { + + + public partial class DivisionSubProjectsNewEdit { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// txtBranchEngineeringCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtBranchEngineeringCode; + + /// + /// txtBranchEngineeringName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtBranchEngineeringName; + + /// + /// childBra 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FormRow childBra; + + /// + /// txtSubBranchEngineeringName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtSubBranchEngineeringName; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Form2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form2; + + /// + /// txtProEngineeringName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtProEngineeringName; + + /// + /// txtProEngineeringCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtProEngineeringCode; + + /// + /// txtProEngineeringNum 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtProEngineeringNum; + + /// + /// txtSort 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtSort; + + /// + /// txtRemark 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtRemark; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + } +} diff --git a/SGGL/FineUIPro.Web/ErrLog.txt b/SGGL/FineUIPro.Web/ErrLog.txt index 4a631532..e69de29b 100644 --- a/SGGL/FineUIPro.Web/ErrLog.txt +++ b/SGGL/FineUIPro.Web/ErrLog.txt @@ -1,132 +0,0 @@ - -错误信息开始=====> -错误类型:SqlException -错误信息:在将 nvarchar 值 'PP-' 转换成数据类型 int 时失败。 -错误堆栈: - 在 System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) - 在 System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) - 在 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) - 在 System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) - 在 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted) - 在 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) - 在 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) - 在 System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry) - 在 System.Data.SqlClient.SqlCommand.ExecuteNonQuery() - 在 BLL.SQLHelper.RunProcNewId2(String storedProcName, String tableName, String columnName, String projectId) 位置 G:\公司项目\五环\CNCEC_SUBQHSE_WUHUAN\SGGL\BLL\SQLHelper.cs:行号 880 - 在 FineUIPro.Web.TestRun.DriverSchemeEdit.Page_Load(Object sender, EventArgs e) 位置 G:\公司项目\五环\CNCEC_SUBQHSE_WUHUAN\SGGL\FineUIPro.Web\TestRun\DriverSchemeEdit.aspx.cs:行号 154 - 在 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) - 在 System.EventHandler.Invoke(Object sender, EventArgs e) - 在 System.Web.UI.Control.OnLoad(EventArgs e) - 在 System.Web.UI.Control.LoadRecursive() - 在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) -出错时间:09/23/2024 10:27:46 -出错文件:http://localhost:8579/TestRun/DriverSchemeEdit.aspx?SolutionType=09 -IP地址:::1 -操作人员:JT - -出错时间:09/23/2024 10:27:46 - - -错误信息开始=====> -错误类型:ArgumentException -错误信息:提供的 URI 方案“http”无效,应为“https”。 -参数名: via -错误堆栈: - 在 System.ServiceModel.Channels.TransportChannelFactory`1.ValidateScheme(Uri via) - 在 System.ServiceModel.Channels.HttpChannelFactory`1.ValidateCreateChannelParameters(EndpointAddress remoteAddress, Uri via) - 在 System.ServiceModel.Channels.HttpsChannelFactory`1.ValidateCreateChannelParameters(EndpointAddress remoteAddress, Uri via) - 在 System.ServiceModel.Channels.HttpsChannelFactory`1.OnCreateChannelCore(EndpointAddress address, Uri via) - 在 System.ServiceModel.Channels.HttpChannelFactory`1.OnCreateChannel(EndpointAddress remoteAddress, Uri via) - 在 System.ServiceModel.Channels.ChannelFactoryBase`1.InternalCreateChannel(EndpointAddress address, Uri via) - 在 System.ServiceModel.Channels.ChannelFactoryBase`1.CreateChannel(EndpointAddress address, Uri via) - 在 System.ServiceModel.Channels.ServiceChannelFactory.ServiceChannelFactoryOverRequest.CreateInnerChannelBinder(EndpointAddress to, Uri via) - 在 System.ServiceModel.Channels.ServiceChannelFactory.CreateServiceChannel(EndpointAddress address, Uri via) - 在 System.ServiceModel.Channels.ServiceChannelFactory.CreateChannel(Type channelType, EndpointAddress address, Uri via) - 在 System.ServiceModel.ChannelFactory`1.CreateChannel(EndpointAddress address, Uri via) - 在 System.ServiceModel.ChannelFactory`1.CreateChannel() - 在 System.ServiceModel.ClientBase`1.CreateChannel() - 在 System.ServiceModel.ClientBase`1.CreateChannelInternal() - 在 System.ServiceModel.ClientBase`1.get_Channel() - 在 BLL.CNCECHSSEService.HSSEServiceClient.GetSupervise_SubUnitReportListToSUB() 位置 G:\公司项目\五环\CNCEC_SUBQHSE_WUHUAN\SGGL\BLL\Service References\CNCECHSSEService\Reference.cs:行号 13827 - 在 BLL.CNCECHSSEWebService.getSupervise_SubUnitReport() 位置 G:\公司项目\五环\CNCEC_SUBQHSE_WUHUAN\SGGL\BLL\WebService\CNCECHSSEWebService.cs:行号 2181 -出错时间:09/24/2024 13:18:32 -出错时间:09/24/2024 13:18:32 - - -错误信息开始=====> -错误类型:ArgumentException -错误信息:提供的 URI 方案“http”无效,应为“https”。 -参数名: via -错误堆栈: - 在 System.ServiceModel.Channels.TransportChannelFactory`1.ValidateScheme(Uri via) - 在 System.ServiceModel.Channels.HttpChannelFactory`1.ValidateCreateChannelParameters(EndpointAddress remoteAddress, Uri via) - 在 System.ServiceModel.Channels.HttpsChannelFactory`1.ValidateCreateChannelParameters(EndpointAddress remoteAddress, Uri via) - 在 System.ServiceModel.Channels.HttpsChannelFactory`1.OnCreateChannelCore(EndpointAddress address, Uri via) - 在 System.ServiceModel.Channels.HttpChannelFactory`1.OnCreateChannel(EndpointAddress remoteAddress, Uri via) - 在 System.ServiceModel.Channels.ChannelFactoryBase`1.InternalCreateChannel(EndpointAddress address, Uri via) - 在 System.ServiceModel.Channels.ChannelFactoryBase`1.CreateChannel(EndpointAddress address, Uri via) - 在 System.ServiceModel.Channels.ServiceChannelFactory.ServiceChannelFactoryOverRequest.CreateInnerChannelBinder(EndpointAddress to, Uri via) - 在 System.ServiceModel.Channels.ServiceChannelFactory.CreateServiceChannel(EndpointAddress address, Uri via) - 在 System.ServiceModel.Channels.ServiceChannelFactory.CreateChannel(Type channelType, EndpointAddress address, Uri via) - 在 System.ServiceModel.ChannelFactory`1.CreateChannel(EndpointAddress address, Uri via) - 在 System.ServiceModel.ChannelFactory`1.CreateChannel() - 在 System.ServiceModel.ClientBase`1.CreateChannel() - 在 System.ServiceModel.ClientBase`1.CreateChannelInternal() - 在 System.ServiceModel.ClientBase`1.get_Channel() - 在 BLL.CNCECHSSEService.HSSEServiceClient.GetCheck_CheckInfo_Table8ItemListToSUB(String unitId) 位置 G:\公司项目\五环\CNCEC_SUBQHSE_WUHUAN\SGGL\BLL\Service References\CNCECHSSEService\Reference.cs:行号 13851 - 在 BLL.CNCECHSSEWebService.getCheck_CheckInfo_Table8Item() 位置 G:\公司项目\五环\CNCEC_SUBQHSE_WUHUAN\SGGL\BLL\WebService\CNCECHSSEWebService.cs:行号 2046 -出错时间:09/24/2024 13:18:32 -出错时间:09/24/2024 13:18:32 - - -错误信息开始=====> -错误类型:ArgumentException -错误信息:提供的 URI 方案“http”无效,应为“https”。 -参数名: via -错误堆栈: - 在 System.ServiceModel.Channels.TransportChannelFactory`1.ValidateScheme(Uri via) - 在 System.ServiceModel.Channels.HttpChannelFactory`1.ValidateCreateChannelParameters(EndpointAddress remoteAddress, Uri via) - 在 System.ServiceModel.Channels.HttpsChannelFactory`1.ValidateCreateChannelParameters(EndpointAddress remoteAddress, Uri via) - 在 System.ServiceModel.Channels.HttpsChannelFactory`1.OnCreateChannelCore(EndpointAddress address, Uri via) - 在 System.ServiceModel.Channels.HttpChannelFactory`1.OnCreateChannel(EndpointAddress remoteAddress, Uri via) - 在 System.ServiceModel.Channels.ChannelFactoryBase`1.InternalCreateChannel(EndpointAddress address, Uri via) - 在 System.ServiceModel.Channels.ChannelFactoryBase`1.CreateChannel(EndpointAddress address, Uri via) - 在 System.ServiceModel.Channels.ServiceChannelFactory.ServiceChannelFactoryOverRequest.CreateInnerChannelBinder(EndpointAddress to, Uri via) - 在 System.ServiceModel.Channels.ServiceChannelFactory.CreateServiceChannel(EndpointAddress address, Uri via) - 在 System.ServiceModel.Channels.ServiceChannelFactory.CreateChannel(Type channelType, EndpointAddress address, Uri via) - 在 System.ServiceModel.ChannelFactory`1.CreateChannel(EndpointAddress address, Uri via) - 在 System.ServiceModel.ChannelFactory`1.CreateChannel() - 在 System.ServiceModel.ClientBase`1.CreateChannel() - 在 System.ServiceModel.ClientBase`1.CreateChannelInternal() - 在 System.ServiceModel.ClientBase`1.get_Channel() - 在 BLL.CNCECHSSEService.HSSEServiceClient.GetCheck_CheckRectifyListToSUB(String unitId) 位置 G:\公司项目\五环\CNCEC_SUBQHSE_WUHUAN\SGGL\BLL\Service References\CNCECHSSEService\Reference.cs:行号 13843 - 在 BLL.CNCECHSSEWebService.getCheck_CheckRectify() 位置 G:\公司项目\五环\CNCEC_SUBQHSE_WUHUAN\SGGL\BLL\WebService\CNCECHSSEWebService.cs:行号 1942 -出错时间:09/24/2024 13:18:32 -出错时间:09/24/2024 13:18:32 - - -错误信息开始=====> -错误类型:ArgumentException -错误信息:提供的 URI 方案“http”无效,应为“https”。 -参数名: via -错误堆栈: - 在 System.ServiceModel.Channels.TransportChannelFactory`1.ValidateScheme(Uri via) - 在 System.ServiceModel.Channels.HttpChannelFactory`1.ValidateCreateChannelParameters(EndpointAddress remoteAddress, Uri via) - 在 System.ServiceModel.Channels.HttpsChannelFactory`1.ValidateCreateChannelParameters(EndpointAddress remoteAddress, Uri via) - 在 System.ServiceModel.Channels.HttpsChannelFactory`1.OnCreateChannelCore(EndpointAddress address, Uri via) - 在 System.ServiceModel.Channels.HttpChannelFactory`1.OnCreateChannel(EndpointAddress remoteAddress, Uri via) - 在 System.ServiceModel.Channels.ChannelFactoryBase`1.InternalCreateChannel(EndpointAddress address, Uri via) - 在 System.ServiceModel.Channels.ChannelFactoryBase`1.CreateChannel(EndpointAddress address, Uri via) - 在 System.ServiceModel.Channels.ServiceChannelFactory.ServiceChannelFactoryOverRequest.CreateInnerChannelBinder(EndpointAddress to, Uri via) - 在 System.ServiceModel.Channels.ServiceChannelFactory.CreateServiceChannel(EndpointAddress address, Uri via) - 在 System.ServiceModel.Channels.ServiceChannelFactory.CreateChannel(Type channelType, EndpointAddress address, Uri via) - 在 System.ServiceModel.ChannelFactory`1.CreateChannel(EndpointAddress address, Uri via) - 在 System.ServiceModel.ChannelFactory`1.CreateChannel() - 在 System.ServiceModel.ClientBase`1.CreateChannel() - 在 System.ServiceModel.ClientBase`1.CreateChannelInternal() - 在 System.ServiceModel.ClientBase`1.get_Channel() - 在 BLL.CNCECHSSEService.HSSEServiceClient.GetInformation_UrgeReportToSUB(String unitId) 位置 G:\公司项目\五环\CNCEC_SUBQHSE_WUHUAN\SGGL\BLL\Service References\CNCECHSSEService\Reference.cs:行号 13643 - 在 BLL.CNCECHSSEWebService.getInformation_UrgeReport() 位置 G:\公司项目\五环\CNCEC_SUBQHSE_WUHUAN\SGGL\BLL\WebService\CNCECHSSEWebService.cs:行号 1884 -出错时间:09/24/2024 13:18:32 -出错时间:09/24/2024 13:18:32 - diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 77eed5c7..758095f5 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -608,6 +608,8 @@ + + @@ -8675,6 +8677,20 @@ DivisionSubProjectsEdit.aspx + + DivisionSubProjectsNew.aspx + ASPXCodeBehind + + + DivisionSubProjectsNew.aspx + + + DivisionSubProjectsNewEdit.aspx + ASPXCodeBehind + + + DivisionSubProjectsNewEdit.aspx + PointCropping.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/Web.config b/SGGL/FineUIPro.Web/Web.config index f50b26d3..9fc55c34 100644 --- a/SGGL/FineUIPro.Web/Web.config +++ b/SGGL/FineUIPro.Web/Web.config @@ -12,7 +12,7 @@ - + diff --git a/SGGL/FineUIPro.Web/common/Menu_CQMS.xml b/SGGL/FineUIPro.Web/common/Menu_CQMS.xml index e4d2b968..cefc9ef0 100644 --- a/SGGL/FineUIPro.Web/common/Menu_CQMS.xml +++ b/SGGL/FineUIPro.Web/common/Menu_CQMS.xml @@ -8,7 +8,7 @@ - +