20260313 管道材料材质标识检查记录

This commit is contained in:
毕文静 2026-03-13 20:29:31 +08:00
parent 5e156bd0a1
commit 5f72f3f0b0
7 changed files with 454 additions and 315 deletions

View File

@ -1,6 +1,7 @@
using Model;
using System.Linq;
using System.Collections.Generic;
using System.Resources;
namespace BLL
{
@ -18,6 +19,11 @@ namespace BLL
e.RecordId == recordId);
}
public static List<Model.JGZL_MaterialIdentificationInspectionRecord> GetListsByProjectId(string projectId)
{
return (from x in Funs.DB.JGZL_MaterialIdentificationInspectionRecord where x.ProjectId == projectId select x).ToList();
}
/// <summary>
/// 添加管道材料材质标识检查记录
/// </summary>
@ -86,7 +92,16 @@ namespace BLL
}
}
public static void DeleteListsByProjectId(string projectId)
{
SGGLDB db = Funs.DB;
var q = (from x in db.JGZL_MaterialIdentificationInspectionRecord where x.ProjectId == projectId select x).ToList();
if (q.Count>0)
{
db.JGZL_MaterialIdentificationInspectionRecord.DeleteAllOnSubmit(q);
db.SubmitChanges();
}
}
}

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="01/27/2026 16:57:11" ReportInfo.Modified="02/24/2026 14:28:59" ReportInfo.CreatorVersion="2017.1.16.0">
<Report ScriptLanguage="CSharp" ReportInfo.Created="01/27/2026 16:57:11" ReportInfo.Modified="03/13/2026 13:52:52" 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+/QFd88UxbEsEkw3wnwqhHPfLg==">
<MsSqlDataConnection Name="Connection" ConnectionString="rijcmlqtRsOalcXxDhVt62rPEPNYjaATUoMqziRYvJtgNsyJKYAG7kXKvNAMI/qBkgJNPccFsWrhiII6oyX1HS+uwN7YigxVjqUq3vIet2zpPnmWhwvYEvWOOCZZGx6EC4BfGfWX8aPj6bmoF52Z0fnUA9g71duxa/gvChTW/nzu9qsYVuvlVHliMnnu6jEIF9n+/QFGF4PbRRRnyGgSV2vxImNAA==">
<TableDataSource Name="Data" DataType="System.Int32" PropName="Attach_Image" Enabled="true" TableName="Data">
<Column Name="ISO_IsoNo" DataType="System.String" PropName="attach_image_id"/>
<Column Name="STE_Code" DataType="System.String" PropName="image_series"/>

View File

@ -40,7 +40,7 @@
<%--<f:DatePicker ID="txtStartDate" runat="server" Label="记录时间" LabelAlign="Right" Width="220px" AutoPostBack="true" OnTextChanged="Text_TextChanged"></f:DatePicker>
<f:Label ID="lblTo" runat="server" Text="-" Width="10px"></f:Label>
<f:DatePicker ID="txtEndDate" runat="server" Width="120px" AutoPostBack="true" OnTextChanged="Text_TextChanged"></f:DatePicker>--%>
<f:DropDownList ID="drpIsoId" runat="server" Label="管道编号/单线号" LabelAlign="Right" AutoPostBack="true" OnSelectedIndexChanged="drpIsoId_SelectedIndexChanged" AutoSelectFirstItem="false" LabelWidth="120px"></f:DropDownList>
<f:DropDownList ID="drpIsoId" runat="server" Label="管道编号/单线号" LabelAlign="Right" EnableEdit="true" AutoPostBack="true" OnSelectedIndexChanged="drpIsoId_SelectedIndexChanged" AutoSelectFirstItem="false" LabelWidth="120px"></f:DropDownList>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="btnAdd" runat="server" Icon="Add" Text="增加" OnClick="btnAdd_Click"></f:Button>

View File

@ -37,9 +37,11 @@
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Right">
<Items>
<f:DropDownList ID="drpIsoId" runat="server" Label="管道编号/单线号" LabelAlign="Right" EnableEdit="true" AutoPostBack="true" OnSelectedIndexChanged="drpIsoId_SelectedIndexChanged" AutoSelectFirstItem="false" LabelWidth="120px"></f:DropDownList>
<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,38 +53,64 @@
EnableColumnLines="true" ClicksToEdit="1" DataIDField="RecordId" AllowSorting="true"
SortField="CompileDate" 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="ISO_IsoNo" DataField="ISO_IsoNo" SortField="ISO_IsoNo"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="150px" ExpandUnusedSpace="true">
<f:RenderField HeaderText="管道编号/单线号" ColumnID="ISO_Id" DataField="ISO_Id" SortField="ISO_Id"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="180px">
<Editor>
<f:TextBox ID="txtISO_Id" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="材质" ColumnID="STE_Code" DataField="STE_Code" SortField="STE_Code"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="150px" ExpandUnusedSpace="true">
<f:RenderField HeaderText="材质" ColumnID="STE_ID" DataField="STE_ID" SortField="STE_ID"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="120px">
<Editor>
<f:TextBox ID="txtSTE_Code" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="规格" ColumnID="Specifications" DataField="Specifications" SortField="Specifications"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="150px" ExpandUnusedSpace="true">
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="120px">
<Editor>
<f:TextBox ID="txtSpecifications" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="规定色标颜色" ColumnID="PrescribedColor" DataField="PrescribedColor" SortField="PrescribedColor"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="150px" ExpandUnusedSpace="true">
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="120px">
<Editor>
<f:TextBox ID="txtPrescribedColor" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="管子标识状态" ColumnID="TubeIdentificationStatus" DataField="TubeIdentificationStatus" SortField="TubeIdentificationStatus"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="150px" ExpandUnusedSpace="true">
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="120px">
<Editor>
<f:TextBox ID="txtTubeIdentificationStatus" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="管件名称" ColumnID="PipeFittingName" DataField="PipeFittingName" SortField="PipeFittingName"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="150px" ExpandUnusedSpace="true">
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="120px">
<Editor>
<f:TextBox ID="txtPipeFittingName" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="管件标识状态" ColumnID="PipeFittingStatus" DataField="PipeFittingStatus" SortField="PipeFittingStatus"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="150px" ExpandUnusedSpace="true">
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="120px">
<Editor>
<f:TextBox ID="txtPipeFittingStatus" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:RenderField HeaderText="结果" ColumnID="Conclusion" DataField="Conclusion" SortField="Conclusion"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="150px" ExpandUnusedSpace="true">
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="100px">
<Editor>
<f:TextBox ID="txtConclusion" runat="server"></f:TextBox>
</Editor>
</f:RenderField>
<f:LinkButtonField ColumnID="Delete3" Width="60px" 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>
@ -101,30 +129,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="1100px" Height="500px">
</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,16 +1,44 @@
using BLL;
using FastReport.DevComponents.DotNetBar;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Data;
using System.Linq;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
namespace FineUIPro.Web.JGZL
{
public partial class MaterialIdentificationInspectionRecord : 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; }
}
/// <summary>
/// 定义集合
/// </summary>
private static List<Model.JGZL_MaterialIdentificationInspectionRecord> items = new List<Model.JGZL_MaterialIdentificationInspectionRecord>();
#endregion
#region
/// <summary>
/// 加载页面
@ -28,13 +56,78 @@ namespace FineUIPro.Web.JGZL
this.drpProjectId.DataSource = BLL.Base_ProjectService.GetOnProjectListByUserId(this.CurrUser.UserId, "1");
this.drpProjectId.DataBind();
Funs.FineUIPleaseSelect(this.drpProjectId);
// 默认显示选中的项目
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
{
this.drpProjectId.SelectedValue = this.CurrUser.LoginProjectId;
this.InitTreeMenu();//加载树
this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue;
this.ProjectId = this.tvControlItem.SelectedNodeID;
//管线
this.drpIsoId.DataTextField = "ISO_IsoNo";
this.drpIsoId.DataValueField = "ISO_IsoNo";
this.drpIsoId.DataSource = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByProjectId(this.ProjectId);
this.drpIsoId.DataBind();
PageInfo();
}
}
this.InitTreeMenu();//加载树
private void PageInfo()
{
items.Clear();
if (!string.IsNullOrEmpty(this.ProjectId))
{
var reportLists = BLL.MaterialIdentificationInspectionRecordService.GetListsByProjectId(this.ProjectId);
if (reportLists.Count > 0)
{
var isoLists = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByProjectId(this.ProjectId);
foreach (var item in isoLists)
{
var iso = (from x in Funs.DB.JGZL_MaterialIdentificationInspectionRecord where x.ProjectId == this.ProjectId && x.ISO_Id == item.ISO_IsoNo select x).FirstOrDefault();
if (iso == null)
{
Model.JGZL_MaterialIdentificationInspectionRecord newReport = new Model.JGZL_MaterialIdentificationInspectionRecord();
newReport.RecordId = SQLHelper.GetNewID();
newReport.ProjectId = this.ProjectId;
newReport.ISO_Id = item.ISO_IsoNo;
if (!string.IsNullOrEmpty(item.STE_ID))
{
newReport.STE_ID = BLL.HJGL_MaterialService.GetSteelBySteID(item.STE_ID).STE_Code;
}
newReport.Specifications = item.Specification;
reportLists.Add(newReport);
}
}
if (!string.IsNullOrEmpty(this.drpIsoId.SelectedValue) && this.drpIsoId.SelectedValue != BLL.Const._Null)
{
reportLists = reportLists.Where(x => x.ISO_Id.Contains(this.drpIsoId.SelectedValue)).ToList();
}
this.Grid1.DataSource = reportLists;
this.Grid1.DataBind();
}
else
{
var isoLists = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByProjectId(this.ProjectId);
foreach (var iso in isoLists)
{
Model.JGZL_MaterialIdentificationInspectionRecord newReport = new Model.JGZL_MaterialIdentificationInspectionRecord();
newReport.RecordId = SQLHelper.GetNewID();
newReport.ProjectId = this.ProjectId;
newReport.ISO_Id = iso.ISO_IsoNo;
if (!string.IsNullOrEmpty(iso.STE_ID))
{
newReport.STE_ID = BLL.HJGL_MaterialService.GetSteelBySteID(iso.STE_ID).STE_Code;
}
newReport.Specifications = iso.Specification;
items.Add(newReport);
}
if (!string.IsNullOrEmpty(this.drpIsoId.SelectedValue) && this.drpIsoId.SelectedValue != BLL.Const._Null)
{
items = items.Where(x => x.ISO_Id.Contains(this.drpIsoId.SelectedValue)).ToList();
}
this.Grid1.DataSource = items;
this.Grid1.DataBind();
}
}
}
#endregion
@ -101,6 +194,7 @@ namespace FineUIPro.Web.JGZL
{
if (this.tvControlItem.SelectedNodeID != "0")
{
this.ProjectId = this.tvControlItem.SelectedNodeID;
this.BindGrid();
}
}
@ -112,16 +206,9 @@ namespace FineUIPro.Web.JGZL
/// </summary>
private void BindGrid()
{
string strSql = @"SELECT a.*,b.ISO_IsoNo,c.STE_Code from JGZL_MaterialIdentificationInspectionRecord a
left join HJGL_PW_IsoInfo b on a.ISO_Id = b.ISO_Id
left join HJGL_BS_Steel c on a.STE_ID = c.STE_ID
where 1=1 ";
string strSql = @"SELECT * FROM JGZL_MaterialIdentificationInspectionRecord where ProjectId=@projectId";
List<SqlParameter> listStr = new List<SqlParameter>();
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
{
strSql += " AND a.ProjectId = @ProjectId";
listStr.Add(new SqlParameter("@ProjectId", this.tvControlItem.SelectedNodeID));
}
listStr.Add(new SqlParameter("@projectId", this.ProjectId));
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
@ -179,8 +266,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();
}
@ -203,9 +291,7 @@ namespace FineUIPro.Web.JGZL
/// <param name="e"></param>
protected void btnPrint_Click(object sender, EventArgs e)
{
string projectId = this.tvControlItem.SelectedNodeID;
if (projectId != null)
if (!string.IsNullOrEmpty(this.ProjectId))
{
string initTemplatePath = "";
string rootPath = Server.MapPath("~/");
@ -213,7 +299,7 @@ namespace FineUIPro.Web.JGZL
string strSql = @"SELECT * from JGZL_MaterialIdentificationInspectionRecord where ProjectId = @projectId order by CompileDate ";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@projectId", projectId));
listStr.Add(new SqlParameter("@projectId", this.ProjectId));
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
@ -232,8 +318,8 @@ namespace FineUIPro.Web.JGZL
foreach (var row in rows)
{
var newRow = dt.NewRow();
newRow["ISO_IsoNo"] = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByIsoInfoId(row["ISO_Id"].ToString()).ISO_IsoNo;
newRow["STE_Code"] = BLL.HJGL_MaterialService.GetSteelBySteID(row["STE_ID"].ToString()).STE_Code;
newRow["ISO_IsoNo"] = row["ISO_Id"].ToString();
newRow["STE_Code"] = row["STE_ID"].ToString();
newRow["Specifications"] = row["Specifications"].ToString();
newRow["PrescribedColor"] = row["PrescribedColor"].ToString();
newRow["TubeIdentificationStatus"] = row["TubeIdentificationStatus"].ToString();
@ -246,7 +332,7 @@ namespace FineUIPro.Web.JGZL
Dictionary<string, string> keyValuePairs = new Dictionary<string, string>();
keyValuePairs.Add("ProjectName", BLL.Base_ProjectService.GetProjectByProjectId(projectId).ProjectName);
keyValuePairs.Add("ProjectName", BLL.Base_ProjectService.GetProjectByProjectId(this.ProjectId).ProjectName);
BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs);
initTemplatePath = "File\\Fastreport\\JGZL\\管道材料材质标识检查记录.frx";
@ -273,7 +359,34 @@ namespace FineUIPro.Web.JGZL
{
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("MaterialIdentificationInspectionRecordEdit.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() },
{ "ISO_IsoNo", "" },
{ "STE_Code", "" },
{ "Specifications", "" },
{ "PrescribedColor", "" },
{ "TubeIdentificationStatus", "" },
{ "PipeFittingName", "" },
{ "PipeFittingStatus", "" },
{ "Conclusion", "" },
{
"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
{
@ -281,141 +394,85 @@ 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_MaterialIdentificationInspectionRecordMenuId, BLL.Const.BtnModify))
{
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
{
if (!string.IsNullOrEmpty(this.Grid1.SelectedRowID))
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("MaterialIdentificationInspectionRecordEdit.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_MaterialIdentificationInspectionRecordMenuId, BLL.Const.BtnModify))
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning);
return;
}
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("MaterialIdentificationInspectionRecordEdit.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_MaterialIdentificationInspectionRecordMenuId, 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.MaterialIdentificationInspectionRecordService.DeleteRecordById(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;
return Confirm.GetShowReference("删除选中行?", String.Empty, MessageBoxIcon.Question,
Grid1.GetDeleteSelectedRowsReference(), String.Empty);
}
if (string.IsNullOrEmpty(content))
{
return true;
}
else
{
if (isShow)
{
Alert.ShowInTop(content, MessageBoxIcon.Error);
}
return false;
}
}
#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_MaterialIdentificationInspectionRecordMenuId, Const.BtnSave))
{
items.Clear();
BLL.MaterialIdentificationInspectionRecordService.DeleteListsByProjectId(this.ProjectId);
JArray teamGroupData = Grid1.GetMergedData();
foreach (JObject teamGroupRow in teamGroupData)
{
JObject values = teamGroupRow.Value<JObject>("values");
int rowIndex = teamGroupRow.Value<int>("index");
Model.JGZL_MaterialIdentificationInspectionRecord newDetail = new Model.JGZL_MaterialIdentificationInspectionRecord
{
RecordId = values.Value<string>("RecordId"),
ProjectId = this.ProjectId,
ISO_Id = values.Value<string>("ISO_Id"),
STE_ID = values.Value<string>("STE_ID"),
Specifications = values.Value<string>("Specifications"),
PrescribedColor = values.Value<string>("PrescribedColor"),
TubeIdentificationStatus = values.Value<string>("TubeIdentificationStatus"),
PipeFittingName = values.Value<string>("PipeFittingName"),
PipeFittingStatus = values.Value<string>("PipeFittingStatus"),
Conclusion = values.Value<string>("Conclusion"),
CompileMan = this.CurrUser.UserId,
CompileDate = DateTime.Now
};
items.Add(newDetail);
}
try
{
if (items.Count > 0)
{
Funs.DB.JGZL_MaterialIdentificationInspectionRecord.InsertAllOnSubmit(items);
}
Funs.DB.SubmitChanges();
}
catch (Exception)
{
return;
}
ShowNotify("保存成功!", MessageBoxIcon.Success);
//PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
else
{
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
return;
}
}
#endregion
protected void drpIsoId_SelectedIndexChanged(object sender, EventArgs e)
{
PageInfo();
}
}
}

View File

@ -95,6 +95,15 @@ namespace FineUIPro.Web.JGZL
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// drpIsoId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpIsoId;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
@ -113,6 +122,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 +149,78 @@ namespace FineUIPro.Web.JGZL
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// txtISO_Id 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtISO_Id;
/// <summary>
/// txtSTE_Code 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtSTE_Code;
/// <summary>
/// txtSpecifications 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtSpecifications;
/// <summary>
/// txtPrescribedColor 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPrescribedColor;
/// <summary>
/// txtTubeIdentificationStatus 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtTubeIdentificationStatus;
/// <summary>
/// txtPipeFittingName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPipeFittingName;
/// <summary>
/// txtPipeFittingStatus 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPipeFittingStatus;
/// <summary>
/// txtConclusion 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtConclusion;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
@ -158,15 +248,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 +256,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

@ -278,8 +278,10 @@ namespace FineUIPro.Web.JGZL
newMainData["ShrinkageHole"] = report.ShrinkageHole;
newMainData["HeavyLeather"] = report.HeavyLeather;
newMainData["Other"] = report.Other;
if (!string.IsNullOrEmpty(report.Remark))
{
newMainData["ImageUrl"] = Funs.RootPath + report.Remark.Substring(report.Remark.IndexOf('/'));
}
dtMainData.Rows.Add(newMainData);
BLL.Common.FastReportService.AddFastreportTable(dtMainData);
@ -566,6 +568,8 @@ namespace FineUIPro.Web.JGZL
{
var r = BLL.SteelPipeCheckRecordService.GetSteelPipeReportById(this.RecordId);
if (r != null)
{
if (!string.IsNullOrEmpty(r.Remark))
{
string url = r.Remark.Substring(r.Remark.IndexOf('/'));
if (File.Exists(Funs.RootPath + url))
@ -574,6 +578,7 @@ namespace FineUIPro.Web.JGZL
File.Delete(Funs.RootPath + url);
}
}
}
newReport.RecordId = this.RecordId;
BLL.SteelPipeCheckRecordService.UpdateSteelPipeReport(newReport);
}