20260312 阀门检验、试验

This commit is contained in:
毕文静 2026-03-12 15:07:40 +08:00
parent 0d0c96c032
commit 518e3e7148
11 changed files with 853 additions and 370 deletions

View File

@ -1,4 +1,5 @@
using Model;
using FastReport.DevComponents.DotNetBar;
using Model;
using System.Linq;
namespace BLL
@ -94,5 +95,16 @@ namespace BLL
db.SubmitChanges();
}
}
public static void DeleteListByProjectId(string projectId)
{
SGGLDB db = Funs.DB;
var q = (from x in db.JGZL_ValveInspectionTestRecord where x.ProjectId == projectId select x).ToList();
if (q.Count > 0)
{
db.JGZL_ValveInspectionTestRecord.DeleteAllOnSubmit(q);
db.SubmitChanges();
}
}
}
}

View File

@ -86,5 +86,20 @@ namespace BLL
db.SubmitChanges();
}
}
/// <summary>
/// 根据项目Id删除阀门试验确认表
/// </summary>
/// <param name="projectId"></param>
public static void DeleteListByProjectId(string projectId)
{
SGGLDB db = Funs.DB;
var q = (from x in db.JGZL_ValveTestConfirmationForm where x.ProjectId == projectId select x).ToList();
if (q.Count>0)
{
db.JGZL_ValveTestConfirmationForm.DeleteAllOnSubmit(q);
db.SubmitChanges();
}
}
}
}

View File

@ -1,7 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="01/27/2026 10:01:12" ReportInfo.Modified="02/24/2026 14:19:12" ReportInfo.CreatorVersion="2017.1.16.0">
<Report ScriptLanguage="CSharp" ReportInfo.Created="01/27/2026 10:01:12" ReportInfo.Modified="03/12/2026 14:37:41" ReportInfo.CreatorVersion="2017.1.16.0">
<ScriptText>using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
using System.Drawing;
using System.Data;
using FastReport;
using FastReport.Data;
using FastReport.Dialog;
using FastReport.Barcode;
using FastReport.Table;
using FastReport.Utils;
namespace FastReport
{
public class ReportScript
{
private void Table3_ManualBuild(object sender, EventArgs e)
{
DataSourceBase rowData = Report.GetDataSource(&quot;Data&quot;);
// init the data source
rowData.Init();
// print the first table row - it is a header
// now enumerate the data source and print the table body
while (rowData.HasMoreRows)
{
// print the table body
Table3.PrintRow(0);
Table3.PrintColumns();
// go next data source row
rowData.Next();
}
}
}
}
</ScriptText>
<Dictionary>
<MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqtRsOalcXxDhVt62rPEPNYjaATUoMqziRYvJtgNsyJKYAG7kXKvNAMI/qBkgJNPccFsWrhiII6oyX1HS+uwN7YigxVjqUq3vIet2zpPnmWhwvYEvWOOCZZGx6EC4BfGfWX8aPj6bmoF52Z0fnUA9g71duxa/gvChTW/nzu9qsYVuvlVHliMnnu6jEIF9n+/QFKc34vLqhujFAdy2RSUebDA==">
<MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqtRsOalcXxDhVt62rPEPNYjaATUoMqziRYvJtgNsyJKYAG7kXKvNAMI/qBkgJNPccFsWrhiII6oyX1HS+uwN7YigxVjqUq3vIet2zpPnmWhwvYEvWOOCZZGx6EC4BfGfWX8aPj6bmoF52Z0fnUA9g71duxa/gvChTW/nzu9qsYVuvlVHliMnnu6jEIF9n+/QFjJpU0A3x3EO6TXRHdHMnuw==">
<TableDataSource Name="Data" DataType="System.Int32" PropName="Attach_Image" Enabled="true" TableName="Data">
<Column Name="Num" DataType="System.String" PropName="attach_image_id"/>
<Column Name="Name" DataType="System.String" PropName="image_series"/>
@ -101,7 +142,7 @@
</TableObject>
</PageHeaderBand>
<DataBand Name="Data1" Top="164.65" Width="1010.02" Height="37.8" Guides="0,37.8">
<TableObject Name="Table3" Width="1009.66" Height="37.8">
<TableObject Name="Table3" Width="1009.66" Height="37.8" ManualBuildEvent="Table3_ManualBuild">
<TableColumn Name="Column21" Width="40.66"/>
<TableColumn Name="Column22" Width="125.71"/>
<TableColumn Name="Column23" Width="116.26"/>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="01/27/2026 09:28:24" ReportInfo.Modified="02/24/2026 14:14:10" ReportInfo.CreatorVersion="2017.1.16.0">
<Report ScriptLanguage="CSharp" ReportInfo.Created="01/27/2026 09:28:24" ReportInfo.Modified="03/12/2026 10:57:26" ReportInfo.CreatorVersion="2017.1.16.0">
<ScriptText>using System;
using System.Collections;
using System.Collections.Generic;
@ -42,7 +42,7 @@ namespace FastReport
}
</ScriptText>
<Dictionary>
<MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqtRsOalcXxDhVt62rPEPNYjaATUoMqziRYvJtgNsyJKYAG7kXKvNAMI/qBkgJNPccFsWrhiII6oyX1HS+uwN7YigxVjqUq3vIet2zpPnmWhwvYEvWOOCZZGx6EC4BfGfWX8aPj6bmoF52Z0fnUA9g71duxa/gvChTW/nzu9qsYVuvlVHliMnnu6jEIF9n+/QFfAsF3sS6mtKtcRi5vhwInQ==">
<MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqtRsOalcXxDhVt62rPEPNYjaATUoMqziRYvJtgNsyJKYAG7kXKvNAMI/qBkgJNPccFsWrhiII6oyX1HS+uwN7YigxVjqUq3vIet2zpPnmWhwvYEvWOOCZZGx6EC4BfGfWX8aPj6bmoF52Z0fnUA9g71duxa/gvChTW/nzu9qsYVuvlVHliMnnu6jEIF9n+/QFFvC1YWCWVxNxr5hf76d/uQ==">
<TableDataSource Name="Data" DataType="System.Int32" PropName="Attach_Image" Enabled="true" TableName="Data">
<Column Name="Name" DataType="System.String" PropName="attach_image_id"/>
<Column Name="ModelNumber" DataType="System.String" PropName="image_series"/>

