diff --git a/DataBase/菜单初始化脚本/1-13移交管理(Menu_Transfer).sql b/DataBase/菜单初始化脚本/1-13移交管理(Menu_Transfer).sql index 6a324c30..8c2ad907 100644 --- a/DataBase/菜单初始化脚本/1-13移交管理(Menu_Transfer).sql +++ b/DataBase/菜单初始化脚本/1-13移交管理(Menu_Transfer).sql @@ -148,7 +148,7 @@ GO GO INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) -VALUES('016903B1-3B86-4CF5-AFF8-FF8BE389BEE5','HVAC','Transfer/HVAC.aspx',120,'0','Menu_Transfer',0,1,1) +VALUES('016903B1-3B86-4CF5-AFF8-FF8BE389BEE5','Punchlist from','Transfer/PunchlistFrom.aspx',120,'0','Menu_Transfer',0,1,1) GO INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) VALUES('1C032535-64B2-4E4C-95CF-E58547017E14','016903B1-3B86-4CF5-AFF8-FF8BE389BEE5','',1) diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index 23bf1692..cd88e993 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -3985,6 +3985,21 @@ namespace BLL #endregion #endregion + #region + public const string ProjectSetupMenuId = "48545C6A-9D10-47F4-810F-DAB0CFCD5BF9"; + public const string PipingMenuId = "D94C1BA4-9DFD-4514-AE12-6F886C5D8C9B"; + public const string StaticEquipmentMenuId = "982F746C-084C-445C-9AE8-8C37BDFE7994"; + public const string RotatingEquipmentMenuId = "7E2FB5F9-FB99-4455-B68F-460F1F9A2676"; + public const string InstrumentationMenuId = "88F51059-55B4-4CD5-A38C-36404E5029F6"; + public const string ElectricalMenuId = "296E75D2-192A-4D1F-8471-DD34263F8691"; + public const string CivilStructureMenuId = "95C39F86-C060-452E-BA37-D891C466A39B"; + public const string FirefightingMenuId = "794E64E2-FDD2-4B7D-8408-F7FB06F9C92A"; + public const string TelecomMenuId = "58FFBD80-ACB9-4830-A18A-E025D9600D94"; + public const string PlumbingMenuId = "95295BF7-FB51-480D-9902-6ADA4E8427FC"; + public const string HVACMenuId = "05442049-1310-45B1-9D3D-CAAE759D8F3E"; + public const string PunchlistFromMenuId = "016903B1-3B86-4CF5-AFF8-FF8BE389BEE5"; + #endregion + #endregion #region 质量流程定义 diff --git a/SGGL/BLL/Transfer/ProjectSetupService.cs b/SGGL/BLL/Transfer/ProjectSetupService.cs index 8a8e3a26..94cd1be4 100644 --- a/SGGL/BLL/Transfer/ProjectSetupService.cs +++ b/SGGL/BLL/Transfer/ProjectSetupService.cs @@ -2,11 +2,91 @@ using System.Collections.Generic; using System.Linq; using System.Text; -using System.Threading.Tasks; +using System.Collections; +using System.Web.UI.WebControls; -namespace BLL.Transfer +namespace BLL { - class ProjectSetupService + public class ProjectSetupService { + /// + /// 根据主键获取设备材料报验信息 + /// + /// + /// + public static Model.Transfer_ProjectSetup GetProjectSetupById(string Id) + { + return Funs.DB.Transfer_ProjectSetup.FirstOrDefault(e => e.Id == Id); + } + + /// + /// 添加设备材料报验 + /// + /// + public static void AddProjectSetup(Model.Transfer_ProjectSetup ProjectSetup) + { + Model.SGGLDB db = Funs.DB; + Model.Transfer_ProjectSetup newProjectSetup = new Model.Transfer_ProjectSetup(); + newProjectSetup.Id = ProjectSetup.Id; + newProjectSetup.ProjectId = ProjectSetup.ProjectId; + newProjectSetup.SN = ProjectSetup.SN; + newProjectSetup.PlantNo = ProjectSetup.PlantNo; + newProjectSetup.PlantName = ProjectSetup.PlantName; + newProjectSetup.CommissioningSystem = ProjectSetup.CommissioningSystem; + newProjectSetup.CommissioningCodeDescription = ProjectSetup.CommissioningCodeDescription; + newProjectSetup.SubCommissioningSystem = ProjectSetup.SubCommissioningSystem; + newProjectSetup.SubCommissioningCodeDescription = ProjectSetup.SubCommissioningCodeDescription; + newProjectSetup.DescriptionArea = ProjectSetup.DescriptionArea; + newProjectSetup.TurnoverSystemSequenceNumber = ProjectSetup.TurnoverSystemSequenceNumber; + newProjectSetup.Description = ProjectSetup.Description; + newProjectSetup.TurnoverCode = ProjectSetup.TurnoverCode; + newProjectSetup.TurnoverDescription = ProjectSetup.TurnoverDescription; + newProjectSetup.Remark = ProjectSetup.Remark; + db.Transfer_ProjectSetup.InsertOnSubmit(newProjectSetup); + db.SubmitChanges(); + } + + /// + /// 修改设备材料报验 + /// + /// + public static void UpdateProjectSetup(Model.Transfer_ProjectSetup ProjectSetup) + { + Model.SGGLDB db = Funs.DB; + Model.Transfer_ProjectSetup newProjectSetup = db.Transfer_ProjectSetup.FirstOrDefault(e => e.Id == ProjectSetup.Id); + if (newProjectSetup != null) + { + newProjectSetup.ProjectId = ProjectSetup.ProjectId; + newProjectSetup.SN = ProjectSetup.SN; + newProjectSetup.PlantNo = ProjectSetup.PlantNo; + newProjectSetup.PlantName = ProjectSetup.PlantName; + newProjectSetup.CommissioningSystem = ProjectSetup.CommissioningSystem; + newProjectSetup.CommissioningCodeDescription = ProjectSetup.CommissioningCodeDescription; + newProjectSetup.SubCommissioningSystem = ProjectSetup.SubCommissioningSystem; + newProjectSetup.SubCommissioningCodeDescription = ProjectSetup.SubCommissioningCodeDescription; + newProjectSetup.DescriptionArea = ProjectSetup.DescriptionArea; + newProjectSetup.TurnoverSystemSequenceNumber = ProjectSetup.TurnoverSystemSequenceNumber; + newProjectSetup.Description = ProjectSetup.Description; + newProjectSetup.TurnoverCode = ProjectSetup.TurnoverCode; + newProjectSetup.TurnoverDescription = ProjectSetup.TurnoverDescription; + newProjectSetup.Remark = ProjectSetup.Remark; + db.SubmitChanges(); + } + } + + /// + /// 根据主键删除设备材料报验 + /// + /// + public static void DeleteProjectSetup(string Id) + { + Model.SGGLDB db = Funs.DB; + Model.Transfer_ProjectSetup ProjectSetup = db.Transfer_ProjectSetup.FirstOrDefault(e => e.Id == Id); + if (ProjectSetup != null) + { + db.Transfer_ProjectSetup.DeleteOnSubmit(ProjectSetup); + db.SubmitChanges(); + } + } } } diff --git a/SGGL/FineUIPro.Web/Transfer/ProjectSetup.aspx b/SGGL/FineUIPro.Web/Transfer/ProjectSetup.aspx index 5ce31af8..5181a9b7 100644 --- a/SGGL/FineUIPro.Web/Transfer/ProjectSetup.aspx +++ b/SGGL/FineUIPro.Web/Transfer/ProjectSetup.aspx @@ -9,8 +9,126 @@
-
-
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/Transfer/ProjectSetup.aspx.cs b/SGGL/FineUIPro.Web/Transfer/ProjectSetup.aspx.cs index 1ef011d5..74d176c9 100644 --- a/SGGL/FineUIPro.Web/Transfer/ProjectSetup.aspx.cs +++ b/SGGL/FineUIPro.Web/Transfer/ProjectSetup.aspx.cs @@ -1,17 +1,240 @@ -using System; +using BLL; +using BLL.CQMS.Comprehensive; +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.Transfer { - public partial class ProjectSetup : System.Web.UI.Page + public partial class ProjectSetup : PageBase { + #region 加载 + /// + /// 加载页面 + /// + /// + /// protected void Page_Load(object sender, EventArgs e) { + if (!IsPostBack) + { + GetButtonPower(); + BindGrid(); + } + } + /// + /// 数据绑定 + /// + public void BindGrid() + { + string strSql = @"select InspectionEquipmentId,ProjectId,C.UnitId,Status, U.UnitName,InspectionCode,CN.ProfessionalName,InspectionName,Specifications,Unit, + Supplier,Counts,SamplingCount,(CASE WHEN SamplingResult=1 THEN '合格' WHEN SamplingResult=0 THEN '不合格' ELSE '' END) AS SamplingResult, + InspectionDate,AttachUrl,Attribute,RemarkCode,UsedPlace,EquipmentNO from Comprehensive_InspectionEquipment C + left join Base_Unit U on C.UnitId=U.UnitId + left join Base_CNProfessional CN on C.CNProfessionalId=CN.CNProfessionalId + where C.ProjectId = @ProjectId"; + List listStr = new List(); + listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); + 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(); + } + #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("InspectionEquipmentEdit.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("InspectionEquipmentEdit.aspx?InspectionEquipmentId={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 InspectionEquipment = BLL.InspectionEquipmentService.GetInspectionEquipmentById(rowID); + if (InspectionEquipment != null) + { + BLL.InspectionEquipmentService.DeleteInspectionEquipment(rowID); + } + } + BindGrid(); + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + } + #endregion + + #region 导入 + /// + /// 导入按钮 + /// + /// + /// + protected void btnImport_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("InspectionEquipmentDataIn.aspx", "导入 - "))); + } + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + if (Request.Params["value"] == "0") + { + return; + } + var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.InspectionEquipmentMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnMenuDel.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnSave)) + { + this.btnImport.Hidden = false; + } + } + } + #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 "编制"; } } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/Transfer/ProjectSetup.aspx.designer.cs b/SGGL/FineUIPro.Web/Transfer/ProjectSetup.aspx.designer.cs index a594cc44..12cfd988 100644 --- a/SGGL/FineUIPro.Web/Transfer/ProjectSetup.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/Transfer/ProjectSetup.aspx.designer.cs @@ -1,19 +1,17 @@ //------------------------------------------------------------------------------ -// +// <自动生成> // 此代码由工具生成。 // -// 对此文件的更改可能会导致不正确的行为,并且如果 -// 重新生成代码,这些更改将会丢失。 -// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// //------------------------------------------------------------------------------ -namespace FineUIPro.Web.Transfer -{ - - - public partial class ProjectSetup - { - +namespace FineUIPro.Web.Transfer { + + + public partial class ProjectSetup { + /// /// form1 控件。 /// @@ -22,5 +20,131 @@ namespace FineUIPro.Web.Transfer /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 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; + + /// + /// ToolSearch 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar ToolSearch; + + /// + /// btnImport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnImport; + + /// + /// lblPageIndex 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblPageIndex; + + /// + /// 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; + + /// + /// btnMenuDel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDel; } }