ruoxing.wang 2 weeks ago
parent
commit
c45f9d47d2
  1. 50
      InjectionPC/FrmQuality.Designer.cs
  2. 35
      InjectionPC/FrmQuality.cs
  3. 247
      MESClassLibrary/BLL/BasicInfo/ForeignColorMapBLL.cs
  4. 52
      MESClassLibrary/BussinessHelper.cs
  5. 88
      MESClassLibrary/DAL/BasicInfo/ForeignColorMapDAL.cs
  6. 1
      MESClassLibrary/EFModel/BBMPT.Context.cs
  7. 23
      MESClassLibrary/EFModel/tb_ForeignColorMap.cs
  8. 5
      MESClassLibrary/MESClassLibrary.csproj
  9. 1
      MESWebSite/HttpHandlers/ForeignColorMapHandler.ashx
  10. 151
      MESWebSite/HttpHandlers/ForeignColorMapHandler.ashx.cs
  11. 12
      MESWebSite/MESWebSite.csproj
  12. 399
      MESWebSite/Manage/ForeignColorMap.aspx
  13. 20
      MESWebSite/Manage/ForeignColorMap.aspx.cs
  14. 44
      MESWebSite/Manage/ForeignColorMap.aspx.designer.cs
  15. 3
      PaintingPC/Function.cs
  16. 2
      WebService/WMSWebService.asmx.cs

50
InjectionPC/FrmQuality.Designer.cs

@ -60,15 +60,15 @@
this.pictureBox2 = new System.Windows.Forms.PictureBox();
this.panel2 = new System.Windows.Forms.Panel();
this.button1 = new System.Windows.Forms.Button();
this.txtBoxCode = new System.Windows.Forms.TextBox();
this.label12 = new System.Windows.Forms.Label();
this.textBox2 = new System.Windows.Forms.TextBox();
this.timer2 = new System.Windows.Forms.Timer(this.components);
this.lbBoxCode = new System.Windows.Forms.Label();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.panel3 = new System.Windows.Forms.Panel();
this.rbtn1 = new System.Windows.Forms.RadioButton();
this.rbtn2 = new System.Windows.Forms.RadioButton();
this.rbtn1 = new System.Windows.Forms.RadioButton();
this.txtBoxCode = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
@ -351,16 +351,6 @@
this.button1.UseVisualStyleBackColor = false;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// txtBoxCode
//
this.txtBoxCode.Font = new System.Drawing.Font("宋体", 28F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtBoxCode.Location = new System.Drawing.Point(356, 292);
this.txtBoxCode.Margin = new System.Windows.Forms.Padding(5);
this.txtBoxCode.Name = "txtBoxCode";
this.txtBoxCode.Size = new System.Drawing.Size(1047, 93);
this.txtBoxCode.TabIndex = 43;
this.txtBoxCode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox1_KeyDown);
//
// label12
//
this.label12.BackColor = System.Drawing.Color.DeepSkyBlue;
@ -429,17 +419,6 @@
this.panel3.Size = new System.Drawing.Size(331, 198);
this.panel3.TabIndex = 47;
//
// rbtn1
//
this.rbtn1.AutoSize = true;
this.rbtn1.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.rbtn1.Location = new System.Drawing.Point(292, 31);
this.rbtn1.Name = "rbtn1";
this.rbtn1.Size = new System.Drawing.Size(27, 26);
this.rbtn1.TabIndex = 38;
this.rbtn1.UseVisualStyleBackColor = true;
this.rbtn1.CheckedChanged += new System.EventHandler(this.rbtn1_CheckedChanged);
//
// rbtn2
//
this.rbtn2.AutoSize = true;
@ -453,16 +432,37 @@
this.rbtn2.UseVisualStyleBackColor = true;
this.rbtn2.CheckedChanged += new System.EventHandler(this.rbtn2_CheckedChanged);
//
// rbtn1
//
this.rbtn1.AutoSize = true;
this.rbtn1.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.rbtn1.Location = new System.Drawing.Point(292, 31);
this.rbtn1.Name = "rbtn1";
this.rbtn1.Size = new System.Drawing.Size(27, 26);
this.rbtn1.TabIndex = 38;
this.rbtn1.UseVisualStyleBackColor = true;
this.rbtn1.CheckedChanged += new System.EventHandler(this.rbtn1_CheckedChanged);
//
// txtBoxCode
//
this.txtBoxCode.Font = new System.Drawing.Font("宋体", 28F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtBoxCode.Location = new System.Drawing.Point(356, 291);
this.txtBoxCode.Margin = new System.Windows.Forms.Padding(5);
this.txtBoxCode.Name = "txtBoxCode";
this.txtBoxCode.Size = new System.Drawing.Size(1047, 93);
this.txtBoxCode.TabIndex = 48;
this.txtBoxCode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox1_KeyDown);
//
// FrmQuality
//
this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(2560, 2048);
this.Controls.Add(this.txtBoxCode);
this.Controls.Add(this.panel3);
this.Controls.Add(this.tableLayoutPanel1);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.label12);
this.Controls.Add(this.txtBoxCode);
this.Controls.Add(this.button1);
this.Controls.Add(this.panel2);
this.Controls.Add(this.pictureBox2);
@ -522,7 +522,6 @@
private System.Windows.Forms.PictureBox pictureBox2;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.TextBox txtBoxCode;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.Timer timer2;
@ -531,5 +530,6 @@
private System.Windows.Forms.Panel panel3;
private System.Windows.Forms.RadioButton rbtn1;
private System.Windows.Forms.RadioButton rbtn2;
private System.Windows.Forms.TextBox txtBoxCode;
}
}

35
InjectionPC/FrmQuality.cs

@ -1024,19 +1024,20 @@ namespace InjectionPC
/// <param name="e"></param>
private void textBox1_KeyDown(object sender, KeyEventArgs e)
{
try
{
InjectionBoxBLL bll=new InjectionBoxBLL();
BarCodeBLL pbll =new BarCodeBLL();
InjectionBoxBLL bll = new InjectionBoxBLL();
BarCodeBLL pbll = new BarCodeBLL();
if (e.KeyCode == Keys.Enter)
if (e.KeyCode == Keys.Enter)
{
try
{
string packageCode = txtBoxCode.Text.Trim();
if (string.IsNullOrEmpty(packageCode)) return;
DataTable packageTable = pbll.SearchBarCode(packageCode, Program.tableName, "100");
if(packageTable.Rows.Count == 0)
if (packageTable.Rows.Count == 0)
{
//MessageBox.Show($"扫描箱单[{packageCode}]在系统中不存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
MessageBox.Show($"扫描箱单[{packageCode}]不存在未报废订单!");
@ -1049,8 +1050,7 @@ namespace InjectionPC
BarCodeScan(dr["OneBarCode"].ToString());
@ -1105,15 +1105,16 @@ namespace InjectionPC
// return;
//}
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
}
finally
{
txtBoxCode.SelectAll();
}
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
}
finally
{
txtBoxCode.SelectAll();
}
}
private void timer2_Tick(object sender, EventArgs e)

247
MESClassLibrary/BLL/BasicInfo/ForeignColorMapBLL.cs

@ -0,0 +1,247 @@
using MESClassLibrary.BLL.Log;
using MESClassLibrary.EFModel;
using MESClassLibrary.Model;
using MESClassLibrary.DAL.BasicInfo;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.SqlClient;
namespace MESClassLibrary.BLL.BasicInfo
{
public class ForeignColorMapBLL
{
//BasicBLL<tb_ForeignColorMap> db = new BasicBLL<tb_ForeignColorMap>();
//ForeignColorMapDAL da =new ForeignColorMapDAL();
///// <summary>
///// 查询信息
///// </summary>
///// <returns></returns>
//public string SearchInfo(string page, string pagesize, string StationNo, string LineID)
//{
// try
// {
// string jsonStr = "[]";
// int total = 0;//总行数
// List<tb_ForeignColorMap> list = db.SearchAllInfo();
// if (!String.IsNullOrEmpty(LineID))
// {
// list = list.Where(p => p.LineID == LineID).ToList();//按条件分页查询
// }
// if (!String.IsNullOrEmpty(StationNo))
// {
// list = list.Where(p => p.StationNo != null && p.StationNo.Contains(StationNo)).ToList();//按条件分页查询
// }
// if (list.Count > 0)
// {
// total = list.Count;
// int Skipcount = (Convert.ToInt32(page) - 1) * Convert.ToInt32(pagesize);
// list = list.Skip(Skipcount).Take(Convert.ToInt32(pagesize)).ToList();
// #region 联查
// List<StationModel> StationList = new List<StationModel>();
// BasicBLL<tb_Line> pl_db = new BasicBLL<tb_Line>();
// var pl_list = pl_db.SearchAllInfo().ToList();
// foreach (var item in list)
// {
// StationModel dm = Tool.Mapper<StationModel, tb_Station>(item);
// var info = pl_list.FirstOrDefault(p => p.LineID == item.LineID);
// if (info != null)
// {
// dm.LineName = info.LineName;
// }
// StationList.Add(dm);
// }
// #endregion
// JsonDataModel<StationModel> md = new JsonDataModel<StationModel>();
// md.total = total.ToString();
// md.rows = StationList;
// jsonStr = JSONTools.ScriptSerialize<JsonDataModel<StationModel>>(md);
// }
// return jsonStr;
// }
// catch (Exception ex)
// {
// LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
// return "";
// }
//}
///// <summary>
///// 添加信息
///// </summary>
///// <param name="md">生产线模型对象</param>
///// <returns></returns>
//public bool AddInfo(tb_Station md)
//{
// try
// {
// var list = db.SearchInfoByKey("StationNo", md.StationNo);//判断是否有重复数据
// if (list != null)
// {
// if (list.Where(p => p.StationID != md.StationID).Count() > 0)
// {
// return false;
// }
// }
// return db.AddInfo(md);
// }
// catch (Exception ex)
// {
// LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
// return false;
// }
//}
///// <summary>
///// 修改信息
///// </summary>
///// <param name="md">生产线模型对象</param>
///// <returns></returns>
//public bool UpdateInfo(tb_Station md)
//{
// try
// {
// var list = db.SearchAllInfo().Where(p => p.StationNo == md.StationNo && p.StationID != md.StationID).ToList();//判断是否有重复数据
// if (list.Count > 0)
// {
// return false;
// }
// //初始化要更新的字段
// string[] proNames = new string[4];
// proNames[0] = "LineID";
// proNames[1] = "StationNo";
// proNames[2] = "Des";
// proNames[3] = "ChangeMould";
// //必填字段初始化,如果不需要更新必填字段则设置为空即可,时间类型无需初始化
// //如果没有初始化必填字段,更新会报错
// //md.Des = "";
// return db.UpdateInfo(md, proNames);
// }
// catch (Exception ex)
// {
// LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
// return false;
// }
//}
///// 删除生产线信息
//public bool DelInfo(tb_Station md)
//{
// try
// {
// return db.DelInfo(md);
// }
// catch (Exception ex)
// {
// LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
// return false;
// }
//}
//public string GetComboboxData(string StationNo)
//{
// try
// {
// string jsonStr = "[]";
// if (StationNo == null || StationNo == "")
// {
// var list = db.SearchAllInfo().ToList();//判断是否有重复数据
// jsonStr = JSONTools.ScriptSerialize<List<tb_Station>>(list);
// }
// else
// {
// var list = db.SearchInfoContains("StationNo", StationNo).ToList();//判断是否有重复数据
// jsonStr = JSONTools.ScriptSerialize<List<tb_Station>>(list);
// }
// return jsonStr;
// }
// catch (Exception ex)
// {
// LogErrBLL.AddInfo(ex.ToString(),MethodBase.GetCurrentMethod());
// return "";
// }
//}
//public string GetComboboxDataByLine(string LineID)
//{
// try
// {
// string jsonStr = "[]";
// if (LineID == null || LineID == "")
// {
// var list = db.SearchAllInfo().ToList();//判断是否有重复数据
// jsonStr = JSONTools.ScriptSerialize<List<tb_Station>>(list);
// }
// else
// {
// var list = db.SearchInfoContains("LineID", LineID).ToList();//判断是否有重复数据
// jsonStr = JSONTools.ScriptSerialize<List<tb_Station>>(list);
// }
// return jsonStr;
// }
// catch (Exception)
// {
// return "";
// }
//}
//public DataTable SearchInfoByNo(string station)
//{
// StationDAL db = new StationDAL();
// try
// {
// return db.SearchInfoByNo(station);
// }
// catch (Exception ex)
// {
// LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
// return null;
// }
//}
//public List<tb_Station> SearchAll()
//{
// return db.SearchAllInfo();
//}
//public bool UpdateTime(DateTime time, string staionNo)
//{
// try
// {
// return da.UpdateTime(time, staionNo);
// }
// catch (Exception ex)
// {
// LogErrBLL.AddInfo(ex.ToString(),MethodBase.GetCurrentMethod());
// return false;
// }
//}
///// <summary>
///// 根据stationID 查询StationNo
///// </summary>
///// <param name="stationID"></param>
///// <returns></returns>
//public string SearchStationNameByID(string stationID)
//{
// return da.SearchStationNameByID(stationID);
//}
}
}

52
MESClassLibrary/BussinessHelper.cs

@ -0,0 +1,52 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MESClassLibrary
{
public class BussinessHelper
{
/// <summary>
/// 注塑打印机模板名称
/// </summary>
/// <param name="stationNo">工位编号</param>
/// <param name="isSupply">是否直供件0:非直供 1:直供</param>
/// <returns></returns>
public static string PrintMoudleName(string stationNo, string isSupply = "0")
{
if ("IM05,IM08,IM10".Contains(stationNo)) //二维小条码
{
return "单个条码2.grf";
}
else if ("IM06,IM07,IM09,IM11,IM12,".Contains(stationNo)) //一维条码
{
return "单个条码.grf";
}
else if ("IM01,IM02,IM03,IM04,IM15,IM18,IM20".Contains(stationNo)) //小米大条码
{
return "Sill.grf";
}
else if ("IM13,IM14".Contains(stationNo)) //直供条码
{
//return "单个条码1.grf";
if (isSupply == "0") //13,14机台,直供件打二维码 非直供件打一维码
{
return "单个条码.grf";
}
else
{
return "单个条码2.grf";
}
}
else
{
return "单个条码2.grf";
}
}
}
}

88
MESClassLibrary/DAL/BasicInfo/ForeignColorMapDAL.cs

@ -0,0 +1,88 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MESClassLibrary.BLL.Log;
using MESClassLibrary.Model;
using System.Data;
using System.Data.SqlClient;
using System.Reflection;
namespace MESClassLibrary.DAL.BasicInfo
{
public class ForeignColorMapDAL
{
public static string TableName = "tb_Station";
public DataTable SearchInfoByNo(string station)
{
try
{
string sql = @"SELECT s.*,l.LineName FROM dbo.tb_Station s
LEFT JOIN dbo.tb_Line l
ON l.LineID = s.LineID where StationNo=@StationNo";
SqlParameter[] param = new SqlParameter[1];
param[0] = new SqlParameter("@StationNo", SqlDbType.VarChar);
param[0].Value = station;
return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, param).Tables[0];
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return null;
}
}
public bool UpdateTime(DateTime time,string staionNo)
{
try
{
string sql = @"update " + TableName + " set PrintTime=@PrintTime where StationNo=@StationNo";
SqlParameter[] param = new SqlParameter[2];
param[0] = new SqlParameter("@PrintTime", SqlDbType.DateTime);
param[0].Value = time;
param[1] = new SqlParameter("@StationNo", SqlDbType.VarChar);
param[1].Value = staionNo;
SqlHelper.ExecuteNonQuery(SqlHelper.GetConnSting(), CommandType.Text, sql, param);
return true;
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return false;
}
}
public string SearchStationNameByID(string stationID)
{
try
{
string sql = @"SELECT * FROM dbo.tb_Station s
LEFT JOIN dbo.tb_Line l
ON l.LineID = s.LineID where StationID=@StationID";
SqlParameter[] param = new SqlParameter[1];
param[0] = new SqlParameter("@StationID", SqlDbType.VarChar);
param[0].Value = stationID;
DataTable dt = SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, param).Tables[0];
if (dt.Rows.Count > 0)
{
return dt.Rows[0]["StationNo"].ToString();
}
return null;
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return null;
}
}
}
}

1
MESClassLibrary/EFModel/BBMPT.Context.cs

@ -184,5 +184,6 @@ namespace MESClassLibrary.EFModel
public virtual DbSet<tb_ZPTagTest> tb_ZPTagTest { get; set; }
public virtual DbSet<test1> test1 { get; set; }
public virtual DbSet<View_1> View_1 { get; set; }
public virtual DbSet<tb_ForeignColorMap> tb_ForeignColorMapSet { get; set; }
}
}

23
MESClassLibrary/EFModel/tb_ForeignColorMap.cs

@ -0,0 +1,23 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码已从模板生成。
//
// 手动更改此文件可能导致应用程序出现意外的行为。
// 如果重新生成代码,将覆盖对此文件的手动更改。
// </auto-generated>
//------------------------------------------------------------------------------
namespace MESClassLibrary.EFModel
{
using System;
using System.Collections.Generic;
public partial class tb_ForeignColorMap
{
public int Id { get; set; }
public string TypeCode { get; set; }
public string PartCode { get; set; }
public string PartName { get; set; }
public string Color { get; set; }
}
}

5
MESClassLibrary/MESClassLibrary.csproj

@ -91,6 +91,7 @@
<Compile Include="BLL\BasicInfo\ProductColorBLL.cs" />
<Compile Include="BLL\BasicInfo\ProductOfInjectionBLL.cs" />
<Compile Include="BLL\BasicInfo\ProductTypeBLL.cs" />
<Compile Include="BLL\BasicInfo\ForeignColorMapBLL.cs" />
<Compile Include="BLL\BasicInfo\StationBLL.cs" />
<Compile Include="BLL\Check\InspectResultBLL.cs" />
<Compile Include="BLL\ExchangeCenter\GetNewTasksBLL.cs">
@ -183,6 +184,7 @@
<Compile Include="DAL\BasicInfo\ProductDAL.cs" />
<Compile Include="DAL\BasicInfo\ProductOfInjectionDAL.cs" />
<Compile Include="DAL\BasicInfo\ProductTypeDAL.cs" />
<Compile Include="DAL\BasicInfo\ForeignColorMapDAL.cs" />
<Compile Include="DAL\BasicInfo\StationDAL.cs" />
<Compile Include="DAL\Check\InspectResultDAL.cs" />
<Compile Include="DAL\DataTableExtend.cs" />
@ -403,6 +405,9 @@
<Compile Include="EFModel\tb_FinishProduct.cs">
<DependentUpon>BBMPT.tt</DependentUpon>
</Compile>
<Compile Include="EFModel\tb_ForeignColorMap.cs">
<DependentUpon>BBMPT.tt</DependentUpon>
</Compile>
<Compile Include="EFModel\tb_ImgVideo.cs">
<DependentUpon>BBMPT.tt</DependentUpon>
</Compile>