View File

@ -200,8 +200,9 @@ namespace FineUIPro.Web.JGZL
///<param name="e"></param>
protected void drpProjectId_SelectedIndexChanged(object sender, EventArgs e)
{
this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue;
this.ProjectId = this.drpProjectId.SelectedValue;
this.InitTreeMenu();
this.tvControlItem.SelectedNodeID = this.ProjectId;
BindGrid();
}

View File

@ -40,6 +40,7 @@
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="btnAdd" runat="server" Icon="Add" Text="增加" OnClick="btnAdd_Click"></f:Button>
<f:Button ID="btnSave" Text="保存" ToolTip="保存" Icon="SystemSave" runat="server" OnClick="btnSave_Click"></f:Button>
<f:Button ID="btnPrint" Text="阀门检验试验记录打印" Icon="Printer" runat="server" OnClick="btnPrint_Click">
</f:Button>
</Items>
@ -51,71 +52,118 @@
EnableColumnLines="true" ClicksToEdit="1" DataIDField="RecordId" AllowSorting="true"
SortField="Code" SortDirection="DESC" OnSort="Grid1_Sort" AllowPaging="true"
IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
EnableTextSelection="True" AutoScroll="true" EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick">
EnableTextSelection="True" AutoScroll="true" OnPreDataBound="Grid1_PreDataBound">
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="50px" HeaderTextAlign="Center"
TextAlign="Center" />
<f:RenderField HeaderText="自编号" ColumnID="Code" DataField="Code" SortField="Code"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="160px">
</f:RenderField>
<f:RenderField HeaderText="名称" ColumnID="Name" DataField="Name" SortField="Name"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="180px">
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="100px">
<Editor>
<f:TextBox ID="txtName" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="规格型号" ColumnID="SpecificationModel" DataField="SpecificationModel" SortField="SpecificationModel"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" MinWidth="200px">
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="100px">
<Editor>
<f:TextBox ID="txtSpecificationModel" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="自编号" ColumnID="Code" DataField="Code" SortField="Code"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="90px">
<Editor>
<f:TextBox ID="txtCode" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="公称压力MPa" ColumnID="NominalPressure" DataField="NominalPressure" SortField="NominalPressure"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" MinWidth="120px">
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="90px">
<Editor>
<f:TextBox ID="txtNominalPressure" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:GroupField EnableLock="true" HeaderText="压力试验" TextAlign="Center">
<Columns>
<f:RenderField HeaderText="介质" ColumnID="PressuretTestMedium" DataField="PressuretTestMedium" SortField="PressuretTestMedium"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" MinWidth="120px">
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="90px">
<Editor>
<f:TextBox ID="txtPressuretTestMedium" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="压力MPa" ColumnID="PressuretTestPressure" DataField="PressuretTestPressure" SortField="PressuretTestPressure"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" MinWidth="100px">
<f:RenderField HeaderText="压力MPa" ColumnID="PressuretTestPressure" DataField="PressuretTestPressure" SortField="PressuretTestPressure"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="70px">
<Editor>
<f:TextBox ID="txtPressuretTestPressure" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="时间s" ColumnID="PressureTestTime" DataField="PressureTestTime" SortField="PressureTestTime"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" MinWidth="100px">
<f:RenderField HeaderText="时间s" ColumnID="PressureTestTime" DataField="PressureTestTime" SortField="PressureTestTime"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="70px">
<Editor>
<f:TextBox ID="txtPressureTestTime" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
</Columns>
</f:GroupField>
<f:GroupField EnableLock="true" HeaderText="密封试验" TextAlign="Center">
<Columns>
<f:RenderField HeaderText="介质" ColumnID="SealTestMedium" DataField="SealTestMedium" SortField="SealTestMedium"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" MinWidth="120px">
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="90px">
<Editor>
<f:TextBox ID="txtSealTestMedium" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="压力MPa" ColumnID="SealTestPressure" DataField="SealTestPressure" SortField="SealTestPressure"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" MinWidth="100px">
<f:RenderField HeaderText="压力MPa" ColumnID="SealTestPressure" DataField="SealTestPressure" SortField="SealTestPressure"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="70px">
<Editor>
<f:TextBox ID="txtSealTestPressure" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="时间s" ColumnID="SealTestTime" DataField="SealTestTime" SortField="SealTestTime"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" MinWidth="100px">
<f:RenderField HeaderText="时间s" ColumnID="SealTestTime" DataField="SealTestTime" SortField="SealTestTime"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="70px">
<Editor>
<f:TextBox ID="txtSealTestTime" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
</Columns>
</f:GroupField>
<f:GroupField EnableLock="true" HeaderText="上密封试验" TextAlign="Center">
<Columns>
<f:RenderField HeaderText="介质" ColumnID="UpperSealTestMedium" DataField="UpperSealTestMedium" SortField="UpperSealTestMedium"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" MinWidth="120px">
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="90px">
<Editor>
<f:TextBox ID="txtUpperSealTestMedium" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="压力MPa" ColumnID="UpperSealTestPressure" DataField="UpperSealTestPressure" SortField="UpperSealTestPressure"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" MinWidth="100px">
<f:RenderField HeaderText="压力MPa" ColumnID="UpperSealTestPressure" DataField="UpperSealTestPressure" SortField="UpperSealTestPressure"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="70px">
<Editor>
<f:TextBox ID="txtUpperSealTestPressure" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="时间s" ColumnID="UpperSealTestTime" DataField="UpperSealTestTime" SortField="UpperSealTestTime"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" MinWidth="100px">
<f:RenderField HeaderText="时间s" ColumnID="UpperSealTestTime" DataField="UpperSealTestTime" SortField="UpperSealTestTime"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="70px">
<Editor>
<f:TextBox ID="txtUpperSealTestTime" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
</Columns>
</f:GroupField>
<f:RenderField HeaderText="解体检查结果" ColumnID="InspectionResults" DataField="InspectionResults" SortField="InspectionResults"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" MinWidth="220px">
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="100px">
<Editor>
<f:TextBox ID="txtInspectionResults" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="备注" ColumnID="Remark" DataField="Remark" SortField="Remark"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="180px">
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="100px">
<Editor>
<f:TextBox ID="txtRemark" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:LinkButtonField ColumnID="Delete3" Width="50px" EnablePostBack="false" Icon="Delete"
HeaderTextAlign="Center" HeaderText="删除" />
<f:RenderField HeaderText="主键" ColumnID="RecordId" DataField="RecordId" SortField="RecordId"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="140px" Hidden="true">
</f:RenderField>
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
</Listeners>
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
@ -134,30 +182,10 @@
</f:Panel>
</Items>
</f:Panel>
<f:Window ID="Window1" Title="阀门检验试验记录" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="top" EnableResize="true" runat="server" OnClose="Window1_Close" IsModal="true"
Width="900px" Height="600px">
</f:Window>
<f:Window ID="WindowPrint" Title="打印阀门检验试验记录" Hidden="true" EnableIFrame="true" EnableMaximize="false"
Target="Top" EnableResize="true" runat="server" IsModal="true" Width="1024px"
Height="600px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true"
runat="server" Text="编辑" Icon="TableEdit">
</f:MenuButton>
<f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true"
ConfirmText="删除选中行?" ConfirmTarget="Top" runat="server" Text="删除" Icon="Delete">
</f:MenuButton>
</f:Menu>
</form>
<script type="text/javascript">
var menuID = '<%= Menu1.ClientID %>';
// 返回false来阻止浏览器右键菜单
function onRowContextMenu(event, rowId) {
F(menuID).show(); //showAt(event.pageX, event.pageY);
return false;
}
</script>
</body>
</html>

View File

@ -1,18 +1,52 @@
using BLL;
using Model;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
namespace FineUIPro.Web.JGZL
{
public partial class ValveInspectionTestRecord : PageBase
{
#region
/// <summary>
/// 主键
/// </summary>
private string RecordId
{
get
{
return (string)ViewState["RecordId"];
}
set
{
ViewState["RecordId"] = value;
}
}
/// <summary>
/// 项目Id
/// </summary>
private string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
#endregion
#region
/// <summary>
/// 加载页面
@ -34,6 +68,7 @@ namespace FineUIPro.Web.JGZL
this.drpProjectId.SelectedValue = this.CurrUser.LoginProjectId;
this.InitTreeMenu();//加载树
this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue;
this.ProjectId = this.tvControlItem.SelectedNodeID;
this.BindGrid();
}
}
@ -82,6 +117,7 @@ namespace FineUIPro.Web.JGZL
{
if (this.tvControlItem.SelectedNodeID != "0")
{
this.ProjectId = this.tvControlItem.SelectedNodeID;
this.BindGrid();
}
}
@ -164,7 +200,9 @@ namespace FineUIPro.Web.JGZL
///<param name="e"></param>
protected void drpProjectId_SelectedIndexChanged(object sender, EventArgs e)
{
this.ProjectId = this.drpProjectId.SelectedValue;
this.InitTreeMenu();
this.tvControlItem.SelectedNodeID = this.ProjectId;
this.BindGrid();
}
@ -274,7 +312,41 @@ namespace FineUIPro.Web.JGZL
{
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ValveInspectionTestRecordEdit.aspx?projectId={0}", this.tvControlItem.SelectedNodeID, "新增 - ")));
JArray teamGroupData = Grid1.GetMergedData();
List<JObject> list = new List<JObject>();
foreach (JObject teamGroupRow in teamGroupData)
{
JObject values = teamGroupRow.Value<JObject>("values");
list.Add(values);
}
JObject defaultObj = new JObject
{
{ "RecordId", Guid.NewGuid() },
{ "Name", ""},
{ "SpecificationModel", "" },
{ "Code", "" },
{ "NominalPressure", "" },
{ "PressuretTestMedium", "" },
{ "PressuretTestPressure", "" },
{ "PressureTestTime", "" },
{ "SealTestMedium", "" },
{ "SealTestPressure", "" },
{ "SealTestTime", "" },
{ "UpperSealTestMedium", "" },
{ "UpperSealTestPressure", "" },
{ "UpperSealTestTime", "" },
{ "InspectionResults", "" },
{ "Remark", "" },
{
"Delete3",
String.Format("<a href=\"javascript:;\" onclick=\"{0}\"><img src=\"{1}\"/></a>",
GetDeleteScriptGrid1(), IconHelper.GetResolvedIconUrl(Icon.Delete))
}
};
list.Add(defaultObj);
Grid1.DataSource = list;
Grid1.DataBind();
}
else
{
@ -282,140 +354,87 @@ namespace FineUIPro.Web.JGZL
return;
}
}
/// <summary>
/// 双击编辑
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
protected void Grid1_PreDataBound(object sender, EventArgs e)
{
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.JGZL_ValveInspectionTestRecordMenuId, BLL.Const.BtnModify))
{
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
{
if (!string.IsNullOrEmpty(this.Grid1.SelectedRowID))
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ValveInspectionTestRecordEdit.aspx?recordId={0}", this.Grid1.SelectedRowID, "编辑 - ")));
}
else
{
Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning);
return;
}
}
else
{
Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning);
return;
}
}
else
{
ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
}
// 设置LinkButtonField的点击客户端事件
LinkButtonField deleteField = Grid1.FindColumn("Delete3") as LinkButtonField;
deleteField.OnClientClick = GetDeleteScriptGrid1();
}
/// <summary>
/// 右键编辑
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuEdit_Click(object sender, EventArgs e)
{
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.JGZL_ValveInspectionTestRecordMenuId, BLL.Const.BtnModify))
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning);
return;
}
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ValveInspectionTestRecordEdit.aspx?recordId={0}", Grid1.SelectedRowID, "维护 - ")));
}
else
{
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
}
}
/// <summary>
/// 右键删除
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuDelete_Click(object sender, EventArgs e)
{
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.JGZL_ValveInspectionTestRecordMenuId, Const.BtnDelete))
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning);
return;
}
bool isShow = true;
if (Grid1.SelectedRowIndexArray.Length > 1)
{
isShow = false;
}
bool isDelete = false;
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
{
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
if (judgementDelete(rowID, isShow))
{
isDelete = true;
BLL.ValveInspectionTestRecordService.DeleteValveInspectionTestRecordById(rowID);
BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, "删除阀门检验试验记录");
}
}
if (isDelete)
{
ShowNotify("删除成功!", MessageBoxIcon.Success);
}
this.BindGrid();
}
else
{
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
}
}
#region
/// <summary>
/// 判断是否可以删除
/// 删除提示
/// </summary>
/// <returns></returns>
private bool judgementDelete(string id, bool isShow)
private string GetDeleteScriptGrid1()
{
string content = string.Empty;
if (string.IsNullOrEmpty(content))
{
return true;
}
else
{
if (isShow)
{
Alert.ShowInTop(content, MessageBoxIcon.Error);
}
return false;
}
return Confirm.GetShowReference("删除选中行?", String.Empty, MessageBoxIcon.Question,
Grid1.GetDeleteSelectedRowsReference(), String.Empty);
}
#endregion
#endregion
#region
#region
/// <summary>
/// 关闭弹出窗口
/// 保存按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Window1_Close(object sender, WindowCloseEventArgs e)
protected void btnSave_Click(object sender, EventArgs e)
{
this.InitTreeMenu();//加载树
this.BindGrid();
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId,
Const.JGZL_ValveInspectionTestRecordMenuId, Const.BtnSave))
{
BLL.ValveInspectionTestRecordService.DeleteListByProjectId(this.ProjectId);
List<Model.JGZL_ValveInspectionTestRecord> lists = new List<JGZL_ValveInspectionTestRecord>();
JArray teamGroupData = Grid1.GetMergedData();
foreach (JObject teamGroupRow in teamGroupData)
{
JObject values = teamGroupRow.Value<JObject>("values");
int rowIndex = teamGroupRow.Value<int>("index");
Model.JGZL_ValveInspectionTestRecord newDetail = new Model.JGZL_ValveInspectionTestRecord
{
RecordId = values.Value<string>("RecordId"),
ProjectId = this.ProjectId,
Name = values.Value<string>("Name"),
SpecificationModel = values.Value<string>("SpecificationModel"),
Code = values.Value<string>("Code"),
NominalPressure = values.Value<string>("NominalPressure"),
PressuretTestMedium =values.Value<string>("PressuretTestMedium"),
PressuretTestPressure = values.Value<string>("PressuretTestPressure"),
PressureTestTime = values.Value<string>("PressureTestTime"),
SealTestMedium = values.Value<string>("SealTestMedium"),
SealTestPressure = values.Value<string>("SealTestPressure"),
SealTestTime = values.Value<string>("SealTestTime"),
UpperSealTestMedium = values.Value<string>("UpperSealTestMedium"),
UpperSealTestPressure = values.Value<string>("UpperSealTestPressure"),
UpperSealTestTime = values.Value<string>("UpperSealTestTime"),
InspectionResults = values.Value<string>("InspectionResults"),
Remark = values.Value<string>("Remark"),
CompileMan = this.CurrUser.UserId,
CompileDate = DateTime.Now,
Reviewer = this.CurrUser.UserId,
RevieweDate = DateTime.Now
};
lists.Add(newDetail);
}
try
{
if (lists.Count > 0)
{
Funs.DB.JGZL_ValveInspectionTestRecord.InsertAllOnSubmit(lists);
ShowNotify("保存成功!", MessageBoxIcon.Success);
}
Funs.DB.SubmitChanges();
}
catch (Exception)
{
return;
}
}
else
{
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
return;
}
}
#endregion
}

