7fb6b255d2
扩展图纸识别结果模型和保存流程,按管线及页码替换识别明细, 避免重复导入造成数据累积;同时自动补充材料编码库数据, 新增材料总览、管段长度总览及 PDF 焊口标记功能,提升识别数据 的查询、复核和后续使用效率。
119 lines
3.9 KiB
C#
119 lines
3.9 KiB
C#
namespace FineUIPro.Web.HJGL.DataIn
|
|
{
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using Model;
|
|
|
|
public partial class DrawingRecognitionContentEdit : PageBase
|
|
{
|
|
#region 定义项
|
|
public int Index
|
|
{
|
|
get
|
|
{
|
|
return (int)ViewState["Index"];
|
|
}
|
|
set
|
|
{
|
|
ViewState["Index"] = value;
|
|
}
|
|
}
|
|
|
|
public string DataKey
|
|
{
|
|
get
|
|
{
|
|
return (string)ViewState["DataKey"];
|
|
}
|
|
set
|
|
{
|
|
ViewState["DataKey"] = value;
|
|
}
|
|
}
|
|
|
|
private List<HJGL_DrawingRecognition_Material> MaterialEntities
|
|
{
|
|
get
|
|
{
|
|
return Session[DataKey + DrawingRecognitionContent.MaterialSessionSuffix]
|
|
as List<HJGL_DrawingRecognition_Material>;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 加载页面
|
|
/// <summary>
|
|
/// 加载页面
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
this.Index = int.Parse(Request.Params["Index"]);
|
|
this.DataKey = Request.Params["DataKey"];
|
|
var materialEntities = MaterialEntities;
|
|
if (materialEntities == null || this.Index < 0 || this.Index >= materialEntities.Count)
|
|
{
|
|
Alert.ShowInTop("材料实体数据已失效,请关闭窗口后重新审核!", MessageBoxIcon.Warning);
|
|
return;
|
|
}
|
|
|
|
var material = materialEntities[this.Index];
|
|
this.txtPipeNo.Text = material.Pipe_no;
|
|
this.txtDrawingNumber.Text = material.Drawing_number;
|
|
this.txtCategory.Text = material.Category;
|
|
this.txtQty.Text = material.Qty;
|
|
this.txtSpec.Text = material.Spec;
|
|
this.txtPageNo.Text = Convert.ToString(material.Pipe_page_no);
|
|
this.txtDescription.Text = material.Description;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 提交按钮
|
|
/// <summary>
|
|
/// 提交按钮
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void btnSave_Click(object sender, EventArgs e)
|
|
{
|
|
var materialEntities = MaterialEntities;
|
|
if (materialEntities == null || this.Index < 0 || this.Index >= materialEntities.Count)
|
|
{
|
|
Alert.ShowInTop("材料实体数据已失效,请关闭窗口后重新审核!", MessageBoxIcon.Warning);
|
|
return;
|
|
}
|
|
|
|
if (!int.TryParse(this.txtPageNo.Text, out var pipePageNo))
|
|
{
|
|
Alert.ShowInTop("管线页码必须为整数!", MessageBoxIcon.Warning);
|
|
return;
|
|
}
|
|
|
|
var material = materialEntities[this.Index];
|
|
material.Pipe_no = this.txtPipeNo.Text;
|
|
material.Drawing_number = this.txtDrawingNumber.Text;
|
|
material.Category = this.txtCategory.Text;
|
|
material.Qty = this.txtQty.Text;
|
|
material.Spec = this.txtSpec.Text;
|
|
material.Pipe_page_no = pipePageNo;
|
|
material.Description = this.txtDescription.Text;
|
|
Alert.ShowInTop("信息修改完成!", MessageBoxIcon.Success);
|
|
|
|
if (ckAll.Checked)
|
|
{
|
|
PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(Index.ToString()) + ActiveWindow.GetHidePostBackReference());
|
|
}
|
|
else
|
|
{
|
|
PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference("") + ActiveWindow.GetHidePostBackReference());
|
|
|
|
}
|
|
}
|
|
#endregion
|
|
}
|
|
}
|