1
MESWebSite/HttpHandlers/ForeignColorMapHandler.ashx

@ -0,0 +1 @@
<%@ WebHandler Language="C#" CodeBehind="ForeignColorMapHandler.ashx.cs" Class="MESWebSite.HttpHandlers.StationHandler" %>

151
MESWebSite/HttpHandlers/ForeignColorMapHandler.ashx.cs

@ -0,0 +1,151 @@
using MESClassLibrary.BLL.BasicInfo;
using MESClassLibrary.EFModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace MESWebSite.HttpHandlers
{
/// <summary>
/// StationHandler 的摘要说明
/// </summary>
public class ForeignColorMapHandler : 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;
case "QueryForCombobox":
QueryForCombobox();
break;
case "QueryForComboboxByLineID":
QueryForComboboxByLineID();
break;
default:
break;
}
}
public bool IsReusable
{
get
{
return false;
}
}
void QueryList()
{
string page = Request.Params["page"];
string pagesize = Request.Params["rows"];
string PartCode = Request.Params["PartCode"];
string TypeCode = Request.Params["TypeCode"];
if (string.IsNullOrEmpty(page))
{
page = "0";
}
if (string.IsNullOrEmpty(pagesize))
{
pagesize = "15";
}
StationBLL bll = new StationBLL();
Response.Write(bll.SearchInfo(page, pagesize, StationNo, LineID));
Response.End();
}
void SaveInfo()
{
string StationID = Request.Params["StationID"];
string LineID = Request.Params["LineID"];
string StationNo = Request.Params["StationNo"];
string Des = Request.Params["Des"];
string time = Request.Params["time"];
StationBLL bll = new StationBLL();
tb_Station md = new tb_Station();
md.LineID = LineID;
md.StationNo = StationNo;
md.Des = Des;
md.ChangeMould = Convert.ToInt32(time);
var info = Request.Cookies.Get("LoginUserInfo");
if (info != null)
{
md.UserID = info["UserID"].ToUpper();
}
if (StationID == "0")
{
//新增
md.StationID = Guid.NewGuid().ToString();
Response.Write(bll.AddInfo(md) == true ? "true" : "false");
}
else
{
//修改
md.StationID = StationID;
Response.Write(bll.UpdateInfo(md) == true ? "true" : "false");
}
Response.End();
}
void DelInfo()
{
string StationID = Request.Params["StationID"];
StationBLL bll = new StationBLL();
tb_Station md = new tb_Station();
md.StationID = StationID;
var info = Request.Cookies.Get("LoginUserInfo");
if (info != null)
{
md.UserID = info["UserID"].ToUpper();
}
Response.Write(bll.DelInfo(md) == true ? "true" : "false");
Response.End();
}
void QueryForCombobox()
{
string StationNo = Request.Params["StationNo"];
StationBLL bll = new StationBLL();
Response.Write(bll.GetComboboxData(StationNo));
Response.End();
}
void QueryForComboboxByLineID()
{
string LineID = "68dd1857-5e78-43f9-a065-6be76335e7fe";
StationBLL bll = new StationBLL();
Response.Write(bll.GetComboboxDataByLine(LineID));
Response.End();
}
}
}