View File

@ -113,6 +113,15 @@ namespace FineUIPro.Web.JGZL
/// </remarks>
protected global::FineUIPro.Button btnAdd;
/// <summary>
/// btnSave 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnPrint 控件。
/// </summary>
@ -131,6 +140,141 @@ namespace FineUIPro.Web.JGZL
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// txtName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtName;
/// <summary>
/// txtSpecificationModel 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtSpecificationModel;
/// <summary>
/// txtCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtCode;
/// <summary>
/// txtNominalPressure 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtNominalPressure;
/// <summary>
/// txtPressuretTestMedium 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPressuretTestMedium;
/// <summary>
/// txtPressuretTestPressure 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPressuretTestPressure;
/// <summary>
/// txtPressureTestTime 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPressureTestTime;
/// <summary>
/// txtSealTestMedium 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtSealTestMedium;
/// <summary>
/// txtSealTestPressure 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtSealTestPressure;
/// <summary>
/// txtSealTestTime 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtSealTestTime;
/// <summary>
/// txtUpperSealTestMedium 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtUpperSealTestMedium;
/// <summary>
/// txtUpperSealTestPressure 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtUpperSealTestPressure;
/// <summary>
/// txtUpperSealTestTime 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtUpperSealTestTime;
/// <summary>
/// txtInspectionResults 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtInspectionResults;
/// <summary>
/// txtRemark 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtRemark;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
@ -158,15 +302,6 @@ namespace FineUIPro.Web.JGZL
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window1;
/// <summary>
/// WindowPrint 控件。
/// </summary>
@ -175,32 +310,5 @@ namespace FineUIPro.Web.JGZL
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window WindowPrint;
/// <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;
}
}

View File

@ -40,6 +40,7 @@
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="btnAdd" runat="server" Icon="Add" Text="增加" OnClick="btnAdd_Click"></f:Button>
<f:Button ID="btnSave" Text="保存" ToolTip="保存" Icon="SystemSave" runat="server" OnClick="btnSave_Click"></f:Button>
<f:Button ID="btnPrint" Text="阀门试验确认表打印" Icon="Printer" runat="server" OnClick="btnPrint_Click">
</f:Button>
</Items>
@ -51,47 +52,85 @@
EnableColumnLines="true" ClicksToEdit="1" DataIDField="RecordId" AllowSorting="true"
SortField="Code" SortDirection="DESC" OnSort="Grid1_Sort" AllowPaging="true"
IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
EnableTextSelection="True" AutoScroll="true" EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick">
EnableTextSelection="True" AutoScroll="true" OnPreDataBound="Grid1_PreDataBound">
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="50px" HeaderTextAlign="Center"
TextAlign="Center" />
<f:RenderField HeaderText="试验记录自编号" ColumnID="Code" DataField="Code" SortField="Code"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="200px">
</f:RenderField>
<f:RenderField HeaderText="名称" ColumnID="Name" DataField="Name" SortField="Name"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="200px">
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="120px">
<Editor>
<f:TextBox ID="txtName" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="型号" ColumnID="ModelNumber" DataField="ModelNumber" SortField="ModelNumber"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="180px">
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="100px">
<Editor>
<f:TextBox ID="txtModelNumber" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="规格" ColumnID="Specifications" DataField="Specifications" SortField="Specifications"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" MinWidth="160px">
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" MinWidth="100px">
<Editor>
<f:TextBox ID="txtSpecifications" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="公称压力" ColumnID="NominalPressure" DataField="NominalPressure" SortField="NominalPressure"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" MinWidth="160px">
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" MinWidth="100px">
<Editor>
<f:TextBox ID="txtNominalPressure" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="数量" ColumnID="Num" DataField="Num" SortField="Num"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" MinWidth="100px">
<Editor>
<f:NumberBox ID="txtNum" runat="server" NoDecimal="true" NoNegative="true"></f:NumberBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="压力试验" ColumnID="PressureTest" DataField="PressureTest" SortField="PressureTest"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" MinWidth="160px">
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" MinWidth="100px">
<Editor>
<f:TextBox ID="txtPressureTest" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="密封试验" ColumnID="SealTest" DataField="SealTest" SortField="SealTest"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" MinWidth="160px">
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" MinWidth="100px">
<Editor>
<f:TextBox ID="txtSealTest" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="上密封试验" ColumnID="UpperSealTest" DataField="UpperSealTest" SortField="UpperSealTest"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" MinWidth="160px">
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" MinWidth="100px">
<Editor>
<f:TextBox ID="txtUpperSealTest" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="试验记录自编号" ColumnID="Code" DataField="Code" SortField="Code"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="120px">
<Editor>
<f:TextBox ID="txtCode" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="试验结果" ColumnID="TestResults" DataField="TestResults" SortField="TestResults"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" MinWidth="220px">
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" MinWidth="100px">
<Editor>
<f:TextBox ID="txtTestResults" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="备注" ColumnID="Remark" DataField="Remark" SortField="Remark"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="180px">
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="120px">
<Editor>
<f:TextBox ID="txtRemark" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:LinkButtonField ColumnID="Delete3" Width="50px" EnablePostBack="false" Icon="Delete"
HeaderTextAlign="Center" HeaderText="删除" />
<f:RenderField HeaderText="主键" ColumnID="RecordId" DataField="RecordId" SortField="RecordId"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="140px" Hidden="true">
</f:RenderField>
</Columns>
<Listeners>
<%--<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
</Listeners>
</Listeners>--%>
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
@ -110,30 +149,30 @@
</f:Panel>
</Items>
</f:Panel>
<f:Window ID="Window1" Title="阀门试验确认表" Hidden="true" EnableIFrame="true" EnableMaximize="true"
<%--<f:Window ID="Window1" Title="阀门试验确认表" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="top" EnableResize="true" runat="server" OnClose="Window1_Close" IsModal="true"
Width="900px" Height="600px">
</f:Window>
</f:Window>--%>
<f:Window ID="WindowPrint" Title="打印阀门试验确认表" Hidden="true" EnableIFrame="true" EnableMaximize="false"
Target="Top" EnableResize="true" runat="server" IsModal="true" Width="1024px"
Height="600px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<%--<f:Menu ID="Menu1" runat="server">
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true"
runat="server" Text="编辑" Icon="TableEdit">
</f:MenuButton>
<f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true"
ConfirmText="删除选中行?" ConfirmTarget="Top" runat="server" Text="删除" Icon="Delete">
</f:MenuButton>
</f:Menu>
</f:Menu>--%>
</form>
<script type="text/javascript">
<%--<script type="text/javascript">
var menuID = '<%= Menu1.ClientID %>';
// 返回false来阻止浏览器右键菜单
function onRowContextMenu(event, rowId) {
F(menuID).show(); //showAt(event.pageX, event.pageY);
return false;
}
</script>
</script>--%>
</body>
</html>

