feat(hjgl): 新增防腐等级字典管理
将防腐等级维护纳入焊接设置菜单,便于统一维护防腐等级编码并复用系统权限配置。
This commit is contained in:
@@ -0,0 +1,102 @@
|
||||
SET XACT_ABORT ON;
|
||||
BEGIN TRANSACTION;
|
||||
|
||||
DECLARE @MenuId NVARCHAR(50) = N'44F69908-89DF-4B96-86F8-6ACC0019FBE7';
|
||||
DECLARE @MaterialMenuId NVARCHAR(50) = N'8IDKGJE2-09B1-4607-BC6D-865CE48F0013';
|
||||
DECLARE @SuperMenu NVARCHAR(50);
|
||||
DECLARE @MenuType NVARCHAR(50);
|
||||
DECLARE @SortIndex INT;
|
||||
DECLARE @IsOffice BIT;
|
||||
|
||||
SELECT
|
||||
@SuperMenu = SuperMenu,
|
||||
@MenuType = MenuType,
|
||||
@SortIndex = SortIndex,
|
||||
@IsOffice = IsOffice
|
||||
FROM dbo.Sys_Menu
|
||||
WHERE MenuId = @MaterialMenuId;
|
||||
|
||||
IF @SuperMenu IS NULL
|
||||
BEGIN
|
||||
RAISERROR(N'未找到“管道材质定义”菜单,无法确定防腐等级定义菜单位置。', 16, 1);
|
||||
ROLLBACK TRANSACTION;
|
||||
RETURN;
|
||||
END;
|
||||
|
||||
IF NOT EXISTS (SELECT 1 FROM dbo.Sys_Menu WHERE MenuId = @MenuId)
|
||||
BEGIN
|
||||
UPDATE dbo.Sys_Menu
|
||||
SET SortIndex = ISNULL(SortIndex, 0) + 1
|
||||
WHERE SuperMenu = @SuperMenu
|
||||
AND ISNULL(SortIndex, 0) >= ISNULL(@SortIndex, 0);
|
||||
|
||||
INSERT INTO dbo.Sys_Menu
|
||||
(MenuId, MenuName, Icon, Url, SortIndex, SuperMenu, MenuType, IsOffice, IsEnd, IsUsed)
|
||||
VALUES
|
||||
(@MenuId, N'防腐等级定义', NULL, N'HJGL/BaseInfo/PaintCodeDict.aspx',
|
||||
@SortIndex, @SuperMenu, @MenuType, @IsOffice, 1, 1);
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
UPDATE dbo.Sys_Menu
|
||||
SET MenuName = N'防腐等级定义',
|
||||
Url = N'HJGL/BaseInfo/PaintCodeDict.aspx',
|
||||
SuperMenu = @SuperMenu,
|
||||
MenuType = @MenuType,
|
||||
IsEnd = 1,
|
||||
IsUsed = 1
|
||||
WHERE MenuId = @MenuId;
|
||||
END;
|
||||
|
||||
IF NOT EXISTS (SELECT 1 FROM dbo.Sys_ButtonToMenu WHERE MenuId = @MenuId AND ButtonName = N'增加')
|
||||
INSERT INTO dbo.Sys_ButtonToMenu (ButtonToMenuId, MenuId, ButtonName, SortIndex)
|
||||
VALUES (N'D9437722-E216-408D-84DB-BBCBBF2763DF', @MenuId, N'增加', 1);
|
||||
|
||||
IF NOT EXISTS (SELECT 1 FROM dbo.Sys_ButtonToMenu WHERE MenuId = @MenuId AND ButtonName = N'修改')
|
||||
INSERT INTO dbo.Sys_ButtonToMenu (ButtonToMenuId, MenuId, ButtonName, SortIndex)
|
||||
VALUES (N'0752CB84-0E82-4B3D-B7C4-8A563C65F340', @MenuId, N'修改', 2);
|
||||
|
||||
IF NOT EXISTS (SELECT 1 FROM dbo.Sys_ButtonToMenu WHERE MenuId = @MenuId AND ButtonName = N'删除')
|
||||
INSERT INTO dbo.Sys_ButtonToMenu (ButtonToMenuId, MenuId, ButtonName, SortIndex)
|
||||
VALUES (N'3D4C0A40-C1F5-4431-A464-EA92CCA7C4D7', @MenuId, N'删除', 3);
|
||||
|
||||
IF NOT EXISTS (SELECT 1 FROM dbo.Sys_ButtonToMenu WHERE MenuId = @MenuId AND ButtonName = N'保存')
|
||||
INSERT INTO dbo.Sys_ButtonToMenu (ButtonToMenuId, MenuId, ButtonName, SortIndex)
|
||||
VALUES (N'CFA71E37-08DE-4F49-8740-0F13B341331D', @MenuId, N'保存', 4);
|
||||
|
||||
IF NOT EXISTS (SELECT 1 FROM dbo.Sys_ButtonToMenu WHERE MenuId = @MenuId AND ButtonName = N'查看')
|
||||
INSERT INTO dbo.Sys_ButtonToMenu (ButtonToMenuId, MenuId, ButtonName, SortIndex)
|
||||
VALUES (N'8EA926AF-CDF1-4F63-AF94-B91B3569D266', @MenuId, N'查看', 5);
|
||||
|
||||
INSERT INTO dbo.Sys_RolePower (RolePowerId, RoleId, MenuId, MenuType, IsOffice)
|
||||
SELECT CONVERT(NVARCHAR(50), NEWID()), source.RoleId, @MenuId, @MenuType, source.IsOffice
|
||||
FROM dbo.Sys_RolePower source
|
||||
WHERE source.MenuId = @MaterialMenuId
|
||||
AND NOT EXISTS
|
||||
(
|
||||
SELECT 1
|
||||
FROM dbo.Sys_RolePower target
|
||||
WHERE target.RoleId = source.RoleId
|
||||
AND target.MenuId = @MenuId
|
||||
);
|
||||
|
||||
INSERT INTO dbo.Sys_ButtonPower (ButtonPowerID, RoleId, MenuId, ButtonToMenuId)
|
||||
SELECT CONVERT(NVARCHAR(50), NEWID()), sourcePower.RoleId, @MenuId, targetButton.ButtonToMenuId
|
||||
FROM dbo.Sys_ButtonPower sourcePower
|
||||
INNER JOIN dbo.Sys_ButtonToMenu sourceButton
|
||||
ON sourceButton.ButtonToMenuId = sourcePower.ButtonToMenuId
|
||||
AND sourceButton.MenuId = @MaterialMenuId
|
||||
INNER JOIN dbo.Sys_ButtonToMenu targetButton
|
||||
ON targetButton.MenuId = @MenuId
|
||||
AND targetButton.ButtonName = sourceButton.ButtonName
|
||||
WHERE sourcePower.MenuId = @MaterialMenuId
|
||||
AND NOT EXISTS
|
||||
(
|
||||
SELECT 1
|
||||
FROM dbo.Sys_ButtonPower targetPower
|
||||
WHERE targetPower.RoleId = sourcePower.RoleId
|
||||
AND targetPower.MenuId = @MenuId
|
||||
AND targetPower.ButtonToMenuId = targetButton.ButtonToMenuId
|
||||
);
|
||||
|
||||
COMMIT TRANSACTION;
|
||||
@@ -407,6 +407,7 @@
|
||||
<Compile Include="HJGL\BaseInfo\Base_DNCompareService.cs" />
|
||||
<Compile Include="HJGL\BaseInfo\Base_GrooveTypeService.cs" />
|
||||
<Compile Include="HJGL\BaseInfo\Base_MaterialService.cs" />
|
||||
<Compile Include="HJGL\BaseInfo\PaintCodeDictService.cs" />
|
||||
<Compile Include="HJGL\BaseInfo\Base_MediumService.cs" />
|
||||
<Compile Include="HJGL\BaseInfo\Base_PipingClassService.cs" />
|
||||
<Compile Include="HJGL\BaseInfo\Base_PressurePipingClassService.cs" />
|
||||
|
||||
@@ -2844,6 +2844,11 @@ namespace BLL
|
||||
/// </summary>
|
||||
public const string HJGL_MaterialMenuId = "8IDKGJE2-09B1-4607-BC6D-865CE48F0013";
|
||||
|
||||
/// <summary>
|
||||
/// 防腐等级定义
|
||||
/// </summary>
|
||||
public const string HJGL_PaintCodeDictMenuId = "44F69908-89DF-4B96-86F8-6ACC0019FBE7";
|
||||
|
||||
/// <summary>
|
||||
/// 介质定义
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
using Model;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class PaintCodeDictService
|
||||
{
|
||||
public static List<Tw_PaintCodeDict> GetList(string paintCode)
|
||||
{
|
||||
var query = Funs.DB.Tw_PaintCodeDict.AsQueryable();
|
||||
if (!string.IsNullOrEmpty(paintCode))
|
||||
{
|
||||
query = query.Where(x => x.PaintCode.Contains(paintCode));
|
||||
}
|
||||
|
||||
return query.OrderBy(x => x.SortIndex).ThenBy(x => x.PaintCode).ToList();
|
||||
}
|
||||
|
||||
public static Tw_PaintCodeDict GetById(string id)
|
||||
{
|
||||
return Funs.DB.Tw_PaintCodeDict.FirstOrDefault(x => x.Id == id);
|
||||
}
|
||||
|
||||
public static bool PaintCodeExists(string paintCode, string excludeId)
|
||||
{
|
||||
if (string.IsNullOrEmpty(excludeId))
|
||||
{
|
||||
return Funs.DB.Tw_PaintCodeDict.Any(x => x.PaintCode == paintCode);
|
||||
}
|
||||
|
||||
return Funs.DB.Tw_PaintCodeDict.Any(x => x.PaintCode == paintCode && x.Id != excludeId);
|
||||
}
|
||||
|
||||
public static void Add(Tw_PaintCodeDict paintCodeDict)
|
||||
{
|
||||
Funs.DB.Tw_PaintCodeDict.InsertOnSubmit(paintCodeDict);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
public static void Update(Tw_PaintCodeDict paintCodeDict)
|
||||
{
|
||||
var model = Funs.DB.Tw_PaintCodeDict.First(x => x.Id == paintCodeDict.Id);
|
||||
model.PaintCode = paintCodeDict.PaintCode;
|
||||
model.Primer = paintCodeDict.Primer;
|
||||
model.IntermediatePaint = paintCodeDict.IntermediatePaint;
|
||||
model.Topcoat = paintCodeDict.Topcoat;
|
||||
model.ColorCode = paintCodeDict.ColorCode;
|
||||
model.SortIndex = paintCodeDict.SortIndex;
|
||||
model.IsUsed = paintCodeDict.IsUsed;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
public static string GetDeleteRestriction(string id)
|
||||
{
|
||||
if (Funs.DB.HJGL_Pipeline.Any(x => x.PaintId == id))
|
||||
{
|
||||
return "已在【管线信息】中使用,不能删除!";
|
||||
}
|
||||
|
||||
if (Funs.DB.HJGL_AntiCorrosionCheckRecord.Any(x => x.PaintId == id))
|
||||
{
|
||||
return "已在【防腐检查记录】中使用,不能删除!";
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
public static void Delete(string id)
|
||||
{
|
||||
var model = Funs.DB.Tw_PaintCodeDict.First(x => x.Id == id);
|
||||
Funs.DB.Tw_PaintCodeDict.DeleteOnSubmit(model);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1541,6 +1541,9 @@
|
||||
<Content Include="HJGL\BaseInfo\MaterialColorIn.aspx" />
|
||||
<Content Include="HJGL\BaseInfo\MaterialEdit.aspx" />
|
||||
<Content Include="HJGL\BaseInfo\MaterialView.aspx" />
|
||||
<Content Include="HJGL\BaseInfo\PaintCodeDict.aspx" />
|
||||
<Content Include="HJGL\BaseInfo\PaintCodeDictEdit.aspx" />
|
||||
<Content Include="HJGL\BaseInfo\PaintCodeDictView.aspx" />
|
||||
<Content Include="HJGL\BaseInfo\Medium.aspx" />
|
||||
<Content Include="HJGL\BaseInfo\MediumEdit.aspx" />
|
||||
<Content Include="HJGL\BaseInfo\MediumIn.aspx" />
|
||||
@@ -10338,6 +10341,27 @@
|
||||
<Compile Include="HJGL\BaseInfo\MaterialView.aspx.designer.cs">
|
||||
<DependentUpon>MaterialView.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="HJGL\BaseInfo\PaintCodeDict.aspx.cs">
|
||||
<DependentUpon>PaintCodeDict.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="HJGL\BaseInfo\PaintCodeDict.aspx.designer.cs">
|
||||
<DependentUpon>PaintCodeDict.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="HJGL\BaseInfo\PaintCodeDictEdit.aspx.cs">
|
||||
<DependentUpon>PaintCodeDictEdit.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="HJGL\BaseInfo\PaintCodeDictEdit.aspx.designer.cs">
|
||||
<DependentUpon>PaintCodeDictEdit.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="HJGL\BaseInfo\PaintCodeDictView.aspx.cs">
|
||||
<DependentUpon>PaintCodeDictView.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="HJGL\BaseInfo\PaintCodeDictView.aspx.designer.cs">
|
||||
<DependentUpon>PaintCodeDictView.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="HJGL\BaseInfo\Medium.aspx.cs">
|
||||
<DependentUpon>Medium.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PaintCodeDict.aspx.cs" Inherits="FineUIPro.Web.HJGL.BaseInfo.PaintCodeDict" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title>防腐等级定义</title>
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
|
||||
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" runat="server" ShowBorder="true" ShowHeader="false" Title="防腐等级定义"
|
||||
BoxFlex="1" EnableColumnLines="true" ForceFit="true" DataKeyNames="Id" DataIDField="Id"
|
||||
AllowSorting="true" SortField="SortIndex" SortDirection="ASC" OnSort="Grid1_Sort"
|
||||
AllowPaging="true" IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange"
|
||||
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="true">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Top" runat="server">
|
||||
<Items>
|
||||
<f:TextBox ID="txtPaintCode" runat="server" Label="防腐等级" EmptyText="输入查询条件"
|
||||
Width="300px" LabelWidth="100px" LabelAlign="Right" />
|
||||
<f:Button ID="btnQuery" runat="server" Text="查询" Icon="SystemSearch"
|
||||
OnClick="btnQuery_Click" />
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server" />
|
||||
<f:Button ID="btnNew" runat="server" Text="新增" Icon="Add" OnClick="btnNew_Click" />
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:RenderField Width="120px" ColumnID="PaintCode" DataField="PaintCode" HeaderText="防腐等级"
|
||||
HeaderTextAlign="Center" TextAlign="Left" SortField="PaintCode" />
|
||||
<f:RenderField Width="180px" ColumnID="Primer" DataField="Primer" HeaderText="底漆"
|
||||
HeaderTextAlign="Center" TextAlign="Left" SortField="Primer" />
|
||||
<f:RenderField Width="180px" ColumnID="IntermediatePaint" DataField="IntermediatePaint" HeaderText="中间漆"
|
||||
HeaderTextAlign="Center" TextAlign="Left" SortField="IntermediatePaint" />
|
||||
<f:RenderField Width="180px" ColumnID="Topcoat" DataField="Topcoat" HeaderText="面漆"
|
||||
HeaderTextAlign="Center" TextAlign="Left" SortField="Topcoat" />
|
||||
<f:RenderField Width="100px" ColumnID="ColorCode" DataField="ColorCode" HeaderText="色标"
|
||||
HeaderTextAlign="Center" TextAlign="Left" SortField="ColorCode" />
|
||||
<f:RenderField Width="80px" ColumnID="SortIndex" DataField="SortIndex" HeaderText="排序"
|
||||
HeaderTextAlign="Center" TextAlign="Center" SortField="SortIndex" />
|
||||
<f:CheckBoxField Width="80px" ColumnID="IsUsed" DataField="IsUsed" HeaderText="启用"
|
||||
RenderAsStaticField="true" TextAlign="Center" SortField="IsUsed" />
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
|
||||
</Listeners>
|
||||
<PageItems>
|
||||
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server" />
|
||||
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:" />
|
||||
<f:DropDownList ID="ddlPageSize" runat="server" Width="80px" AutoPostBack="true"
|
||||
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged" />
|
||||
</PageItems>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Window ID="Window1" runat="server" Title="弹出窗体" Hidden="true" EnableIFrame="true"
|
||||
EnableMaximize="true" Target="Top" EnableResize="false" IsModal="true" Width="780px" Height="500px"
|
||||
OnClose="Window1_Close" />
|
||||
<f:Menu ID="Menu1" runat="server">
|
||||
<f:MenuButton ID="btnMenuEdit" runat="server" Text="编辑" Icon="BulletEdit" OnClick="btnMenuEdit_Click" />
|
||||
<f:MenuButton ID="btnMenuDelete" runat="server" Text="删除" Icon="Delete" OnClick="btnMenuDelete_Click"
|
||||
ConfirmText="删除选中行?" ConfirmTarget="Top" />
|
||||
<f:MenuButton ID="btnView" runat="server" Text="查看" Icon="Find" OnClick="btnView_Click" />
|
||||
</f:Menu>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
var menuID = '<%= Menu1.ClientID %>';
|
||||
function onRowContextMenu() {
|
||||
F(menuID).show();
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,170 @@
|
||||
using BLL;
|
||||
using System;
|
||||
|
||||
namespace FineUIPro.Web.HJGL.BaseInfo
|
||||
{
|
||||
public partial class PaintCodeDict : PageBase
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
Funs.DropDownPageSize(ddlPageSize);
|
||||
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
||||
BindGrid();
|
||||
}
|
||||
}
|
||||
|
||||
private void BindGrid()
|
||||
{
|
||||
var list = PaintCodeDictService.GetList(txtPaintCode.Text.Trim());
|
||||
Grid1.RecordCount = list.Count;
|
||||
Grid1.DataSource = GetPagedDataTable(Grid1, list);
|
||||
Grid1.DataBind();
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
protected void Grid1_Sort(object sender, GridSortEventArgs e)
|
||||
{
|
||||
Grid1.SortField = e.SortField;
|
||||
Grid1.SortDirection = e.SortDirection;
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
protected void btnQuery_Click(object sender, EventArgs e)
|
||||
{
|
||||
Grid1.PageIndex = 0;
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
protected void btnNew_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!GetButtonPower(Const.BtnAdd))
|
||||
{
|
||||
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference("PaintCodeDictEdit.aspx"));
|
||||
}
|
||||
|
||||
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
|
||||
{
|
||||
EditData();
|
||||
}
|
||||
|
||||
protected void btnMenuEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
EditData();
|
||||
}
|
||||
|
||||
private void EditData()
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInTop("请至少选择一条记录", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetButtonPower(Const.BtnModify))
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(
|
||||
string.Format("PaintCodeDictEdit.aspx?Id={0}", Grid1.SelectedRowID)));
|
||||
}
|
||||
else if (GetButtonPower(Const.BtnSee))
|
||||
{
|
||||
ShowView();
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnMenuDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!GetButtonPower(Const.BtnDelete))
|
||||
{
|
||||
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInTop("请至少选择一条记录", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
string warning = string.Empty;
|
||||
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
||||
{
|
||||
string id = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
var model = PaintCodeDictService.GetById(id);
|
||||
string restriction = PaintCodeDictService.GetDeleteRestriction(id);
|
||||
if (string.IsNullOrEmpty(restriction))
|
||||
{
|
||||
PaintCodeDictService.Delete(id);
|
||||
}
|
||||
else
|
||||
{
|
||||
warning += "防腐等级:" + model.PaintCode + restriction;
|
||||
}
|
||||
}
|
||||
|
||||
BindGrid();
|
||||
if (string.IsNullOrEmpty(warning))
|
||||
{
|
||||
ShowNotify("删除成功!", MessageBoxIcon.Success);
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop(warning, MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnView_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInTop("请至少选择一条记录", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!GetButtonPower(Const.BtnSee))
|
||||
{
|
||||
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
ShowView();
|
||||
}
|
||||
|
||||
private void ShowView()
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(
|
||||
string.Format("PaintCodeDictView.aspx?Id={0}", Grid1.SelectedRowID)));
|
||||
}
|
||||
|
||||
protected void Window1_Close(object sender, EventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
private bool GetButtonPower(string button)
|
||||
{
|
||||
return CommonService.GetAllButtonPowerList(CurrUser.LoginProjectId, CurrUser.PersonId,
|
||||
Const.HJGL_PaintCodeDictMenuId, button);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.HJGL.BaseInfo
|
||||
{
|
||||
public partial class PaintCodeDict
|
||||
{
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
protected global::FineUIPro.TextBox txtPaintCode;
|
||||
protected global::FineUIPro.Button btnQuery;
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
protected global::FineUIPro.Button btnNew;
|
||||
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
|
||||
protected global::FineUIPro.ToolbarText ToolbarText1;
|
||||
protected global::FineUIPro.DropDownList ddlPageSize;
|
||||
protected global::FineUIPro.Window Window1;
|
||||
protected global::FineUIPro.Menu Menu1;
|
||||
protected global::FineUIPro.MenuButton btnMenuEdit;
|
||||
protected global::FineUIPro.MenuButton btnMenuDelete;
|
||||
protected global::FineUIPro.MenuButton btnView;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PaintCodeDictEdit.aspx.cs" Inherits="FineUIPro.Web.HJGL.BaseInfo.PaintCodeDictEdit" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title>编辑防腐等级</title>
|
||||
<base target="_self" />
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
|
||||
<f:Form ID="SimpleForm1" runat="server" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
BodyPadding="10px" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtPaintCode" runat="server" Label="防腐等级" Required="true"
|
||||
MaxLength="50" ShowRedStar="true" FocusOnPageLoad="true" LabelWidth="120px" />
|
||||
<f:TextBox ID="txtColorCode" runat="server" Label="色标" MaxLength="100" LabelWidth="120px" />
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextArea ID="txtPrimer" runat="server" Label="底漆" MaxLength="300" LabelWidth="120px" />
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextArea ID="txtIntermediatePaint" runat="server" Label="中间漆" MaxLength="300" LabelWidth="120px" />
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextArea ID="txtTopcoat" runat="server" Label="面漆" MaxLength="300" LabelWidth="120px" />
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:NumberBox ID="txtSortIndex" runat="server" Label="排序" DecimalPrecision="0"
|
||||
NoNegative="true" LabelWidth="120px" />
|
||||
<f:CheckBox ID="chkIsUsed" runat="server" Label="启用" Checked="true" LabelWidth="120px" />
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:Button ID="btnSave" runat="server" Icon="SystemSave" ValidateForms="SimpleForm1"
|
||||
OnClick="btnSave_Click" ToolTip="保存" />
|
||||
<f:Button ID="btnClose" runat="server" Text="关闭" Icon="SystemClose" EnablePostBack="false" />
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:Form>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,74 @@
|
||||
using BLL;
|
||||
using System;
|
||||
|
||||
namespace FineUIPro.Web.HJGL.BaseInfo
|
||||
{
|
||||
public partial class PaintCodeDictEdit : PageBase
|
||||
{
|
||||
private string PaintCodeDictId
|
||||
{
|
||||
get { return (string)ViewState["PaintCodeDictId"]; }
|
||||
set { ViewState["PaintCodeDictId"] = value; }
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
PaintCodeDictId = Request.Params["Id"];
|
||||
if (!string.IsNullOrEmpty(PaintCodeDictId))
|
||||
{
|
||||
BindForm();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void BindForm()
|
||||
{
|
||||
var model = PaintCodeDictService.GetById(PaintCodeDictId);
|
||||
txtPaintCode.Text = model.PaintCode;
|
||||
txtPrimer.Text = model.Primer;
|
||||
txtIntermediatePaint.Text = model.IntermediatePaint;
|
||||
txtTopcoat.Text = model.Topcoat;
|
||||
txtColorCode.Text = model.ColorCode;
|
||||
txtSortIndex.Text = model.SortIndex.HasValue ? model.SortIndex.Value.ToString() : string.Empty;
|
||||
chkIsUsed.Checked = model.IsUsed;
|
||||
}
|
||||
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
string paintCode = txtPaintCode.Text.Trim();
|
||||
if (PaintCodeDictService.PaintCodeExists(paintCode, PaintCodeDictId))
|
||||
{
|
||||
Alert.ShowInTop("此防腐等级已存在", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
var model = new Model.Tw_PaintCodeDict
|
||||
{
|
||||
Id = PaintCodeDictId,
|
||||
PaintCode = paintCode,
|
||||
Primer = txtPrimer.Text.Trim(),
|
||||
IntermediatePaint = txtIntermediatePaint.Text.Trim(),
|
||||
Topcoat = txtTopcoat.Text.Trim(),
|
||||
ColorCode = txtColorCode.Text.Trim(),
|
||||
SortIndex = string.IsNullOrEmpty(txtSortIndex.Text) ? (int?)null : Convert.ToInt32(txtSortIndex.Text),
|
||||
IsUsed = chkIsUsed.Checked
|
||||
};
|
||||
|
||||
if (string.IsNullOrEmpty(PaintCodeDictId))
|
||||
{
|
||||
model.Id = SQLHelper.GetNewID();
|
||||
PaintCodeDictService.Add(model);
|
||||
}
|
||||
else
|
||||
{
|
||||
PaintCodeDictService.Update(model);
|
||||
}
|
||||
|
||||
ShowNotify("保存成功!", MessageBoxIcon.Success);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.HJGL.BaseInfo
|
||||
{
|
||||
public partial class PaintCodeDictEdit
|
||||
{
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
protected global::FineUIPro.Form SimpleForm1;
|
||||
protected global::FineUIPro.TextBox txtPaintCode;
|
||||
protected global::FineUIPro.TextBox txtColorCode;
|
||||
protected global::FineUIPro.TextArea txtPrimer;
|
||||
protected global::FineUIPro.TextArea txtIntermediatePaint;
|
||||
protected global::FineUIPro.TextArea txtTopcoat;
|
||||
protected global::FineUIPro.NumberBox txtSortIndex;
|
||||
protected global::FineUIPro.CheckBox chkIsUsed;
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
protected global::FineUIPro.Button btnClose;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PaintCodeDictView.aspx.cs" Inherits="FineUIPro.Web.HJGL.BaseInfo.PaintCodeDictView" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title>查看防腐等级</title>
|
||||
<base target="_self" />
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
|
||||
<f:Form ID="SimpleForm1" runat="server" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
BodyPadding="10px" LabelAlign="Right">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtPaintCode" runat="server" Label="防腐等级" Readonly="true" LabelWidth="120px" />
|
||||
<f:TextBox ID="txtColorCode" runat="server" Label="色标" Readonly="true" LabelWidth="120px" />
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow><Items><f:TextArea ID="txtPrimer" runat="server" Label="底漆" Readonly="true" LabelWidth="120px" /></Items></f:FormRow>
|
||||
<f:FormRow><Items><f:TextArea ID="txtIntermediatePaint" runat="server" Label="中间漆" Readonly="true" LabelWidth="120px" /></Items></f:FormRow>
|
||||
<f:FormRow><Items><f:TextArea ID="txtTopcoat" runat="server" Label="面漆" Readonly="true" LabelWidth="120px" /></Items></f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtSortIndex" runat="server" Label="排序" Readonly="true" LabelWidth="120px" />
|
||||
<f:CheckBox ID="chkIsUsed" runat="server" Label="启用" Enabled="false" LabelWidth="120px" />
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:Button ID="btnClose" runat="server" Text="关闭" Icon="SystemClose" EnablePostBack="false" />
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:Form>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,24 @@
|
||||
using BLL;
|
||||
using System;
|
||||
|
||||
namespace FineUIPro.Web.HJGL.BaseInfo
|
||||
{
|
||||
public partial class PaintCodeDictView : PageBase
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
var model = PaintCodeDictService.GetById(Request.Params["Id"]);
|
||||
txtPaintCode.Text = model.PaintCode;
|
||||
txtPrimer.Text = model.Primer;
|
||||
txtIntermediatePaint.Text = model.IntermediatePaint;
|
||||
txtTopcoat.Text = model.Topcoat;
|
||||
txtColorCode.Text = model.ColorCode;
|
||||
txtSortIndex.Text = model.SortIndex.HasValue ? model.SortIndex.Value.ToString() : string.Empty;
|
||||
chkIsUsed.Checked = model.IsUsed;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 此代码由工具生成。
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.HJGL.BaseInfo
|
||||
{
|
||||
public partial class PaintCodeDictView
|
||||
{
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
protected global::FineUIPro.Form SimpleForm1;
|
||||
protected global::FineUIPro.TextBox txtPaintCode;
|
||||
protected global::FineUIPro.TextBox txtColorCode;
|
||||
protected global::FineUIPro.TextArea txtPrimer;
|
||||
protected global::FineUIPro.TextArea txtIntermediatePaint;
|
||||
protected global::FineUIPro.TextArea txtTopcoat;
|
||||
protected global::FineUIPro.TextBox txtSortIndex;
|
||||
protected global::FineUIPro.CheckBox chkIsUsed;
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
protected global::FineUIPro.Button btnClose;
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,8 @@
|
||||
<TreeNode id="8IDKGJE2-09B1-4607-BC6D-865CE48F0014" Text="管道介质" NavigateUrl="HJGL/BaseInfo/Medium.aspx"></TreeNode>
|
||||
<TreeNode id="2F027233-22EC-4063-A04F-FB9FE6A91588" Text="材料仓库" NavigateUrl="HJGL/BaseInfo/Warehouse.aspx"></TreeNode>
|
||||
<TreeNode id="F6194C00-D256-485D-9056-171FAB75928A" Text="管道颜色标识库" NavigateUrl="HJGL/BaseInfo/MaterialColor.aspx"></TreeNode>
|
||||
<TreeNode id="85DFE1D3-9E68-46B5-87E5-A525698F2F5F" Text="焊接设置" NavigateUrl=""><TreeNode id="8IDKGJE2-09B1-4607-BC6D-865CE48F0013" Text="管道材质定义" NavigateUrl="HJGL/BaseInfo/Material.aspx"></TreeNode>
|
||||
<TreeNode id="85DFE1D3-9E68-46B5-87E5-A525698F2F5F" Text="焊接设置" NavigateUrl=""><TreeNode id="44F69908-89DF-4B96-86F8-6ACC0019FBE7" Text="防腐等级定义" NavigateUrl="HJGL/BaseInfo/PaintCodeDict.aspx"></TreeNode>
|
||||
<TreeNode id="8IDKGJE2-09B1-4607-BC6D-865CE48F0013" Text="管道材质定义" NavigateUrl="HJGL/BaseInfo/Material.aspx"></TreeNode>
|
||||
<TreeNode id="8IDKGJE2-09B1-4607-BC6D-865CE48F0011" Text="管道规格定义" NavigateUrl="HJGL/BaseInfo/Control.aspx"></TreeNode>
|
||||
<TreeNode id="8IDKGJE2-09B1-4607-BC6D-865CE48F0010" Text="焊接方法定义" NavigateUrl="HJGL/BaseInfo/WeldingMethod.aspx"></TreeNode>
|
||||
<TreeNode id="8IDKGJE2-09B1-4607-BC6D-865CE48F0004" Text="焊接耗材定义" NavigateUrl="HJGL/BaseInfo/Consumables.aspx"></TreeNode>
|
||||
|
||||
Reference in New Issue
Block a user