12
MESWebSite/MESWebSite.csproj

@ -155,6 +155,7 @@
<Content Include="Manage\Record_247.aspx" />
<Content Include="Manage\RepairRecord.aspx" />
<Content Include="Manage\RetrospectSearch.aspx" />
<Content Include="Manage\ForeignColorMap.aspx" />
<Content Include="Manage\StockIn.aspx" />
<Content Include="Manage\ZpBadInjectionSearch.aspx" />
<Content Include="Manage\ZPBom.aspx" />
@ -816,6 +817,7 @@
<Content Include="HttpHandlers\RetrospectSearchHandler.ashx" />
<Content Include="HttpHandlers\ChaimUpRecordHandler.ashx" />
<Content Include="HttpHandlers\ChaimDownRecordHandler.ashx" />
<Content Include="HttpHandlers\ForeignColorMapHandler.ashx" />
<None Include="Properties\PublishProfiles\BBMPT1.pubxml" />
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" />
<None Include="Properties\PublishProfiles\Web.config.pubxml" />
@ -1243,6 +1245,9 @@
<Compile Include="HttpHandlers\RetrospectSearchHandler.ashx.cs">
<DependentUpon>RetrospectSearchHandler.ashx</DependentUpon>
</Compile>
<Compile Include="HttpHandlers\ForeignColorMapHandler.ashx.cs">
<DependentUpon>ForeignColorMapHandler.ashx</DependentUpon>
</Compile>
<Compile Include="HttpHandlers\StationHandler.ashx.cs">
<DependentUpon>StationHandler.ashx</DependentUpon>
</Compile>
@ -1730,6 +1735,13 @@
<Compile Include="Manage\RetrospectSearch.aspx.designer.cs">
<DependentUpon>RetrospectSearch.aspx</DependentUpon>
</Compile>
<Compile Include="Manage\ForeignColorMap.aspx.cs">
<DependentUpon>ForeignColorMap.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Manage\ForeignColorMap.aspx.designer.cs">
<DependentUpon>ForeignColorMap.aspx</DependentUpon>
</Compile>
<Compile Include="Manage\Station.aspx.cs">
<DependentUpon>Station.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>

399
MESWebSite/Manage/ForeignColorMap.aspx

@ -0,0 +1,399 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ForeignColorMap.aspx.cs" Inherits="MESWebSite.Manage.ForeignColorMap" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="/CSS/Basics.css" rel="stylesheet" />
<link href="/Scripts/jquery-easyui-1.4.3/themes/metro/easyui.css" rel="stylesheet" type="text/css" />
<link href="/Scripts/jquery-easyui-1.4.3/themes/icon.css" rel="stylesheet" type="text/css" />
<link href="/Scripts/jquery-easyui-1.4.3/themes/color.css" rel="stylesheet" type="text/css" />
<script src="/Scripts/jquery-easyui-1.4.3/jquery.min.js" type="text/javascript"></script>
<script src="/Scripts/jquery-easyui-1.4.3/jquery.easyui.min.js" type="text/javascript"></script>
<script src="/Scripts/jquery-easyui-1.4.3/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
<script src="/Scripts/MyJs.js" type="text/javascript"></script>
<style>
#w td {
padding: 5px 5px;
text-align: left;
vertical-align: middle;
}
#w .title {
vertical-align: middle;
text-align: right;
width: 80px;
height: 40px;
}
p {
padding: 5px;
font-size: small;
font-family: 微软雅黑;
}
.datagrid {
text-align: center;
}
.search_first{
margin-left: 29%
}
/* 中等屏幕 桌面显示器 992至1400 */
@media screen and (min-width:992px) and (max-width:1400px){
.search_first{
margin-left: 1%
}
}
</style>
<title>工位信息</title>
</head>
<body>
<form id="form1" runat="server">
<div class="top">
<table style="width: 110%">
<tr style="display: flex;flex-direction: row; flex-wrap: wrap;" >
<td><span class="title" style="width: 100px">工位信息</span>
</td>
<td style="width: 235px;"></td>
<td style="width: 235px;">程序号:
<%-- <select id="fl_id_s" class="easyui-combobox" style="width: 160px; height: 30px;"
data-options="valueField: 'TypeCode',textField: 'LineName'">
</select>--%>
<input type="text" id="fl_id_s" style="width: 140px;" />
</td>
<td style="width: 235px;">零件号:
<input type="text" id="PartCode_s" style="width: 140px;" /></td>
<td style="width: "></td>
<td>
<td style="width: 80px" ><a class="topsearchBtn">查询</a></td>
<td style="width: 80px">
<a class="topaddBtn">新增</a>
</td>
<td style="width: 80px">
<a class="toppenBtn">编辑</a>
</td>
<td style="width: 80px">
<a class="topdelBtn">删除</a>
</td>
</td>
</tr>
</table>
</div>
<table id="tb" title="工位信息" style="width: 99%;">
</table>
<!-- 编辑窗口 -->
<div id="w" style="padding: 10px; visibility: hidden" title="编辑">
<table>
<tr>
<td class="title" style="width: 110px;">
<p>
程序号:
</p>
</td>
<td colspan="2">
<select id="fl_id" class="easyui-combobox" style="width: 234px; height: 36px;"
data-options="valueField: 'TypeCode',textField: 'LineName'">
</select><span style="color: red; font-size: 18px; vertical-align: middle;">*</span>
</td>
</tr>
<tr>
<td class="title" style="width: 110px;">
<p>
零件号:
</p>
</td>
<td colspan="2">
<input id="PartCode" type="text" class="text" style="width: 230px; height: 30px;" />
</td>
</tr>
<tr>
<td class="title" style="width: 110px;">
<p>
零件名称:
</p>
</td>
<td colspan="2">
<input id="PartName" type="text" class="text" style="width: 230px; height: 30px;" />
</td>
</tr>
<tr>
<td class="title" style="width: 110px;">
<p>
颜色:
</p>
</td>
<td colspan="2">
<input id="Color" type="text" class="text" style="width: 230px; height: 30px;" />
</td>
</tr>
</table>
</div>
<!-- 编辑窗口 - footer -->
<div id="ft" style="padding: 10px; text-align: center; background-color: #f9f9f9; visibility: hidden">
<a class="saveBtn" id="saveBtn">保存</a>
</div>
<div hidden="hidden">
<asp:Label ID="lblMessage" runat="server" Text=""></asp:Label>
</div>
<input id="UserID" type="text" hidden="hidden" runat="server" />
<script>
/**************** 全局变量 ***************/
var PrimaryID; //要编辑的id
var dg = $('#tb'); //表格
var isEdit = false; //是否为编辑状态
/**************** DOM加载 ***************/
$(function () {
$.ajaxSetup({
cache: false //关闭AJAX缓存
});
//下拉框加载
//reloadfl_ids();
//新增按钮点击
$('.topaddBtn').first().click(function () {
isEdit = false;
$('#w').window('open');
});
//编辑按钮点击
$('.toppenBtn').first().click(function () {
isEdit = true;
initEidtWidget();
});
//删除按钮
$('.topdelBtn').first().click(function () {
$.messager.confirm('提示框', '你确定要删除吗?', function (r) {
if (r) {
deleteInfos();
}
});
});
//搜索按钮
$('.topsearchBtn').first().click(function () {
SearchInfo();
});
//保存按钮
$('#saveBtn').bind('click', function () {
SaveInfo(isEdit);
});
//编辑窗口加载
$('#w').window({
modal: true,
closed: true,
minimizable: false,
maximizable: false,
collapsible: false,
width: 460,
height: 520,
footer: '#ft',
top: 20,
onBeforeClose: function () { clearw(); },
onBeforeOpen: function () {
$('#w').css('visibility', 'visible'); $('#ft').css('visibility', 'visible');
//reloadfl_id();
}
});
dg = $('#tb').datagrid({
fitColumns: true,
nowrap: false,
striped: true,
collapsible: false,
url: "/HttpHandlers/ForeignColorMapHandler.ashx?method=QueryList",
//sortName: 'sortNumber',
//sortOrder: 'asc',
remoteSort: false,
columns: [[
{ field: 'ID', title: 'ID', hidden: true },
{ field: 'TypeCode', title: '程序号', sortable: 'true', width: 10 },
{ field: 'PartCode', title: '零件号', sortable: 'true', width: 10 },
{ field: 'PartName', title: '零件名称', sortable: 'true', width: 30 },
{ field: 'Color', title: 'Color', sortable: 'true', width: 10 }
]],
pagination: true,//表示在datagrid设置分页
rownumbers: true,
singleSelect: true
});
dg.datagrid('getPager').pagination({
pageSize: 10,
pageNumber: 1,
pageList: [10, 20, 30, 40, 50],
beforePageText: '第',//页数文本框前显示的汉字
afterPageText: '页 共 {pages} 页',
displayMsg: '当前显示 {from} - {to} 条记录 共 {total} 条记录',
});
});
/**************** 主要业务程序 ***************/
//新增 / 编辑
function SaveInfo(isEdit) {
var ID = isEdit == true ? PrimaryID : 0;
var TypeCode = $('#fl_id').combo('getValue');
var PartCode = $('#PartCode_s').val();
var PartName = $('#PartName').val();
var Color = $('#Color').val();
if (TypeCode == "") {
$.messager.alert('提示', '程序号不能为空,请重新输入', 'warning');
return;
}
if (PartCode == "") {
$.messager.alert('提示', '零件号不能为空,请重新输入', 'warning');
return;
}
var r = /^\+?[1-9][0-9]*$/;  //正整数
if (!r.test(PartName)) {
$.messager.alert('提示', '换模时间必须为正整数,请重新输入', 'warning');
return;
}
var model = {
ID: ID,
TypeCode: TypeCode,
PartCode: PartCode,
PartName: PartName,
Color: Color,
method: 'SaveInfo'
};
SaveModel(model);
}
function SaveModel(model) {
$.ajax({
type: "POST",
async: false,
url: "/HttpHandlers/ForeignColorMapHandler.ashx",
data: model,
success: function (data) {
if (data == 'true') {
$.messager.alert('提示', '已保存', 'info');
dg.datagrid('reload');
$('#w').window('close');
}
else {
$.messager.alert('提示', '保存失败,请查看是否编号重复', 'warning');
}
},
error: function () {
}
});
}
//查询方法
function SearchInfo() {
var TypeCode = $('#fl_id_s').combo('getValue');
var PartCode = $('#PartCode_s').val();
var queryParams = {
TypeCode: TypeCode,
PartCode: PartCode
};
dg.datagrid({
queryParams: queryParams
});
dg.datagrid('reload');
}
//编辑时加载窗体数据
function initEidtWidget() {
var selRows = dg.datagrid('getSelections');
if (selRows.length > 1) {
$.messager.alert('提示', '每次只能编辑一条记录,请重新选取', 'warning');
return;
} else if (selRows.length == 0) {
$.messager.alert('提示', '请选择一条记录进行编辑', 'warning');
return;
}
//窗体数据初始化
var row = selRows[0];
PrimaryID = row.ID;
$('#fl_id').combobox('select', row.TypeCode);
$('#PartCode_s').val(row.PartCode);
$('#Color').val(row.Color);
$('#PartName').val(row.PartName);
$('#w').window('open');
}
//删除方法
function deleteInfos() {
var selRows = dg.datagrid('getSelections');
if (selRows.length > 1) {
$.messager.alert('提示', '每次只能删除一条记录,请重新选取', 'warning');
return;
} else if (selRows.length == 0) {
$.messager.alert('提示', '请选择一条记录进行删除', 'warning');
return;
}
var row = selRows[0];
var model = {
ID: row.ID,
method: 'DelInfo'
};
$.ajax({
url: "/HttpHandlers/ForeignColorMapHandler.ashx",
data: model,
async: false,
success: function (data) {
if (data == 'true') {
$.messager.alert('提示', '已删除', 'info');
dg.datagrid('reload');
}
else {
$.messager.alert('提示', '由于有关联数据,删除失败', 'warning');
}
},
error: function () {
}
});
}
/**************** 辅助业务程序 ***************/
/**********************************************/
/***************** 窗体程序 *******************/
/**********************************************/
//编辑窗口关闭清空数据
function clearw() {
$('#fl_id').combo('clear');
$('#PartCode_s').val('');
$('#PartName').val('');
$('#Color').val('');
}
function reloadfl_id() {
$('#fl_id').combobox('reload', '/HttpHandlers/LineHandler.ashx?method=QueryForCombobox');
}
//function reloadfl_ids() {
// $('#fl_id_s').combobox('reload', '/HttpHandlers/LineHandler.ashx?method=QueryForCombobox');
//}
</script>
</form>
</body>
</html>

20
MESWebSite/Manage/ForeignColorMap.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 ForeignColorMap : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Request.Cookies["LoginUserInfo"] == null)
{
Response.Write("<script language=javascript>alert('您的登录信息已过期,请重新登录!');top.location.href='../Login.aspx';</script>");
}
}
}
}

44
MESWebSite/Manage/ForeignColorMap.aspx.designer.cs

@ -0,0 +1,44 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace MESWebSite.Manage
{
public partial class ForeignColorMap
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// lblMessage 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblMessage;
/// <summary>
/// UserID 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlInputText UserID;
}
}

3
PaintingPC/Function.cs

@ -1879,7 +1879,8 @@ namespace PaintingPC
}
if (!string.IsNullOrEmpty(typeCode) && paintCode.ToLower() != "na")
{
string sqlmap = @"select * from tb_ForeignColorMap where TypeCode='" + typeCode + @"'";
string stockNo1 = barcode.Substring(0, 10);
string sqlmap = @"select * from tb_ForeignColorMap where TypeCode='" + typeCode + @"' and StockNo='"+ stockNo1 + "'";
DataTable mapTable = SqlHelper.GetDataDateTable(SqlHelper.SqlConnString, CommandType.Text, sqlmap, null);
if(mapTable.Rows.Count > 0)

2
WebService/WMSWebService.asmx.cs

@ -94,7 +94,7 @@ namespace Webservice
/// 喷涂报废接口
/// </summary>
/// <param name="barcode">条码号:A2048856739-P.190605.0008(二维码)</param>
/// <param name="isOK">0-不合格;1-合格;9-返喷 8-其他 </param>
/// <param name="isOK">1 合格 ,0点修, 2报废, 9返喷 ,4喷涂其他,5 物流其他 </param>
[WebMethod]
[ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)]
public bool WMSSprayingForCS(string barcode, int isOK, out string errorReason)

Loading…
Cancel
Save