From 4bf04643506685d55894c948f57b28b5a7627072 Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Wed, 9 Jul 2025 17:01:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=97=A8=E6=A7=9BBOM?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=9C=B0=E7=82=B9?= =?UTF-8?q?=E3=80=81=E6=98=AF=E5=90=A6=E6=A3=80=E6=B5=8B=E9=A1=B9=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MESWebSite/HttpHandlers/Bom_MKHandler.ashx | 1 + MESWebSite/HttpHandlers/Bom_MKHandler.ashx.cs | 132 ++++++ MESWebSite/MESWebSite.csproj | 12 + MESWebSite/Manage/Bom.aspx | 2 +- MESWebSite/Manage/Bom.aspx.designer.cs | 20 +- MESWebSite/Manage/Bom_MK.aspx | 413 ++++++++++++++++++ MESWebSite/Manage/Bom_MK.aspx.cs | 20 + MESWebSite/Manage/Bom_MK.aspx.designer.cs | 44 ++ 8 files changed, 634 insertions(+), 10 deletions(-) create mode 100644 MESWebSite/HttpHandlers/Bom_MKHandler.ashx create mode 100644 MESWebSite/HttpHandlers/Bom_MKHandler.ashx.cs create mode 100644 MESWebSite/Manage/Bom_MK.aspx create mode 100644 MESWebSite/Manage/Bom_MK.aspx.cs create mode 100644 MESWebSite/Manage/Bom_MK.aspx.designer.cs diff --git a/MESWebSite/HttpHandlers/Bom_MKHandler.ashx b/MESWebSite/HttpHandlers/Bom_MKHandler.ashx new file mode 100644 index 0000000..ebd4fc0 --- /dev/null +++ b/MESWebSite/HttpHandlers/Bom_MKHandler.ashx @@ -0,0 +1 @@ +<%@ WebHandler Language="C#" CodeBehind="Bom_MKHandler.ashx.cs" Class="MESWebSite.HttpHandlers.Bom_MKHandler" %> diff --git a/MESWebSite/HttpHandlers/Bom_MKHandler.ashx.cs b/MESWebSite/HttpHandlers/Bom_MKHandler.ashx.cs new file mode 100644 index 0000000..af0fe98 --- /dev/null +++ b/MESWebSite/HttpHandlers/Bom_MKHandler.ashx.cs @@ -0,0 +1,132 @@ +using MESClassLibrary.BLL.BasicInfo; +using MESClassLibrary.EFModel; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace MESWebSite.HttpHandlers +{ + /// + /// Bom_MKHandler 的摘要说明 + /// + public class Bom_MKHandler : IHttpHandler + { + + HttpRequest Request = null; + HttpResponse Response = null; + + public void ProcessRequest(HttpContext context) + { + context.Response.ContentType = "text/plain"; + Request = context.Request; + Response = context.Response; + + string method = Request.Params["method"]; + switch (method) + { + + case "QueryList": + QueryList(); + break; + case "SaveInfo": + SaveInfo(); + break; + case "DelInfo": + DelInfo(); + break; + + default: + break; + + } + + } + public bool IsReusable + { + get + { + return false; + } + } + + void QueryList() + { + string page = Request.Params["page"]; + string pagesize = Request.Params["rows"]; + string partNo1 = Request.Params["PartNo1"]; + string partNo2 = Request.Params["PartNo2"]; + string placeName = Request.Params["PlaceName"]; + + if (string.IsNullOrEmpty(page)) + { + page = "0"; + } + if (string.IsNullOrEmpty(pagesize)) + { + pagesize = "15"; + } + Bom_MKBLL bll = new Bom_MKBLL(); + Response.Write(bll.SearchInfoAll(page, pagesize, partNo1, partNo2, placeName)); + Response.End(); + + + } + void SaveInfo() + { + string BomID = Request.Params["BomID"]; + string PartNo1 = Request.Params["PartNo1"]; + string PartNo2 = Request.Params["PartNo2"]; + string IsChecked = Request.Params["IsChecked"]; + string PlaceName = Request.Params["PlaceName"]; + + Bom_MKBLL bll = new Bom_MKBLL(); + tb_Bom_MK md = new tb_Bom_MK(); + + md.PartNo1 = PartNo1; + md.PartNo2 = PartNo2; + md.PlaceName = PlaceName; + if (IsChecked == "1") + { + md.IsChecked = true; + } + + var info = Request.Cookies.Get("LoginUserInfo"); + if (info != null) + { + md.UserID = info["UserID"].ToUpper(); + } + + if (BomID == "0") + { + //新增 + md.BomID = Guid.NewGuid().ToString(); + Response.Write(bll.AddInfo(md) == true ? "true" : "false"); + } + else + { + //修改 + md.BomID = BomID; + Response.Write(bll.UpdateInfo(md) == true ? "true" : "false"); + } + Response.End(); + } + void DelInfo() + { + string BomID = Request.Params["BomID"]; + + Bom_MKBLL bll = new Bom_MKBLL(); + tb_Bom_MK md = new tb_Bom_MK(); + md.BomID = BomID; + var info = Request.Cookies.Get("LoginUserInfo"); + if (info != null) + { + md.UserID = info["UserID"].ToUpper(); + } + Response.Write(bll.DeleteInfo(md) == true ? "true" : "false"); + Response.End(); + + } + + } +} \ No newline at end of file diff --git a/MESWebSite/MESWebSite.csproj b/MESWebSite/MESWebSite.csproj index af2dafe..ccaf66e 100644 --- a/MESWebSite/MESWebSite.csproj +++ b/MESWebSite/MESWebSite.csproj @@ -118,6 +118,7 @@ + @@ -838,6 +839,7 @@ + @@ -1080,6 +1082,9 @@ BarCodeReportnHandler.ashx + + Bom_MKHandler.ashx + BomHandler.ashx @@ -1330,6 +1335,13 @@ BarCodeRepeatSearch.aspx + + Bom_MK.aspx + ASPXCodeBehind + + + Bom_MK.aspx + Bom.aspx ASPXCodeBehind diff --git a/MESWebSite/Manage/Bom.aspx b/MESWebSite/Manage/Bom.aspx index 462f08e..affa775 100644 --- a/MESWebSite/Manage/Bom.aspx +++ b/MESWebSite/Manage/Bom.aspx @@ -197,7 +197,7 @@ { field: 'PartNo1', title: '注塑件(零件号)', sortable: 'true', width: 10 }, { field: 'ProductName1', title: '产品名称', sortable: 'true', width: 10 }, { field: 'PartNo2', title: '塑料粒子(零件号)', sortable: 'true', width: 10 }, - { field: 'ProductName2', title: '原料名称', sortable: 'true', width: 10 } + { field: 'ProductName2', title: '原料名称', sortable: 'true', width: 10 } ]], pagination: true,//表示在datagrid设置分页 diff --git a/MESWebSite/Manage/Bom.aspx.designer.cs b/MESWebSite/Manage/Bom.aspx.designer.cs index ae8892f..fa029db 100644 --- a/MESWebSite/Manage/Bom.aspx.designer.cs +++ b/MESWebSite/Manage/Bom.aspx.designer.cs @@ -2,16 +2,18 @@ // <自动生成> // 此代码由工具生成。 // -// 对此文件的更改可能会导致不正确的行为,并且如果 -// 重新生成代码,这些更改将会丢失。 +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 // //------------------------------------------------------------------------------ -namespace MESWebSite.Manage { - - - public partial class Bom { - +namespace MESWebSite.Manage +{ + + + public partial class Bom + { + /// /// form1 控件。 /// @@ -20,7 +22,7 @@ namespace MESWebSite.Manage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// lblMessage 控件。 /// @@ -29,7 +31,7 @@ namespace MESWebSite.Manage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Label lblMessage; - + /// /// UserID 控件。 /// diff --git a/MESWebSite/Manage/Bom_MK.aspx b/MESWebSite/Manage/Bom_MK.aspx new file mode 100644 index 0000000..edc2979 --- /dev/null +++ b/MESWebSite/Manage/Bom_MK.aspx @@ -0,0 +1,413 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Bom_MK.aspx.cs" Inherits="MESWebSite.Manage.Bom_MK" %> + + + + + + + + + + + + + + + + + 门槛BOM信息 + + +
+
+ + + + + + + + + + + + + + +
BOM信息 + 注塑件零件号: + 塑料粒子零件号: + 地点: + 查询 + 新增 + + 编辑 + + 删除 +
+
+ +
+ + + + + + + + +
+ + diff --git a/MESWebSite/Manage/Bom_MK.aspx.cs b/MESWebSite/Manage/Bom_MK.aspx.cs new file mode 100644 index 0000000..9d22bf4 --- /dev/null +++ b/MESWebSite/Manage/Bom_MK.aspx.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace MESWebSite.Manage +{ + public partial class Bom_MK : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + if (Request.Cookies["LoginUserInfo"] == null) + { + Response.Write(""); + } + } + } +} \ No newline at end of file diff --git a/MESWebSite/Manage/Bom_MK.aspx.designer.cs b/MESWebSite/Manage/Bom_MK.aspx.designer.cs new file mode 100644 index 0000000..427fc22 --- /dev/null +++ b/MESWebSite/Manage/Bom_MK.aspx.designer.cs @@ -0,0 +1,44 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace MESWebSite.Manage +{ + + + public partial class Bom_MK + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// lblMessage 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblMessage; + + /// + /// UserID 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlInputText UserID; + } +}