View File

@ -1,18 +1,52 @@
using BLL;
using Model;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
namespace FineUIPro.Web.JGZL
{
public partial class ValveTestConfirmationForm : PageBase
{
#region
/// <summary>
/// 主键
/// </summary>
private string RecordId
{
get
{
return (string)ViewState["RecordId"];
}
set
{
ViewState["RecordId"] = value;
}
}
/// <summary>
/// 项目Id
/// </summary>
private string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
#endregion
#region
/// <summary>
/// 加载页面
@ -34,6 +68,7 @@ namespace FineUIPro.Web.JGZL
this.drpProjectId.SelectedValue = this.CurrUser.LoginProjectId;
this.InitTreeMenu();//加载树
this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue;
this.ProjectId = this.tvControlItem.SelectedNodeID;
this.BindGrid();
}
}
@ -82,6 +117,7 @@ namespace FineUIPro.Web.JGZL
{
if (this.tvControlItem.SelectedNodeID != "0")
{
this.ProjectId = this.tvControlItem.SelectedNodeID;
this.BindGrid();
}
}
@ -164,7 +200,9 @@ namespace FineUIPro.Web.JGZL
///<param name="e"></param>
protected void drpProjectId_SelectedIndexChanged(object sender, EventArgs e)
{
this.ProjectId = this.drpProjectId.SelectedValue;
this.InitTreeMenu();
this.tvControlItem.SelectedNodeID = this.ProjectId;
this.BindGrid();
}
@ -262,7 +300,38 @@ namespace FineUIPro.Web.JGZL
{
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ValveTestConfirmationFormEdit.aspx?projectId={0}", this.tvControlItem.SelectedNodeID, "新增 - ")));
JArray teamGroupData = Grid1.GetMergedData();
List<JObject> list = new List<JObject>();
foreach (JObject teamGroupRow in teamGroupData)
{
JObject values = teamGroupRow.Value<JObject>("values");
list.Add(values);
}
JObject defaultObj = new JObject
{
{ "RecordId", Guid.NewGuid() },
{ "Name", ""},
{ "ModelNumber", "" },
{ "Specifications", "" },
{ "NominalPressure", "" },
{ "Num", "" },
{ "PressureTest", "" },
{ "SealTest", "" },
{ "UpperSealTest", "" },
{ "Code", "" },
{ "TestResults", "" },
{ "Remark", "" },
{
"Delete3",
String.Format("<a href=\"javascript:;\" onclick=\"{0}\"><img src=\"{1}\"/></a>",
GetDeleteScriptGrid1(), IconHelper.GetResolvedIconUrl(Icon.Delete))
}
};
list.Add(defaultObj);
Grid1.DataSource = list;
Grid1.DataBind();
//PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ValveTestConfirmationFormEdit.aspx?projectId={0}", this.tvControlItem.SelectedNodeID, "新增 - ")));
}
else
{
@ -270,127 +339,142 @@ namespace FineUIPro.Web.JGZL
return;
}
}
protected void Grid1_PreDataBound(object sender, EventArgs e)
{
// 设置LinkButtonField的点击客户端事件
LinkButtonField deleteField = Grid1.FindColumn("Delete3") as LinkButtonField;
deleteField.OnClientClick = GetDeleteScriptGrid1();
}
/// <summary>
/// 删除提示
/// </summary>
/// <returns></returns>
private string GetDeleteScriptGrid1()
{
return Confirm.GetShowReference("删除选中行?", String.Empty, MessageBoxIcon.Question,
Grid1.GetDeleteSelectedRowsReference(), String.Empty);
}
/// <summary>
/// 双击编辑
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
{
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.JGZL_ValveTestConfirmationFormMenuId, BLL.Const.BtnModify))
{
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
{
if (!string.IsNullOrEmpty(this.Grid1.SelectedRowID))
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ValveTestConfirmationFormEdit.aspx?recordId={0}", this.Grid1.SelectedRowID, "编辑 - ")));
}
else
{
Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning);
return;
}
}
else
{
Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning);
return;
}
}
else
{
ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
}
}
//protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
//{
// if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.JGZL_ValveTestConfirmationFormMenuId, BLL.Const.BtnModify))
// {
// if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
// {
// if (!string.IsNullOrEmpty(this.Grid1.SelectedRowID))
// {
// PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ValveTestConfirmationFormEdit.aspx?recordId={0}", this.Grid1.SelectedRowID, "编辑 - ")));
// }
// else
// {
// Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning);
// return;
// }
// }
// else
// {
// Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning);
// return;
// }
// }
// else
// {
// ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
// }
//}
/// <summary>
/// 右键编辑
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuEdit_Click(object sender, EventArgs e)
{
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.JGZL_ValveTestConfirmationFormMenuId, BLL.Const.BtnModify))
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning);
return;
}
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ValveTestConfirmationFormEdit.aspx?recordId={0}", Grid1.SelectedRowID, "维护 - ")));
}
else
{
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
}
}
//protected void btnMenuEdit_Click(object sender, EventArgs e)
//{
// if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.JGZL_ValveTestConfirmationFormMenuId, BLL.Const.BtnModify))
// {
// if (Grid1.SelectedRowIndexArray.Length == 0)
// {
// Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning);
// return;
// }
// PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ValveTestConfirmationFormEdit.aspx?recordId={0}", Grid1.SelectedRowID, "维护 - ")));
// }
// else
// {
// Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
// }
//}
/// <summary>
/// 右键删除
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuDelete_Click(object sender, EventArgs e)
{
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.JGZL_ValveTestConfirmationFormMenuId, Const.BtnDelete))
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning);
return;
}
//protected void btnMenuDelete_Click(object sender, EventArgs e)
//{
// if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.JGZL_ValveTestConfirmationFormMenuId, Const.BtnDelete))
// {
// if (Grid1.SelectedRowIndexArray.Length == 0)
// {
// Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning);
// return;
// }
bool isShow = true;
if (Grid1.SelectedRowIndexArray.Length > 1)
{
isShow = false;
}
bool isDelete = false;
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
{
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
if (judgementDelete(rowID, isShow))
{
isDelete = true;
BLL.ValveTestConfirmationFormService.DeleteValveTestConfirmationFormById(rowID);
BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, "删除阀门试验确认表");
}
}
if (isDelete)
{
ShowNotify("删除成功!", MessageBoxIcon.Success);
}
this.BindGrid();
}
else
{
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
}
}
// bool isShow = true;
// if (Grid1.SelectedRowIndexArray.Length > 1)
// {
// isShow = false;
// }
// bool isDelete = false;
// foreach (int rowIndex in Grid1.SelectedRowIndexArray)
// {
// string rowID = Grid1.DataKeys[rowIndex][0].ToString();
// if (judgementDelete(rowID, isShow))
// {
// isDelete = true;
// BLL.ValveTestConfirmationFormService.DeleteValveTestConfirmationFormById(rowID);
// BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, "删除阀门试验确认表");
// }
// }
// if (isDelete)
// {
// ShowNotify("删除成功!", MessageBoxIcon.Success);
// }
// this.BindGrid();
// }
// else
// {
// Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
// }
//}
#region
/// <summary>
/// 判断是否可以删除
/// </summary>
/// <returns></returns>
private bool judgementDelete(string id, bool isShow)
{
string content = string.Empty;
//private bool judgementDelete(string id, bool isShow)
//{
// string content = string.Empty;
if (string.IsNullOrEmpty(content))
{
return true;
}
else
{
if (isShow)
{
Alert.ShowInTop(content, MessageBoxIcon.Error);
}
return false;
}
}
// if (string.IsNullOrEmpty(content))
// {
// return true;
// }
// else
// {
// if (isShow)
// {
// Alert.ShowInTop(content, MessageBoxIcon.Error);
// }
// return false;
// }
//}
#endregion
#endregion
@ -400,11 +484,75 @@ namespace FineUIPro.Web.JGZL
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Window1_Close(object sender, WindowCloseEventArgs e)
//protected void Window1_Close(object sender, WindowCloseEventArgs e)
//{
// this.InitTreeMenu();//加载树
// this.BindGrid();
//}
#endregion
#region
/// <summary>
/// 保存按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
this.InitTreeMenu();//加载树
this.BindGrid();
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId,
Const.JGZL_ValveTestConfirmationFormMenuId, Const.BtnSave))
{
BLL.ValveTestConfirmationFormService.DeleteListByProjectId(this.ProjectId);
List<Model.JGZL_ValveTestConfirmationForm> lists = new List<JGZL_ValveTestConfirmationForm>();
JArray teamGroupData = Grid1.GetMergedData();
foreach (JObject teamGroupRow in teamGroupData)
{
JObject values = teamGroupRow.Value<JObject>("values");
int rowIndex = teamGroupRow.Value<int>("index");
Model.JGZL_ValveTestConfirmationForm newDetail = new Model.JGZL_ValveTestConfirmationForm
{
RecordId = values.Value<string>("RecordId"),
ProjectId = this.ProjectId,
Name = values.Value<string>("Name"),
ModelNumber = values.Value<string>("ModelNumber"),
Specifications = values.Value<string>("Specifications"),
NominalPressure = values.Value<string>("NominalPressure"),
Num = Funs.GetNewInt(values.Value<string>("Num")),
PressureTest = values.Value<string>("PressureTest"),
SealTest = values.Value<string>("SealTest"),
UpperSealTest = values.Value<string>("UpperSealTest"),
Code = values.Value<string>("Code"),
TestResults = values.Value<string>("TestResults"),
Remark = values.Value<string>("Remark"),
CompileMan = this.CurrUser.UserId,
CompileDate = DateTime.Now,
Reviewer = this.CurrUser.UserId,
RevieweDate = DateTime.Now
};
lists.Add(newDetail);
}
try
{
if (lists.Count > 0)
{
Funs.DB.JGZL_ValveTestConfirmationForm.InsertAllOnSubmit(lists);
ShowNotify("保存成功!", MessageBoxIcon.Success);
}
Funs.DB.SubmitChanges();
}
catch (Exception)
{
return;
}
//PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
else
{
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
return;
}
}
#endregion
}
}

View File

@ -113,6 +113,15 @@ namespace FineUIPro.Web.JGZL
/// </remarks>
protected global::FineUIPro.Button btnAdd;
/// <summary>
/// btnSave 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnPrint 控件。
/// </summary>
@ -131,6 +140,105 @@ namespace FineUIPro.Web.JGZL
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// txtName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtName;
/// <summary>
/// txtModelNumber 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtModelNumber;
/// <summary>
/// txtSpecifications 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtSpecifications;
/// <summary>
/// txtNominalPressure 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtNominalPressure;
/// <summary>
/// txtNum 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtNum;
/// <summary>
/// txtPressureTest 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPressureTest;
/// <summary>
/// txtSealTest 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtSealTest;
/// <summary>
/// txtUpperSealTest 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtUpperSealTest;
/// <summary>
/// txtCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtCode;
/// <summary>
/// txtTestResults 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtTestResults;
/// <summary>
/// txtRemark 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtRemark;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
@ -158,15 +266,6 @@ namespace FineUIPro.Web.JGZL
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window1;
/// <summary>
/// WindowPrint 控件。
/// </summary>
@ -175,32 +274,5 @@ namespace FineUIPro.Web.JGZL
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window WindowPrint;
/// <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;
}
}