202306181、新增设备管理(门禁、监控、环境监测)页面2、新增设备软件管理(门禁、监控、环境监测)页面3、优化费用管理模块。
This commit is contained in:
@@ -1502,6 +1502,10 @@
|
||||
<Content Include="res\indexv1\js\world.js" />
|
||||
<Content Include="SHIYE\InformationProject\SafetyBriefing.aspx" />
|
||||
<Content Include="SHIYE\InformationProject\SafetyBriefingEdit.aspx" />
|
||||
<Content Include="SmartSite\SoftManage.aspx" />
|
||||
<Content Include="SmartSite\EquipmentManage.aspx" />
|
||||
<Content Include="SmartSite\SoftManageEdit.aspx" />
|
||||
<Content Include="SmartSite\EquipmentManageEdit.aspx" />
|
||||
<Content Include="SysManage\OutputValueProject.aspx" />
|
||||
<Content Include="SysManage\ProjectToDo.aspx" />
|
||||
<Content Include="ZHGL\DataIn\AccidentCauseReportBar.aspx" />
|
||||
@@ -12878,6 +12882,34 @@
|
||||
<Compile Include="SHIYE\InformationProject\SafetyBriefingEdit.aspx.designer.cs">
|
||||
<DependentUpon>SafetyBriefingEdit.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SmartSite\SoftManage.aspx.cs">
|
||||
<DependentUpon>SoftManage.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="SmartSite\SoftManage.aspx.designer.cs">
|
||||
<DependentUpon>SoftManage.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SmartSite\EquipmentManage.aspx.cs">
|
||||
<DependentUpon>EquipmentManage.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="SmartSite\EquipmentManage.aspx.designer.cs">
|
||||
<DependentUpon>EquipmentManage.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SmartSite\SoftManageEdit.aspx.cs">
|
||||
<DependentUpon>SoftManageEdit.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="SmartSite\SoftManageEdit.aspx.designer.cs">
|
||||
<DependentUpon>SoftManageEdit.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SmartSite\EquipmentManageEdit.aspx.cs">
|
||||
<DependentUpon>EquipmentManageEdit.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="SmartSite\EquipmentManageEdit.aspx.designer.cs">
|
||||
<DependentUpon>EquipmentManageEdit.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="SysManage\CustomQuery.aspx.cs">
|
||||
<DependentUpon>CustomQuery.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
@@ -13879,7 +13911,7 @@
|
||||
<AutoAssignPort>True</AutoAssignPort>
|
||||
<DevelopmentServerPort>0</DevelopmentServerPort>
|
||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
||||
<IISUrl>http://localhost:8667/</IISUrl>
|
||||
<IISUrl>http://localhost:1773/</IISUrl>
|
||||
<NTLMAuthentication>False</NTLMAuthentication>
|
||||
<UseCustomServer>False</UseCustomServer>
|
||||
<CustomServerUrl>
|
||||
|
||||
@@ -219,7 +219,7 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
|
||||
var getCostManageItem = from x in Funs.DB.CostGoods_CostManageItem
|
||||
join y in Funs.DB.CostGoods_CostManage on x.CostManageId equals y.CostManageId
|
||||
where y.ProjectId == this.ProjectId && (unitId == null || y.UnitId == unitId)
|
||||
where y.ProjectId == this.ProjectId && (unitId == null || y.UnitId == unitId) && y.States==Const.State_2
|
||||
select new { x.CostManageId, x.CostManageItemId, Year = y.CostManageDate.Value.Year, x.SupCostTypeId, x.CostTypeId, x.PriceMoney };
|
||||
|
||||
foreach (var item in getType)
|
||||
|
||||
@@ -231,7 +231,7 @@ namespace FineUIPro.Web.HSSE.CostGoods
|
||||
|
||||
var getCostManageItem = from x in Funs.DB.CostGoods_CostManageItem
|
||||
join y in Funs.DB.CostGoods_CostManage on x.CostManageId equals y.CostManageId
|
||||
where y.ProjectId == this.ProjectId && (!year.HasValue || y.CostManageDate.Value.Year == year)
|
||||
where y.ProjectId == this.ProjectId && (!year.HasValue || y.CostManageDate.Value.Year == year) && y.States == Const.State_2
|
||||
select new { x.CostManageId, x.CostManageItemId, y.UnitId, Year = y.CostManageDate.Value.Year, x.SupCostTypeId, x.CostTypeId, x.PriceMoney };
|
||||
|
||||
var getType = (from x in getDetail select new { x.SupSortIndex, x.SortIndex, x.CostType }).Distinct();
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EquipmentManage.aspx.cs" Inherits="FineUIPro.Web.SmartSite.EquipmentManage" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<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" ShowBorder="true" ShowHeader="false" Title="设备管理" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="EquipmentId" AllowCellEditing="true" EnableColumnLines="true"
|
||||
ClicksToEdit="2" DataIDField="EquipmentId" AllowSorting="true" SortField="ProjectName,EquipmentName"
|
||||
SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true"
|
||||
OnPageIndexChange="Grid1_PageIndexChange" EnableRowDoubleClickEvent="true" ForceFit="true"
|
||||
OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Top" runat="server">
|
||||
<Items>
|
||||
<f:TextBox runat="server" ID="txtEquipmentName" EmptyText="按名称查询" AutoPostBack="true"
|
||||
OnTextChanged="TextBox_TextChanged" Width="250px" LabelAlign="Right">
|
||||
</f:TextBox>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server">
|
||||
</f:ToolbarFill>
|
||||
<f:Button ID="btnNew" Text="新增" Icon="Add" EnablePostBack="false" runat="server"
|
||||
Hidden="true">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:RenderField Width="250px" ColumnID="ProjectName" DataField="ProjectName"
|
||||
FieldType="String" HeaderText="项目名称" HeaderTextAlign="Center" TextAlign="Left" >
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="EquipmentName" DataField="EquipmentName"
|
||||
FieldType="String" HeaderText="设备名称" HeaderTextAlign="Center" TextAlign="Left" >
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="EquipmentModel" DataField="EquipmentModel"
|
||||
FieldType="String" HeaderText="设备型号" HeaderTextAlign="Center" TextAlign="Left" >
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="90px" ColumnID="Number" DataField="Number"
|
||||
FieldType="Int" HeaderText="数量" HeaderTextAlign="Center" TextAlign="Right" >
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="90px" ColumnID="RunningState" DataField="RunningState"
|
||||
FieldType="String" HeaderText="运行状态" HeaderTextAlign="Center" TextAlign="Center" >
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="220px" ColumnID="Supplier" DataField="Supplier"
|
||||
FieldType="String" HeaderText="供货商" HeaderTextAlign="Center" TextAlign="Left" >
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="SupplierMan" DataField="SupplierMan"
|
||||
FieldType="String" HeaderText="售后联系人" HeaderTextAlign="Center" TextAlign="Left" >
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="120px" ColumnID="SupplierTel" DataField="SupplierTel"
|
||||
FieldType="String" HeaderText="售后联系电话" HeaderTextAlign="Center" TextAlign="Right" >
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
|
||||
</Listeners>
|
||||
<PageItems>
|
||||
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
|
||||
</f:ToolbarSeparator>
|
||||
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
|
||||
</f:ToolbarText>
|
||||
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
|
||||
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
|
||||
</f:DropDownList>
|
||||
</PageItems>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Window ID="Window1" Title="设备管理" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="800px"
|
||||
Height="380px">
|
||||
</f:Window>
|
||||
<f:Menu ID="Menu1" runat="server">
|
||||
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true"
|
||||
Hidden="true" runat="server" Text="编辑" Icon="Pencil">
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true"
|
||||
Hidden="true" ConfirmText="删除选中行?" ConfirmTarget="Top" runat="server" Text="删除"
|
||||
Icon="Delete">
|
||||
</f:MenuButton>
|
||||
</f:Menu>
|
||||
</form>
|
||||
<script type="text/jscript">
|
||||
var menuID = '<%= Menu1.ClientID %>';
|
||||
// 返回false,来阻止浏览器右键菜单
|
||||
function onRowContextMenu(event, rowId) {
|
||||
F(menuID).show(); //showAt(event.pageX, event.pageY);
|
||||
return false;
|
||||
}
|
||||
|
||||
function reloadGrid() {
|
||||
__doPostBack(null, 'reloadGrid');
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,276 @@
|
||||
namespace FineUIPro.Web.SmartSite
|
||||
{
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
|
||||
public partial class EquipmentManage : PageBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 类型
|
||||
/// </summary>
|
||||
public string Type
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["Type"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["Type"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 菜单id
|
||||
/// </summary>
|
||||
public string MenuId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["MenuId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["MenuId"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.Type = Request.Params["type"];
|
||||
if (this.Type == "D")
|
||||
{
|
||||
this.MenuId = Const.EquipmentManageDMenuId;
|
||||
}
|
||||
else if (this.Type == "M")
|
||||
{
|
||||
this.MenuId = Const.EquipmentManageMMenuId;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.MenuId = Const.EquipmentManageEMenuId;
|
||||
}
|
||||
////权限按钮方法
|
||||
this.GetButtonPower();
|
||||
this.btnNew.OnClientClick = Window1.GetShowReference("EquipmentManageEdit.aspx?type="+this.Type) + "return false;";
|
||||
Funs.DropDownPageSize(this.ddlPageSize);
|
||||
// 绑定表格
|
||||
this.BindGrid();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
string strSql = @"SELECT EquipmentId,EQ.ProjectId,P.ProjectName,Type,EquipmentName,EquipmentModel,Number,RunningState
|
||||
,Supplier,SupplierMan,SupplierTel
|
||||
FROM SmartSite_Equipment AS EQ
|
||||
LEFT JOIN Base_Project AS P ON EQ.ProjectId=P.ProjectId WHERE 1 = 1";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
strSql += " AND Type = @Type";
|
||||
listStr.Add(new SqlParameter("@Type", this.Type));
|
||||
if (!string.IsNullOrEmpty(this.txtEquipmentName.Text.Trim()))
|
||||
{
|
||||
strSql += " AND EquipmentName LIKE @EquipmentName";
|
||||
listStr.Add(new SqlParameter("@EquipmentName", "%" + this.txtEquipmentName.Text.Trim() + "%"));
|
||||
}
|
||||
//if (this.drpLicenseType.SelectedValue != BLL.Const._Null)
|
||||
//{
|
||||
// strSql += " AND EquipmentManage.LicenseType = @LicenseTypeId";
|
||||
// listStr.Add(new SqlParameter("@LicenseTypeId", this.drpLicenseType.SelectedValue));
|
||||
//}
|
||||
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
|
||||
#region 查询
|
||||
/// <summary>
|
||||
/// 查询
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void TextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取按钮权限
|
||||
/// <summary>
|
||||
/// 获取按钮权限
|
||||
/// </summary>
|
||||
/// <param name="button"></param>
|
||||
/// <returns></returns>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
var buttonList = CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, this.MenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(Const.BtnAdd))
|
||||
{
|
||||
this.btnNew.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(Const.BtnModify))
|
||||
{
|
||||
this.btnMenuEdit.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(Const.BtnDelete))
|
||||
{
|
||||
this.btnMenuDelete.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 删除数据
|
||||
/// <summary>
|
||||
/// 右键删除事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DeleteData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除方法
|
||||
/// </summary>
|
||||
private void DeleteData()
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length > 0)
|
||||
{
|
||||
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
||||
{
|
||||
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
if (judgementDelete(rowID, false))
|
||||
{
|
||||
var getD = EquipmentService.GetEquipmentByEquipmentId(rowID);
|
||||
if (getD != null)
|
||||
{
|
||||
LogService.AddSys_Log(this.CurrUser, getD.EquipmentName.ToString(), getD.EquipmentId,this.MenuId, BLL.Const.BtnDelete);
|
||||
BLL.EquipmentService.DeleteEquipmentById(rowID);
|
||||
}
|
||||
}
|
||||
}
|
||||
BindGrid();
|
||||
ShowNotify("删除数据成功!");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 分页
|
||||
/// <summary>
|
||||
/// 分页
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页显示条数下拉框
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.Grid1.PageSize = Funs.GetNewIntOrZero(this.ddlPageSize.SelectedValue);
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Grid行双击事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
|
||||
{
|
||||
this.EditData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 右键编辑事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.EditData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 编辑数据方法
|
||||
/// </summary>
|
||||
private void EditData()
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInParent("请至少选择一条记录!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
string Id = Grid1.SelectedRowID;
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("EquipmentManageEdit.aspx?EquipmentId={0}&type={1}", Id, this.Type, "编辑 - ")));
|
||||
}
|
||||
|
||||
#region 判断是否可删除
|
||||
/// <summary>
|
||||
/// 判断是否可以删除
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private bool judgementDelete(string id, bool isShow)
|
||||
{
|
||||
string content = string.Empty;
|
||||
//if (Funs.DB.Project_ProjectEquipmentManage.FirstOrDefault(x => x.EquipmentManageId == id) != null)
|
||||
//{
|
||||
// content = "该用户已在【项目用户】中使用,不能删除!";
|
||||
//}
|
||||
|
||||
if (string.IsNullOrEmpty(content))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isShow)
|
||||
{
|
||||
Alert.ShowInTop(content);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.SmartSite
|
||||
{
|
||||
|
||||
|
||||
public partial class EquipmentManage
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// txtEquipmentName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtEquipmentName;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
/// <summary>
|
||||
/// btnNew 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnNew;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarSeparator1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarText1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarText ToolbarText1;
|
||||
|
||||
/// <summary>
|
||||
/// ddlPageSize 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlPageSize;
|
||||
|
||||
/// <summary>
|
||||
/// Window1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window1;
|
||||
|
||||
/// <summary>
|
||||
/// Menu1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Menu Menu1;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuEdit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuEdit;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuDelete 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuDelete;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="EquipmentManageEdit.aspx.cs" Inherits="FineUIPro.Web.SmartSite.EquipmentManageEdit" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<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="SimpleForm1" runat="server" />
|
||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:DropDownList ID="drpProject" runat="server" Label="项目" EnableEdit="true" FocusOnPageLoad="true">
|
||||
</f:DropDownList>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtEquipmentName" runat="server" Label="设备名称" Required="true" ShowRedStar="true" MaxLength="200">
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="txtEquipmentModel" runat="server" Label="型号" MaxLength="200">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:NumberBox ID="txtNumber" runat="server" Label="数量" NoDecimal="true" NoNegative="true">
|
||||
</f:NumberBox>
|
||||
<f:TextBox ID="txtRunningState" runat="server" Label="运行状态" MaxLength="50">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtSupplier" runat="server" Label="供货商" MaxLength="500">
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="txtSupplierMan" runat="server" Label="联系人" MaxLength="50">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtSupplierTel" runat="server" Label="联系电话" MaxLength="50">
|
||||
</f:TextBox>
|
||||
<f:Label runat="server" ID="lb"></f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ValidateForms="SimpleForm1" Hidden="true"
|
||||
OnClick="btnSave_Click" Text="保存">
|
||||
</f:Button>
|
||||
<f:Button ID="btnClose" EnablePostBack="false" Text="关闭" runat="server" Icon="SystemClose">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:Form>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,167 @@
|
||||
using BLL;
|
||||
using FineUIPro.Web.CQMS.Material;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace FineUIPro.Web.SmartSite
|
||||
{
|
||||
public partial class EquipmentManageEdit : PageBase
|
||||
{
|
||||
#region 定义项
|
||||
/// <summary>
|
||||
/// 安全措施主键
|
||||
/// </summary>
|
||||
public string EquipmentId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["EquipmentId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["EquipmentId"] = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 类型
|
||||
/// </summary>
|
||||
public string Type
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["Type"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["Type"] = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 菜单id
|
||||
/// </summary>
|
||||
public string MenuId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["MenuId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["MenuId"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 安全措施编辑页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
|
||||
this.EquipmentId = Request.Params["EquipmentId"];
|
||||
this.Type = Request.Params["type"];
|
||||
if (this.Type == "D")
|
||||
{
|
||||
this.MenuId = Const.EquipmentManageDMenuId;
|
||||
}
|
||||
else if (this.Type == "M")
|
||||
{
|
||||
this.MenuId = Const.EquipmentManageMMenuId;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.MenuId = Const.EquipmentManageEMenuId;
|
||||
}
|
||||
///权限
|
||||
this.GetButtonPower();
|
||||
|
||||
ProjectService.InitProjectDropDownList(this.drpProject, true);
|
||||
if (!string.IsNullOrEmpty(this.EquipmentId))
|
||||
{
|
||||
var Equipment = BLL.EquipmentService.GetEquipmentByEquipmentId(this.EquipmentId);
|
||||
if (Equipment != null)
|
||||
{
|
||||
ProjectService.InitAllProjectDropDownList(this.drpProject, true);
|
||||
this.drpProject.SelectedValue = Equipment.ProjectId;
|
||||
this.Type = Equipment.Type;
|
||||
this.txtEquipmentName.Text = Equipment.EquipmentName;
|
||||
this.txtEquipmentModel.Text = Equipment.EquipmentModel;
|
||||
this.txtNumber.Text = Equipment.Number.ToString();
|
||||
this.txtRunningState.Text = Equipment.RunningState;
|
||||
this.txtSupplier.Text = Equipment.Supplier;
|
||||
this.txtSupplierMan.Text = Equipment.SupplierMan;
|
||||
this.txtSupplierTel.Text = Equipment.SupplierTel;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.drpProject.SelectedValue == Const._Null)
|
||||
{
|
||||
Alert.ShowInParent("请选择项目!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
Model.SmartSite_Equipment newEquipment = new Model.SmartSite_Equipment
|
||||
{
|
||||
EquipmentName = this.txtEquipmentName.Text.Trim(),
|
||||
Type = this.Type,
|
||||
EquipmentModel = this.txtEquipmentModel.Text.Trim(),
|
||||
Number = Funs.GetNewIntOrZero(this.txtNumber.Text.Trim()),
|
||||
RunningState = this.txtRunningState.Text.Trim(),
|
||||
Supplier = this.txtSupplier.Text.Trim(),
|
||||
SupplierMan = this.txtSupplierMan.Text.Trim(),
|
||||
SupplierTel = this.txtSupplierTel.Text.Trim(),
|
||||
};
|
||||
|
||||
if (this.drpProject.SelectedValue != Const._Null)
|
||||
{
|
||||
newEquipment.ProjectId = this.drpProject.SelectedValue;
|
||||
}
|
||||
if (string.IsNullOrEmpty(this.EquipmentId))
|
||||
{
|
||||
newEquipment.EquipmentId = SQLHelper.GetNewID();
|
||||
BLL.EquipmentService.AddEquipment(newEquipment);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, newEquipment.EquipmentName, newEquipment.EquipmentId, this.MenuId, Const.BtnAdd);
|
||||
}
|
||||
else
|
||||
{
|
||||
newEquipment.EquipmentId = this.EquipmentId;
|
||||
BLL.EquipmentService.UpdateEquipment(newEquipment);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, newEquipment.EquipmentName, newEquipment.EquipmentId, this.MenuId, Const.BtnModify);
|
||||
}
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
|
||||
}
|
||||
|
||||
#region 获取按钮权限
|
||||
/// <summary>
|
||||
/// 获取按钮权限
|
||||
/// </summary>
|
||||
/// <param name="button"></param>
|
||||
/// <returns></returns>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, this.MenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnSave))
|
||||
{
|
||||
this.btnSave.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.SmartSite
|
||||
{
|
||||
|
||||
|
||||
public partial class EquipmentManageEdit
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// SimpleForm1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form SimpleForm1;
|
||||
|
||||
/// <summary>
|
||||
/// drpProject 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpProject;
|
||||
|
||||
/// <summary>
|
||||
/// txtEquipmentName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtEquipmentName;
|
||||
|
||||
/// <summary>
|
||||
/// txtEquipmentModel 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtEquipmentModel;
|
||||
|
||||
/// <summary>
|
||||
/// txtNumber 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtNumber;
|
||||
|
||||
/// <summary>
|
||||
/// txtRunningState 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtRunningState;
|
||||
|
||||
/// <summary>
|
||||
/// txtSupplier 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtSupplier;
|
||||
|
||||
/// <summary>
|
||||
/// txtSupplierMan 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtSupplierMan;
|
||||
|
||||
/// <summary>
|
||||
/// txtSupplierTel 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtSupplierTel;
|
||||
|
||||
/// <summary>
|
||||
/// lb 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label lb;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <summary>
|
||||
/// btnClose 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnClose;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SoftManage.aspx.cs" Inherits="FineUIPro.Web.SmartSite.SoftManage" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<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" ShowBorder="true" ShowHeader="false" Title="软件管理" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="EquipmentSoftId" AllowCellEditing="true" EnableColumnLines="true"
|
||||
ClicksToEdit="2" DataIDField="EquipmentSoftId" AllowSorting="true" SortField="ProjectName,EquipmentSoftName"
|
||||
SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true"
|
||||
OnPageIndexChange="Grid1_PageIndexChange" EnableRowDoubleClickEvent="true" ForceFit="true"
|
||||
OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Top" runat="server">
|
||||
<Items>
|
||||
<f:TextBox runat="server" ID="txtEquipmentName" EmptyText="按名称查询" AutoPostBack="true"
|
||||
OnTextChanged="TextBox_TextChanged" Width="250px" LabelAlign="Right">
|
||||
</f:TextBox>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server">
|
||||
</f:ToolbarFill>
|
||||
<f:Button ID="btnNew" Text="新增" Icon="Add" EnablePostBack="false" runat="server"
|
||||
Hidden="true">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:RenderField Width="250px" ColumnID="ProjectName" DataField="ProjectName"
|
||||
FieldType="String" HeaderText="项目名称" HeaderTextAlign="Center" TextAlign="Left" >
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="EquipmentName" DataField="EquipmentName"
|
||||
FieldType="String" HeaderText="软件名称" HeaderTextAlign="Center" TextAlign="Left" >
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="EquipmentSoftName" DataField="EquipmentSoftName"
|
||||
FieldType="String" HeaderText="软件名称" HeaderTextAlign="Center" TextAlign="Left" >
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="EquipmentSoftModel" DataField="EquipmentSoftModel"
|
||||
FieldType="String" HeaderText="软件版本" HeaderTextAlign="Center" TextAlign="Left" >
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="90px" ColumnID="Number" DataField="Number"
|
||||
FieldType="Int" HeaderText="数量" HeaderTextAlign="Center" TextAlign="Right" >
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="90px" ColumnID="RunningState" DataField="RunningState"
|
||||
FieldType="String" HeaderText="运行状态" HeaderTextAlign="Center" TextAlign="Center" >
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="220px" ColumnID="Supplier" DataField="Supplier"
|
||||
FieldType="String" HeaderText="供货商" HeaderTextAlign="Center" TextAlign="Left" >
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="SupplierMan" DataField="SupplierMan"
|
||||
FieldType="String" HeaderText="售后联系人" HeaderTextAlign="Center" TextAlign="Left" >
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="120px" ColumnID="SupplierTel" DataField="SupplierTel"
|
||||
FieldType="String" HeaderText="售后联系电话" HeaderTextAlign="Center" TextAlign="Right" >
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
|
||||
</Listeners>
|
||||
<PageItems>
|
||||
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
|
||||
</f:ToolbarSeparator>
|
||||
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
|
||||
</f:ToolbarText>
|
||||
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
|
||||
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
|
||||
</f:DropDownList>
|
||||
</PageItems>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Window ID="Window1" Title="软件管理" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="800px"
|
||||
Height="380px">
|
||||
</f:Window>
|
||||
<f:Menu ID="Menu1" runat="server">
|
||||
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true"
|
||||
Hidden="true" runat="server" Text="编辑" Icon="Pencil">
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true"
|
||||
Hidden="true" ConfirmText="删除选中行?" ConfirmTarget="Top" runat="server" Text="删除"
|
||||
Icon="Delete">
|
||||
</f:MenuButton>
|
||||
</f:Menu>
|
||||
</form>
|
||||
<script type="text/jscript">
|
||||
var menuID = '<%= Menu1.ClientID %>';
|
||||
// 返回false,来阻止浏览器右键菜单
|
||||
function onRowContextMenu(event, rowId) {
|
||||
F(menuID).show(); //showAt(event.pageX, event.pageY);
|
||||
return false;
|
||||
}
|
||||
|
||||
function reloadGrid() {
|
||||
__doPostBack(null, 'reloadGrid');
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,277 @@
|
||||
namespace FineUIPro.Web.SmartSite
|
||||
{
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
|
||||
public partial class SoftManage : PageBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 类型
|
||||
/// </summary>
|
||||
public string Type
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["Type"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["Type"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 菜单id
|
||||
/// </summary>
|
||||
public string MenuId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["MenuId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["MenuId"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.Type = Request.Params["type"];
|
||||
if (this.Type == "D")
|
||||
{
|
||||
this.MenuId = Const.SoftManageDMenuId;
|
||||
}
|
||||
else if (this.Type == "M")
|
||||
{
|
||||
this.MenuId = Const.SoftManageMMenuId;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.MenuId = Const.SoftManageEMenuId;
|
||||
}
|
||||
////权限按钮方法
|
||||
this.GetButtonPower();
|
||||
this.btnNew.OnClientClick = Window1.GetShowReference("SoftManageEdit.aspx?type=" + this.Type) + "return false;";
|
||||
Funs.DropDownPageSize(this.ddlPageSize);
|
||||
// 绑定表格
|
||||
this.BindGrid();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
string strSql = @"SELECT EquipmentSoftId,Soft.ProjectId,P.ProjectName,Soft.Type,Soft.EquipmentSoftName,EQ.EquipmentName,EquipmentModel,Soft.Number,Soft.RunningState
|
||||
,Soft.Supplier,Soft.SupplierMan,Soft.SupplierTel
|
||||
FROM SmartSite_EquipmentSoft AS Soft
|
||||
LEFT JOIN Base_Project AS P ON Soft.ProjectId=P.ProjectId
|
||||
LEFT JOIN SmartSite_Equipment AS EQ ON Soft.EquipmentId=EQ.EquipmentId WHERE 1 = 1";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
strSql += " AND Soft.Type = @Type";
|
||||
listStr.Add(new SqlParameter("@Type", this.Type));
|
||||
if (!string.IsNullOrEmpty(this.txtEquipmentName.Text.Trim()))
|
||||
{
|
||||
strSql += " AND EquipmentName LIKE @EquipmentName";
|
||||
listStr.Add(new SqlParameter("@EquipmentName", "%" + this.txtEquipmentName.Text.Trim() + "%"));
|
||||
}
|
||||
//if (this.drpLicenseType.SelectedValue != BLL.Const._Null)
|
||||
//{
|
||||
// strSql += " AND EquipmentManage.LicenseType = @LicenseTypeId";
|
||||
// listStr.Add(new SqlParameter("@LicenseTypeId", this.drpLicenseType.SelectedValue));
|
||||
//}
|
||||
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
|
||||
#region 查询
|
||||
/// <summary>
|
||||
/// 查询
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void TextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取按钮权限
|
||||
/// <summary>
|
||||
/// 获取按钮权限
|
||||
/// </summary>
|
||||
/// <param name="button"></param>
|
||||
/// <returns></returns>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
var buttonList = CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, this.MenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(Const.BtnAdd))
|
||||
{
|
||||
this.btnNew.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(Const.BtnModify))
|
||||
{
|
||||
this.btnMenuEdit.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(Const.BtnDelete))
|
||||
{
|
||||
this.btnMenuDelete.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 删除数据
|
||||
/// <summary>
|
||||
/// 右键删除事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DeleteData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除方法
|
||||
/// </summary>
|
||||
private void DeleteData()
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length > 0)
|
||||
{
|
||||
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
||||
{
|
||||
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
if (judgementDelete(rowID, false))
|
||||
{
|
||||
var getD = EquipmentSoftService.GetEquipmentSoftByEquipmentSoftId(rowID);
|
||||
if (getD != null)
|
||||
{
|
||||
LogService.AddSys_Log(this.CurrUser, getD.EquipmentSoftName.ToString(), getD.EquipmentSoftId,this.MenuId, BLL.Const.BtnDelete);
|
||||
BLL.EquipmentSoftService.DeleteEquipmentSoftById(rowID);
|
||||
}
|
||||
}
|
||||
}
|
||||
BindGrid();
|
||||
ShowNotify("删除数据成功!");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 分页
|
||||
/// <summary>
|
||||
/// 分页
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页显示条数下拉框
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.Grid1.PageSize = Funs.GetNewIntOrZero(this.ddlPageSize.SelectedValue);
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Grid行双击事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
|
||||
{
|
||||
this.EditData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 右键编辑事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.EditData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 编辑数据方法
|
||||
/// </summary>
|
||||
private void EditData()
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInParent("请至少选择一条记录!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
string Id = Grid1.SelectedRowID;
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SoftManageEdit.aspx?EquipmentSoftId={0}&type={1}", Id, this.Type, "编辑 - ")));
|
||||
}
|
||||
|
||||
#region 判断是否可删除
|
||||
/// <summary>
|
||||
/// 判断是否可以删除
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private bool judgementDelete(string id, bool isShow)
|
||||
{
|
||||
string content = string.Empty;
|
||||
//if (Funs.DB.Project_ProjectEquipmentManage.FirstOrDefault(x => x.EquipmentManageId == id) != null)
|
||||
//{
|
||||
// content = "该用户已在【项目用户】中使用,不能删除!";
|
||||
//}
|
||||
|
||||
if (string.IsNullOrEmpty(content))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isShow)
|
||||
{
|
||||
Alert.ShowInTop(content);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.SmartSite
|
||||
{
|
||||
|
||||
|
||||
public partial class SoftManage
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// txtEquipmentName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtEquipmentName;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
/// <summary>
|
||||
/// btnNew 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnNew;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarSeparator1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarText1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarText ToolbarText1;
|
||||
|
||||
/// <summary>
|
||||
/// ddlPageSize 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlPageSize;
|
||||
|
||||
/// <summary>
|
||||
/// Window1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window1;
|
||||
|
||||
/// <summary>
|
||||
/// Menu1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Menu Menu1;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuEdit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuEdit;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuDelete 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuDelete;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SoftManageEdit.aspx.cs" Inherits="FineUIPro.Web.SmartSite.SoftManageEdit" %>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<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="SimpleForm1" runat="server" />
|
||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:DropDownList ID="drpProject" runat="server" Label="项目" EnableEdit="true" FocusOnPageLoad="true"
|
||||
AutoPostBack="true" OnSelectedIndexChanged="drpProject_SelectedIndexChanged">
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="drpEQ" runat="server" Label="设备" EnableEdit="true" >
|
||||
</f:DropDownList>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtEquipmentSoftName" runat="server" Label="软件名称" Required="true" ShowRedStar="true" MaxLength="200">
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="txtEquipmentSoftModel" runat="server" Label="软件版本" MaxLength="200">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:NumberBox ID="txtNumber" runat="server" Label="数量" NoDecimal="true" NoNegative="true">
|
||||
</f:NumberBox>
|
||||
<f:TextBox ID="txtRunningState" runat="server" Label="运行状态" MaxLength="50">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtSupplier" runat="server" Label="供货商" MaxLength="500">
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="txtSupplierMan" runat="server" Label="联系人" MaxLength="50">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtSupplierTel" runat="server" Label="联系电话" MaxLength="50">
|
||||
</f:TextBox>
|
||||
<f:Label runat="server" ID="lb"></f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ValidateForms="SimpleForm1" Hidden="true"
|
||||
OnClick="btnSave_Click" Text="保存">
|
||||
</f:Button>
|
||||
<f:Button ID="btnClose" EnablePostBack="false" Text="关闭" runat="server" Icon="SystemClose">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:Form>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,180 @@
|
||||
using BLL;
|
||||
using FineUIPro.Web.CQMS.Material;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace FineUIPro.Web.SmartSite
|
||||
{
|
||||
public partial class SoftManageEdit : PageBase
|
||||
{
|
||||
#region 定义项
|
||||
/// <summary>
|
||||
/// 安全措施主键
|
||||
/// </summary>
|
||||
public string EquipmentSoftId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["EquipmentSoftId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["EquipmentSoftId"] = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 类型
|
||||
/// </summary>
|
||||
public string Type
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["Type"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["Type"] = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 菜单id
|
||||
/// </summary>
|
||||
public string MenuId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["MenuId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["MenuId"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 安全措施编辑页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
|
||||
this.EquipmentSoftId = Request.Params["EquipmentSoftId"];
|
||||
this.Type = Request.Params["type"];
|
||||
if (this.Type == "D")
|
||||
{
|
||||
this.MenuId = Const.SoftManageDMenuId;
|
||||
}
|
||||
else if (this.Type == "M")
|
||||
{
|
||||
this.MenuId = Const.SoftManageMMenuId;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.MenuId = Const.SoftManageEMenuId;
|
||||
}
|
||||
///权限
|
||||
this.GetButtonPower();
|
||||
|
||||
ProjectService.InitProjectDropDownList(this.drpProject, true);
|
||||
EquipmentService.InitEquipmentDropDownList(this.drpEQ, this.drpProject.SelectedValue, this.Type, true);
|
||||
if (!string.IsNullOrEmpty(this.EquipmentSoftId))
|
||||
{
|
||||
var Equipment = BLL.EquipmentSoftService.GetEquipmentSoftByEquipmentSoftId(this.EquipmentSoftId);
|
||||
if (Equipment != null)
|
||||
{
|
||||
ProjectService.InitAllProjectDropDownList(this.drpProject, true);
|
||||
this.drpProject.SelectedValue = Equipment.ProjectId;
|
||||
EquipmentService.InitEquipmentDropDownList(this.drpEQ, this.drpProject.SelectedValue, this.Type, true);
|
||||
this.drpEQ.SelectedValue = Equipment.EquipmentId;
|
||||
this.Type = Equipment.Type;
|
||||
this.txtEquipmentSoftName.Text = Equipment.EquipmentSoftName;
|
||||
this.txtEquipmentSoftModel.Text = Equipment.EquipmentSoftModel;
|
||||
this.txtNumber.Text = Equipment.Number.ToString();
|
||||
this.txtRunningState.Text = Equipment.RunningState;
|
||||
this.txtSupplier.Text = Equipment.Supplier;
|
||||
this.txtSupplierMan.Text = Equipment.SupplierMan;
|
||||
this.txtSupplierTel.Text = Equipment.SupplierTel;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.drpProject.SelectedValue == Const._Null)
|
||||
{
|
||||
Alert.ShowInParent("请选择项目!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
Model.SmartSite_EquipmentSoft newEquipment = new Model.SmartSite_EquipmentSoft
|
||||
{
|
||||
EquipmentSoftName = this.txtEquipmentSoftName.Text.Trim(),
|
||||
Type = this.Type,
|
||||
EquipmentSoftModel = this.txtEquipmentSoftModel.Text.Trim(),
|
||||
Number = Funs.GetNewIntOrZero(this.txtNumber.Text.Trim()),
|
||||
RunningState = this.txtRunningState.Text.Trim(),
|
||||
Supplier = this.txtSupplier.Text.Trim(),
|
||||
SupplierMan = this.txtSupplierMan.Text.Trim(),
|
||||
SupplierTel = this.txtSupplierTel.Text.Trim(),
|
||||
};
|
||||
|
||||
if (this.drpProject.SelectedValue != Const._Null)
|
||||
{
|
||||
newEquipment.ProjectId = this.drpProject.SelectedValue;
|
||||
}
|
||||
|
||||
if (this.drpEQ.SelectedValue != Const._Null)
|
||||
{
|
||||
newEquipment.EquipmentId = this.drpEQ.SelectedValue;
|
||||
}
|
||||
if (string.IsNullOrEmpty(this.EquipmentSoftId))
|
||||
{
|
||||
newEquipment.EquipmentSoftId = SQLHelper.GetNewID();
|
||||
BLL.EquipmentSoftService.AddEquipmentSoft(newEquipment);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, newEquipment.EquipmentSoftName, newEquipment.EquipmentSoftId, this.MenuId, Const.BtnAdd);
|
||||
}
|
||||
else
|
||||
{
|
||||
newEquipment.EquipmentSoftId = this.EquipmentSoftId;
|
||||
BLL.EquipmentSoftService.UpdateEquipmentSoft(newEquipment);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, newEquipment.EquipmentSoftName, newEquipment.EquipmentSoftId, this.MenuId, Const.BtnModify);
|
||||
}
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
|
||||
}
|
||||
|
||||
#region 获取按钮权限
|
||||
/// <summary>
|
||||
/// 获取按钮权限
|
||||
/// </summary>
|
||||
/// <param name="button"></param>
|
||||
/// <returns></returns>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, this.MenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnSave))
|
||||
{
|
||||
this.btnSave.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected void drpProject_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
EquipmentService.InitEquipmentDropDownList(this.drpEQ, this.drpProject.SelectedValue,this.Type, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.SmartSite
|
||||
{
|
||||
|
||||
|
||||
public partial class SoftManageEdit
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// SimpleForm1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form SimpleForm1;
|
||||
|
||||
/// <summary>
|
||||
/// drpProject 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpProject;
|
||||
|
||||
/// <summary>
|
||||
/// drpEQ 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpEQ;
|
||||
|
||||
/// <summary>
|
||||
/// txtEquipmentSoftName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtEquipmentSoftName;
|
||||
|
||||
/// <summary>
|
||||
/// txtEquipmentSoftModel 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtEquipmentSoftModel;
|
||||
|
||||
/// <summary>
|
||||
/// txtNumber 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtNumber;
|
||||
|
||||
/// <summary>
|
||||
/// txtRunningState 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtRunningState;
|
||||
|
||||
/// <summary>
|
||||
/// txtSupplier 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtSupplier;
|
||||
|
||||
/// <summary>
|
||||
/// txtSupplierMan 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtSupplierMan;
|
||||
|
||||
/// <summary>
|
||||
/// txtSupplierTel 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtSupplierTel;
|
||||
|
||||
/// <summary>
|
||||
/// lb 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label lb;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <summary>
|
||||
/// btnClose 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnClose;
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,15 @@
|
||||
<Tree>
|
||||
<TreeNode id="B6B783DE-2100-40CC-9910-B9F40C90C688" Text="智慧工地看板" NavigateUrl="">
|
||||
</TreeNode>
|
||||
<TreeNode id="C2C9C4BD-B10B-46AD-9468-66EF063517CF" Text="维护与管理" NavigateUrl=""><TreeNode id="15F04E9B-5893-4401-B864-BCDF7D67D13D" Text="设备管理" NavigateUrl=""><TreeNode id="B972AE90-D40C-44E0-9A90-7B47B2A3399B" Text="门禁设备管理" NavigateUrl=""></TreeNode>
|
||||
<TreeNode id="908325CA-A50A-456D-8A7F-E193C629F2F9" Text="监控设备管理" NavigateUrl=""></TreeNode>
|
||||
<TreeNode id="E2C18D81-264E-4BAB-BCFC-DCB0DCFD582E" Text="环境设备管理" NavigateUrl=""></TreeNode>
|
||||
<TreeNode id="C2C9C4BD-B10B-46AD-9468-66EF063517CF" Text="维护与管理" NavigateUrl=""><TreeNode id="15F04E9B-5893-4401-B864-BCDF7D67D13D" Text="设备管理" NavigateUrl=""><TreeNode id="B972AE90-D40C-44E0-9A90-7B47B2A3399B" Text="门禁设备管理" NavigateUrl="SmartSite/EquipmentManage.aspx?Type=D"></TreeNode>
|
||||
<TreeNode id="908325CA-A50A-456D-8A7F-E193C629F2F9" Text="监控设备管理" NavigateUrl="SmartSite/EquipmentManage.aspx?Type=M"></TreeNode>
|
||||
<TreeNode id="E2C18D81-264E-4BAB-BCFC-DCB0DCFD582E" Text="环境设备管理" NavigateUrl="SmartSite/EquipmentManage.aspx?Type=E"></TreeNode>
|
||||
<TreeNode id="04A361BF-BFC5-4D23-BF3C-3E5472D94A55" Text="预留拓展" NavigateUrl=""></TreeNode>
|
||||
</TreeNode>
|
||||
<TreeNode id="5D9BD2EC-8CF4-4579-91B9-786EBB0ADD12" Text="软件管理" NavigateUrl=""></TreeNode>
|
||||
<TreeNode id="5D9BD2EC-8CF4-4579-91B9-786EBB0ADD12" Text="软件管理" NavigateUrl=""><TreeNode id="C126F42A-09B0-43D1-8DCF-9EA049B800A8" Text="门禁设备管理" NavigateUrl="SmartSite/SoftManage.aspx?Type=D"></TreeNode>
|
||||
<TreeNode id="9F95F836-E10C-4EFD-B436-5C9D1658BAED" Text="监控设备管理" NavigateUrl="SmartSite/SoftManage.aspx?Type=M"></TreeNode>
|
||||
<TreeNode id="834EE5EA-3DDA-49E1-A951-825392893E85" Text="环境设备管理" NavigateUrl="SmartSite/SoftManage.aspx?Type=E"></TreeNode>
|
||||
</TreeNode>
|
||||
<TreeNode id="C724ADE0-F445-40C7-9B33-560809A1DBFE" Text="数据接口管理" NavigateUrl=""><TreeNode id="9840E927-F9D1-4243-975C-56807CE60C95" Text="集团劳务实名制接口" NavigateUrl=""></TreeNode>
|
||||
<TreeNode id="521E648B-5C61-46AD-9A60-ABF48150932F" Text="项目劳务实名制接口" NavigateUrl=""></TreeNode>
|
||||
</TreeNode>
|
||||
|
||||
Reference in New Issue
Block a user