From a8a0d6142f502162799c766e274ff5dad1b97d12 Mon Sep 17 00:00:00 2001 From: liyh Date: Sun, 12 May 2024 10:16:07 +0800 Subject: [PATCH] 111 --- .../WeldingProcess/PMI/PMIDetectionEntry.aspx | 177 +++++++++++ .../PMI/PMIDetectionEntry.aspx.cs | 298 ++++++++++++++++++ .../PMI/PMIDetectionEntry.aspx.designer.cs | 251 +++++++++++++++ 3 files changed, 726 insertions(+) create mode 100644 HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx create mode 100644 HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx.cs create mode 100644 HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx.designer.cs diff --git a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx new file mode 100644 index 0000000..79410dd --- /dev/null +++ b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx @@ -0,0 +1,177 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PMIDetectionEntry.aspx.cs" Inherits="FineUIPro.Web.WeldingProcess.PMI.PMIDetectionEntry" %> + + + + + + + PMI检测录入 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx.cs b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx.cs new file mode 100644 index 0000000..92ae0a2 --- /dev/null +++ b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx.cs @@ -0,0 +1,298 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; +using BLL; +using System.Web; +using System.Collections; +using Model; +using static System.Windows.Forms.VisualStyles.VisualStyleElement; + +namespace FineUIPro.Web.WeldingProcess.PMI +{ + public partial class PMIDetectionEntry : PageBase + { + #region 定义项 + /// + /// 检测单主键 + /// + public string PMIID + { + get + { + return (string)ViewState["PMIID"]; + } + set + { + ViewState["PMIID"] = value; + } + } + #endregion + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.txtNDEDateMonth.Text = string.Format("{0:yyyy-MM}", DateTime.Now); + this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); + this.PMIID = string.Empty; + this.InitTreeMenu();//加载树 + } + } + + #region 加载树 + /// + /// 加载树 + /// + private void InitTreeMenu() + { + if (!string.IsNullOrEmpty(this.txtNDEDateMonth.Text.Trim())) + { + DateTime startTime = Convert.ToDateTime(this.txtNDEDateMonth.Text.Trim() + "-01"); + DateTime endTime = startTime.AddMonths(1); + this.tvControlItem.Nodes.Clear(); + List units = new List(); + Model.Project_Unit pUnit = BLL.Project_UnitService.GetProject_UnitByProjectIdUnitId(this.CurrUser.LoginProjectId, this.CurrUser.UnitId); + if (pUnit == null || pUnit.UnitType == BLL.Const.UnitType_1 || pUnit.UnitType == BLL.Const.UnitType_2 + || pUnit.UnitType == BLL.Const.UnitType_3 || pUnit.UnitType == BLL.Const.UnitType_4 + || pUnit.UnitType == BLL.Const.UnitType_6) + { + units = (from x in Funs.DB.Base_Unit + join y in Funs.DB.Project_Unit on x.UnitId equals y.UnitId + where y.ProjectId == this.CurrUser.LoginProjectId && y.UnitType.Contains(BLL.Const.UnitType_5) + select x).ToList(); + } + else + { + units.Add(BLL.Base_UnitService.GetUnit(this.CurrUser.UnitId)); + } + if (units != null) + { + foreach (var unit in units) + { + TreeNode newNode = new TreeNode();//定义根节点 + newNode.Text = unit.UnitName; + newNode.NodeID = unit.UnitId; + newNode.Expanded = true; + newNode.ToolTip = "Unit"; + this.tvControlItem.Nodes.Add(newNode); + this.BindNodes(newNode); + } + } + else + { + Alert.ShowInTop(Resources.Lan.PleaseAddUnitFirst, MessageBoxIcon.Warning); + } + } + else + { + Alert.ShowInTop(Resources.Lan.PleaseSelectTrustMonth, MessageBoxIcon.Warning); + } + } + + /// + /// 绑定树节点 + /// + /// + private void BindNodes(TreeNode node) + { + if (node.ToolTip == "Unit") + { + ///装置 + var install = (from x in Funs.DB.Project_Installation + join y in Funs.DB.PMI_Delegation on x.InstallationId equals y.InstallationId + where y.UnitId == node.NodeID && x.ProjectId == this.CurrUser.LoginProjectId + orderby x.InstallationCode + select x).Distinct(); + foreach (var q in install) + { + TreeNode newNode = new TreeNode(); + newNode.Text = q.InstallationName; + newNode.NodeID = q.InstallationId + "|" + node.NodeID; + newNode.ToolTip = "Installation"; + node.Nodes.Add(newNode); + BindNodes(newNode); + } + } + else if (node.ToolTip == "Installation") + { + string[] unitAndInstallationArr= node.NodeID.Split('|'); + var ndt = from x in Funs.DB.PMI_Delegation where x.UnitId == unitAndInstallationArr[1] + && x.InstallationId == unitAndInstallationArr[0] + && x.ProjectId == this.CurrUser.LoginProjectId select x; + foreach (var q in ndt) + { + + TreeNode newNode = new TreeNode(); + newNode.Text = q.DelegationNo; + newNode.NodeID = q.Id; + newNode.ToolTip = "DelegationNo"; + newNode.EnableClickEvent = true; + node.Nodes.Add(newNode); + BindNodes(newNode); + } + } + } + #endregion + + #region 点击TreeView + /// + /// 点击TreeView + /// + /// + /// + protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e) + { + this.PMIID = tvControlItem.SelectedNodeID; + this.hdPMIId.Text = this.PMIID; + this.BindGrid(); + } + #endregion + + #region 数据绑定 + protected void TextBox_TextChanged(object sender, EventArgs e) + { + this.BindGrid(); + } + + /// + /// 数据绑定 + /// + private void BindGrid() + { + if (!string.IsNullOrWhiteSpace(this.hdPMIId.Text) && this.tvControlItem.SelectedNode.ToolTip == "DelegationNo") + { + this.SetTextTemp(); + this.PageInfoLoad(); ///页面输入提交信息 + + } + } + + #region 加载页面输入提交信息 + /// + /// 加载页面输入提交信息 + /// + private void PageInfoLoad() + { + this.SimpleForm1.Reset(); ///重置所有字段 + var pageInfo = (from x in Funs.DB.PMI_Delegation + join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId + join n in Funs.DB.Project_Installation on x.InstallationId equals n.InstallationId + join u in Funs.DB.Sys_User on x.DetectionStandard equals u.UserId into u1 //左连接查询 + from u in u1.DefaultIfEmpty() + where x.Id==hdPMIId.Text + select new { DelegationNo=x.DelegationNo, + DelegationDate=x.DelegationDate, + InstallationName=n.InstallationName, + UnitName=y.UnitName, + DetectionMethod="待定", + Tabler=x.Tabler, + Remark=x.Remark, + }).ToList(); + if (pageInfo.Count>0) + { + this.txtDelegationNo.Text = pageInfo[0].DelegationNo; + this.txtDelegationDate.Text = pageInfo[0].DelegationDate.ToString(); + this.txtInstallationName.Text = pageInfo[0].InstallationName; + this.txtUnitName.Text = pageInfo[0].UnitName; + this.txtDetectionMethod.Text = pageInfo[0].DetectionMethod; + this.txtTabler.Text = pageInfo[0].Tabler; + this.txtRemark.Text = pageInfo[0].Remark; + } + } + #endregion + + /// + /// 清空 + /// + private void SetTextTemp() + { + this.txtDelegationNo.Text = string.Empty; + this.txtDelegationDate.Text = string.Empty; + this.txtInstallationName.Text = string.Empty; + this.txtUnitName.Text = string.Empty; + this.txtDetectionMethod.Text = string.Empty; + this.txtTabler.Text = string.Empty; + this.txtRemark.Text = string.Empty; + } + #endregion + + #region 分页排序 + #region 页索引改变事件 + /// + /// 页索引改变事件 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + BindGrid(); + } + #endregion + + #region 排序 + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + BindGrid(); + } + #endregion + + #region 分页选择下拉改变事件 + /// + /// 分页选择下拉改变事件 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + #endregion + #endregion + + #region 关闭弹出窗口及刷新页面 + + /// + /// 查询 + /// + /// + /// + protected void Tree_TextChanged(object sender, EventArgs e) + { + this.InitTreeMenu(); + //this.BindGrid(); + } + #endregion + + #region 格式化字符串 + /// + /// 获取缺陷 + /// + /// + /// + protected string ConvertCheckDefects(object CheckDefects) + { + string str = string.Empty; + if (CheckDefects != null) + { + HttpCookie lanCookie = Request.Cookies["SelectLan"]; + if (lanCookie["lan"] == "zh-CN") //中文 + { + str = BLL.Base_DefectService.GetDefectNameStrByDefectIdStr(CheckDefects.ToString()); + } + else + { + str = BLL.Base_DefectService.GetDefectEngNameStrByDefectIdStr(CheckDefects.ToString()); + } + } + return str; + } + #endregion + } +} \ No newline at end of file diff --git a/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx.designer.cs b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx.designer.cs new file mode 100644 index 0000000..76a035a --- /dev/null +++ b/HJGL/FineUIPro.Web/WeldingProcess/PMI/PMIDetectionEntry.aspx.designer.cs @@ -0,0 +1,251 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.WeldingProcess.PMI +{ + + + public partial class PMIDetectionEntry + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// panelLeftRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// txtNDEDateMonth 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtNDEDateMonth; + + /// + /// Toolbar5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar5; + + /// + /// txtSearchCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtSearchCode; + + /// + /// tvControlItem 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tree tvControlItem; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// hdPMIId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdPMIId; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// txtDelegationNo 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label txtDelegationNo; + + /// + /// txtDelegationDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label txtDelegationDate; + + /// + /// txtInstallationName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label txtInstallationName; + + /// + /// txtUnitName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label txtUnitName; + + /// + /// txtDetectionMethod 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label txtDetectionMethod; + + /// + /// txtDetectionStandard 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label txtDetectionStandard; + + /// + /// txtTabler 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label txtTabler; + + /// + /// txtRemark 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label txtRemark; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + } +}