Browse Source

web端, 老外库底漆件与颜色绑定配置

master
ruoxing.wang 1 day ago
parent
commit
d90d972a77
  1. 88
      FacOneZPStation/FrmZP.Designer.cs
  2. 277
      MESClassLibrary/BLL/BasicInfo/ForeignColorMapBLL.cs
  3. 115
      MESClassLibrary/BLL/Painting/ForeignColorMapBLL.cs
  4. 592
      MESClassLibrary/DAL/painting/ForeignColorMapDAL.cs
  5. 3
      MESClassLibrary/MESClassLibrary.csproj
  6. 18
      MESClassLibrary/Model/ForeignColorMapModel.cs
  7. 1
      MESWebSite/HttpHandlers/ForeignColorMapHandler.ashx
  8. 171
      MESWebSite/HttpHandlers/ForeignColorMapHandler.ashx.cs
  9. 12
      MESWebSite/MESWebSite.csproj
  10. 423
      MESWebSite/Manage/ForeignColorMap.aspx
  11. 20
      MESWebSite/Manage/ForeignColorMap.aspx.cs
  12. 44
      MESWebSite/Manage/ForeignColorMap.aspx.designer.cs
  13. 20
      MESWebSite/Manage/Station.aspx.designer.cs

88
FacOneZPStation/FrmZP.Designer.cs

@ -77,7 +77,7 @@
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.51529F));
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.62445F));
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 32.86026F));
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 791F));
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 792F));
this.tableLayoutPanel3.Controls.Add(this.button6, 3, 0);
this.tableLayoutPanel3.Controls.Add(this.button1, 0, 1);
this.tableLayoutPanel3.Controls.Add(this.button5, 2, 1);
@ -102,10 +102,10 @@
this.button6.Dock = System.Windows.Forms.DockStyle.Fill;
this.button6.Font = new System.Drawing.Font("黑体", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button6.ForeColor = System.Drawing.Color.Black;
this.button6.Location = new System.Drawing.Point(1768, 14);
this.button6.Location = new System.Drawing.Point(1766, 14);
this.button6.Margin = new System.Windows.Forms.Padding(14);
this.button6.Name = "button6";
this.button6.Size = new System.Drawing.Size(764, 183);
this.button6.Size = new System.Drawing.Size(766, 183);
this.button6.TabIndex = 7;
this.button6.Text = "手动打印箱单";
this.button6.UseVisualStyleBackColor = false;
@ -119,7 +119,7 @@
this.button1.Location = new System.Drawing.Point(7, 217);
this.button1.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(574, 200);
this.button1.Size = new System.Drawing.Size(573, 200);
this.button1.TabIndex = 6;
this.button1.Text = "打印标签";
this.button1.UseVisualStyleBackColor = false;
@ -131,7 +131,7 @@
this.button5.Dock = System.Windows.Forms.DockStyle.Fill;
this.button5.Font = new System.Drawing.Font("黑体", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button5.ForeColor = System.Drawing.Color.Black;
this.button5.Location = new System.Drawing.Point(1192, 225);
this.button5.Location = new System.Drawing.Point(1190, 225);
this.button5.Margin = new System.Windows.Forms.Padding(14);
this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(548, 184);
@ -145,10 +145,10 @@
this.button4.BackColor = System.Drawing.Color.RoyalBlue;
this.button4.Dock = System.Windows.Forms.DockStyle.Fill;
this.button4.Font = new System.Drawing.Font("黑体", 16F);
this.button4.Location = new System.Drawing.Point(595, 6);
this.button4.Location = new System.Drawing.Point(594, 6);
this.button4.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(576, 199);
this.button4.Size = new System.Drawing.Size(575, 199);
this.button4.TabIndex = 4;
this.button4.Text = "下一计划";
this.button4.UseVisualStyleBackColor = false;
@ -162,7 +162,7 @@
this.button3.Location = new System.Drawing.Point(7, 6);
this.button3.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(574, 199);
this.button3.Size = new System.Drawing.Size(573, 199);
this.button3.TabIndex = 3;
this.button3.Text = "上一计划";
this.button3.UseVisualStyleBackColor = false;
@ -174,10 +174,10 @@
this.button2.Dock = System.Windows.Forms.DockStyle.Fill;
this.button2.Font = new System.Drawing.Font("黑体", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.button2.ForeColor = System.Drawing.Color.Black;
this.button2.Location = new System.Drawing.Point(602, 225);
this.button2.Location = new System.Drawing.Point(601, 225);
this.button2.Margin = new System.Windows.Forms.Padding(14);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(562, 184);
this.button2.Size = new System.Drawing.Size(561, 184);
this.button2.TabIndex = 2;
this.button2.Text = "补打标签";
this.button2.UseVisualStyleBackColor = false;
@ -188,10 +188,10 @@
this.button7.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128)))));
this.button7.Dock = System.Windows.Forms.DockStyle.Fill;
this.button7.Font = new System.Drawing.Font("黑体", 16F);
this.button7.Location = new System.Drawing.Point(1761, 217);
this.button7.Location = new System.Drawing.Point(1759, 217);
this.button7.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6);
this.button7.Name = "button7";
this.button7.Size = new System.Drawing.Size(778, 200);
this.button7.Size = new System.Drawing.Size(780, 200);
this.button7.TabIndex = 8;
this.button7.Text = "补打箱单";
this.button7.UseVisualStyleBackColor = false;
@ -203,7 +203,7 @@
this.label7.Dock = System.Windows.Forms.DockStyle.Fill;
this.label7.Font = new System.Drawing.Font("黑体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label7.ForeColor = System.Drawing.Color.White;
this.label7.Location = new System.Drawing.Point(1408, 3);
this.label7.Location = new System.Drawing.Point(1406, 3);
this.label7.Margin = new System.Windows.Forms.Padding(2);
this.label7.Name = "label7";
this.tableLayoutPanel4.SetRowSpan(this.label7, 2);
@ -215,10 +215,10 @@
//
this.textBox2.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBox2.Font = new System.Drawing.Font("黑体", 26.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.textBox2.Location = new System.Drawing.Point(406, 127);
this.textBox2.Location = new System.Drawing.Point(405, 127);
this.textBox2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(995, 87);
this.textBox2.Size = new System.Drawing.Size(994, 87);
this.textBox2.TabIndex = 30;
this.textBox2.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox2_KeyDown);
//
@ -230,7 +230,7 @@
this.label3.Location = new System.Drawing.Point(5, 122);
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(392, 124);
this.label3.Size = new System.Drawing.Size(391, 124);
this.label3.TabIndex = 29;
this.label3.Text = "扫描物料条码";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@ -240,10 +240,10 @@
this.labOrderNo.Dock = System.Windows.Forms.DockStyle.Fill;
this.labOrderNo.Font = new System.Drawing.Font("黑体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.labOrderNo.ForeColor = System.Drawing.Color.White;
this.labOrderNo.Location = new System.Drawing.Point(1685, 249);
this.labOrderNo.Location = new System.Drawing.Point(1683, 249);
this.labOrderNo.Margin = new System.Windows.Forms.Padding(2);
this.labOrderNo.Name = "labOrderNo";
this.labOrderNo.Size = new System.Drawing.Size(864, 174);
this.labOrderNo.Size = new System.Drawing.Size(866, 174);
this.labOrderNo.TabIndex = 28;
this.labOrderNo.Text = "A64654646464";
this.labOrderNo.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@ -254,7 +254,7 @@
this.label4.Dock = System.Windows.Forms.DockStyle.Fill;
this.label4.Font = new System.Drawing.Font("黑体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label4.ForeColor = System.Drawing.Color.White;
this.label4.Location = new System.Drawing.Point(1408, 249);
this.label4.Location = new System.Drawing.Point(1406, 249);
this.label4.Margin = new System.Windows.Forms.Padding(2);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(272, 174);
@ -268,10 +268,10 @@
this.labStationNo.Dock = System.Windows.Forms.DockStyle.Fill;
this.labStationNo.Font = new System.Drawing.Font("黑体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.labStationNo.ForeColor = System.Drawing.Color.White;
this.labStationNo.Location = new System.Drawing.Point(404, 249);
this.labStationNo.Location = new System.Drawing.Point(403, 249);
this.labStationNo.Margin = new System.Windows.Forms.Padding(2);
this.labStationNo.Name = "labStationNo";
this.labStationNo.Size = new System.Drawing.Size(999, 174);
this.labStationNo.Size = new System.Drawing.Size(998, 174);
this.labStationNo.TabIndex = 26;
this.labStationNo.Text = "V253-MF-S后保下部延伸焊接";
this.labStationNo.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@ -285,7 +285,7 @@
this.label2.Location = new System.Drawing.Point(3, 249);
this.label2.Margin = new System.Windows.Forms.Padding(2);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(396, 174);
this.label2.Size = new System.Drawing.Size(395, 174);
this.label2.TabIndex = 25;
this.label2.Text = "工位名称";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@ -295,10 +295,10 @@
this.labPName.Dock = System.Windows.Forms.DockStyle.Fill;
this.labPName.Font = new System.Drawing.Font("黑体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.labPName.ForeColor = System.Drawing.Color.White;
this.labPName.Location = new System.Drawing.Point(1685, 428);
this.labPName.Location = new System.Drawing.Point(1683, 428);
this.labPName.Margin = new System.Windows.Forms.Padding(2);
this.labPName.Name = "labPName";
this.labPName.Size = new System.Drawing.Size(864, 284);
this.labPName.Size = new System.Drawing.Size(866, 284);
this.labPName.TabIndex = 24;
this.labPName.Text = "MF253 MF S后保";
this.labPName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@ -309,7 +309,7 @@
this.label8.Dock = System.Windows.Forms.DockStyle.Fill;
this.label8.Font = new System.Drawing.Font("黑体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label8.ForeColor = System.Drawing.Color.White;
this.label8.Location = new System.Drawing.Point(1408, 428);
this.label8.Location = new System.Drawing.Point(1406, 428);
this.label8.Margin = new System.Windows.Forms.Padding(2);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(272, 284);
@ -323,10 +323,10 @@
this.labPartNo.Dock = System.Windows.Forms.DockStyle.Fill;
this.labPartNo.Font = new System.Drawing.Font("黑体", 42F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.labPartNo.ForeColor = System.Drawing.Color.White;
this.labPartNo.Location = new System.Drawing.Point(404, 428);
this.labPartNo.Location = new System.Drawing.Point(403, 428);
this.labPartNo.Margin = new System.Windows.Forms.Padding(2);
this.labPartNo.Name = "labPartNo";
this.labPartNo.Size = new System.Drawing.Size(999, 284);
this.labPartNo.Size = new System.Drawing.Size(998, 284);
this.labPartNo.TabIndex = 22;
this.labPartNo.Text = "A2530822665";
this.labPartNo.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@ -345,7 +345,7 @@
this.label6.Location = new System.Drawing.Point(3, 428);
this.label6.Margin = new System.Windows.Forms.Padding(2);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(396, 284);
this.label6.Size = new System.Drawing.Size(395, 284);
this.label6.TabIndex = 21;
this.label6.Text = "产品代码";
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@ -356,10 +356,10 @@
this.labBadCount.Dock = System.Windows.Forms.DockStyle.Fill;
this.labBadCount.Font = new System.Drawing.Font("黑体", 60F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.labBadCount.ForeColor = System.Drawing.Color.Lime;
this.labBadCount.Location = new System.Drawing.Point(1685, 717);
this.labBadCount.Location = new System.Drawing.Point(1683, 717);
this.labBadCount.Margin = new System.Windows.Forms.Padding(2);
this.labBadCount.Name = "labBadCount";
this.labBadCount.Size = new System.Drawing.Size(864, 515);
this.labBadCount.Size = new System.Drawing.Size(866, 515);
this.labBadCount.TabIndex = 20;
this.labBadCount.Text = "0";
this.labBadCount.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@ -370,10 +370,10 @@
this.labNum.Dock = System.Windows.Forms.DockStyle.Fill;
this.labNum.Font = new System.Drawing.Font("黑体", 60F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.labNum.ForeColor = System.Drawing.Color.Lime;
this.labNum.Location = new System.Drawing.Point(404, 717);
this.labNum.Location = new System.Drawing.Point(403, 717);
this.labNum.Margin = new System.Windows.Forms.Padding(2);
this.labNum.Name = "labNum";
this.labNum.Size = new System.Drawing.Size(999, 515);
this.labNum.Size = new System.Drawing.Size(998, 515);
this.labNum.TabIndex = 18;
this.labNum.Text = "152/210";
this.labNum.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@ -387,7 +387,7 @@
this.label10.Location = new System.Drawing.Point(3, 717);
this.label10.Margin = new System.Windows.Forms.Padding(2);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(396, 515);
this.label10.Size = new System.Drawing.Size(395, 515);
this.label10.TabIndex = 17;
this.label10.Text = "计划/完成数";
this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@ -400,7 +400,7 @@
this.label14.Location = new System.Drawing.Point(5, 1);
this.label14.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label14.Name = "label14";
this.label14.Size = new System.Drawing.Size(392, 120);
this.label14.Size = new System.Drawing.Size(391, 120);
this.label14.TabIndex = 12;
this.label14.Text = "扫描本体条码";
this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@ -409,10 +409,10 @@
//
this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.textBox1.Font = new System.Drawing.Font("黑体", 26.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.textBox1.Location = new System.Drawing.Point(406, 6);
this.textBox1.Location = new System.Drawing.Point(405, 6);
this.textBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(995, 87);
this.textBox1.Size = new System.Drawing.Size(994, 87);
this.textBox1.TabIndex = 13;
this.textBox1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox1_KeyDown);
//
@ -421,11 +421,11 @@
this.labErrMessage.Dock = System.Windows.Forms.DockStyle.Fill;
this.labErrMessage.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.labErrMessage.ForeColor = System.Drawing.Color.Red;
this.labErrMessage.Location = new System.Drawing.Point(1687, 1);
this.labErrMessage.Location = new System.Drawing.Point(1685, 1);
this.labErrMessage.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.labErrMessage.Name = "labErrMessage";
this.tableLayoutPanel4.SetRowSpan(this.labErrMessage, 2);
this.labErrMessage.Size = new System.Drawing.Size(860, 245);
this.labErrMessage.Size = new System.Drawing.Size(862, 245);
this.labErrMessage.TabIndex = 16;
this.labErrMessage.Text = "条码与产品不匹配,重新扫描";
this.labErrMessage.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@ -438,7 +438,7 @@
this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 28.52292F));
this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 71.47708F));
this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 276F));
this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 867F));
this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 869F));
this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 40F));
this.tableLayoutPanel4.Controls.Add(this.label7, 2, 0);
this.tableLayoutPanel4.Controls.Add(this.textBox2, 1, 1);
@ -478,7 +478,7 @@
this.label12.Dock = System.Windows.Forms.DockStyle.Fill;
this.label12.Font = new System.Drawing.Font("黑体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label12.ForeColor = System.Drawing.Color.White;
this.label12.Location = new System.Drawing.Point(1408, 717);
this.label12.Location = new System.Drawing.Point(1406, 717);
this.label12.Margin = new System.Windows.Forms.Padding(2);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(272, 515);
@ -491,10 +491,10 @@
this.labTime.BackColor = System.Drawing.Color.Transparent;
this.labTime.Dock = System.Windows.Forms.DockStyle.Fill;
this.labTime.Font = new System.Drawing.Font("微软雅黑", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.labTime.Location = new System.Drawing.Point(1909, 0);
this.labTime.Location = new System.Drawing.Point(1908, 0);
this.labTime.Margin = new System.Windows.Forms.Padding(0);
this.labTime.Name = "labTime";
this.labTime.Size = new System.Drawing.Size(651, 149);
this.labTime.Size = new System.Drawing.Size(652, 149);
this.labTime.TabIndex = 7;
this.labTime.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.labTime.Click += new System.EventHandler(this.labTime_Click);
@ -521,7 +521,7 @@
this.label1.Location = new System.Drawing.Point(345, 0);
this.label1.Margin = new System.Windows.Forms.Padding(0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(1564, 149);
this.label1.Size = new System.Drawing.Size(1563, 149);
this.label1.TabIndex = 1;
this.label1.Text = "装配工位信息看板";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
@ -532,7 +532,7 @@
this.tableLayoutPanel2.ColumnCount = 3;
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 18.10651F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 81.89349F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 650F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 651F));
this.tableLayoutPanel2.Controls.Add(this.labTime, 2, 0);
this.tableLayoutPanel2.Controls.Add(this.pictureBox1, 0, 0);
this.tableLayoutPanel2.Controls.Add(this.label1, 1, 0);

277
MESClassLibrary/BLL/BasicInfo/ForeignColorMapBLL.cs

@ -15,143 +15,146 @@ 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;
// }
//}
BasicBLL<tb_ForeignColorMap> db = new BasicBLL<tb_ForeignColorMap>();
ForeignColorMapDAL da = new ForeignColorMapDAL();
/// <summary>
/// 查询信息
/// </summary>
/// <returns></returns>
public string SearchInfo(string page, string pagesize, string TypeCode, string PartCode)
{
try
{
string jsonStr = "[]";
int total = 0;//总行数
List<tb_ForeignColorMap> list = db.SearchAllInfo();
if (!String.IsNullOrEmpty(TypeCode))
{
list = list.Where(p => p.TypeCode == TypeCode).ToList();//按条件分页查询
}
if (!String.IsNullOrEmpty(PartCode))
{
list = list.Where(p => p.PartCode.Contains(PartCode)).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<ForeignColorMapModel> StationList = new List<ForeignColorMapModel>();
//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<List<tb_ForeignColorMap>>(list);
}
return jsonStr;
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return "";
}
}
/// <summary>
/// 添加信息
/// </summary>
/// <param name="md">生产线模型对象</param>
/// <returns></returns>
public bool AddInfo(tb_ForeignColorMap md)
{
try
{
var list = db.SearchInfoByKey("TypeCode", md.TypeCode);//判断是否有重复数据
if (list.Count>0)
{
if (list.Where(p => p.ID != md.ID && p.PartCode == md.PartCode).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_ForeignColorMap md)
{
try
{
var list = db.SearchAllInfo().Where(p => p.TypeCode == md.TypeCode && p.PartCode == md.PartCode && p.ID != md.ID).ToList();//判断是否有重复数据
if (list.Count > 0)
{
return false;
}
//初始化要更新的字段
string[] proNames = new string[5];
proNames[0] = "TypeCode";
proNames[1] = "PartCode";
proNames[2] = "PartName";
proNames[3] = "Color";
proNames[4] = "StockNo";
//必填字段初始化,如果不需要更新必填字段则设置为空即可,时间类型无需初始化
//如果没有初始化必填字段,更新会报错
//md.Des = "";
return db.UpdateInfo(md, proNames);
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return false;
}
}
/// 删除生产线信息
public bool DelInfo(tb_ForeignColorMap md)
{
try
{
return db.DelInfo(md);
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return false;
}
}
//public string GetComboboxData(string StationNo)
//{

115
MESClassLibrary/BLL/Painting/ForeignColorMapBLL.cs

@ -0,0 +1,115 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using MESClassLibrary.BLL.Log;
using MESClassLibrary.DAL;
using MESClassLibrary.DAL.painting;
namespace MESClassLibrary.BLL.Painting
{
public class ForeignColorMapBLL
{
public DataTable SearchInfoA()
{
ForeignColorMapDAL da = new ForeignColorMapDAL();
try
{
return da.SearchInfoA();
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return null;
}
}
public DataTable SearchInfoB()
{
ForeignColorMapDAL da = new ForeignColorMapDAL();
try
{
return da.SearchInfoB();
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return null;
}
}
public DataTable SearchInfoBByA()
{
ForeignColorMapDAL da = new ForeignColorMapDAL();
try
{
return da.SearchInfoBByA();
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return null;
}
}
public DataTable SearchInfoAByB()
{
ForeignColorMapDAL da = new ForeignColorMapDAL();
try
{
return da.SearchInfoAByB();
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return null;
}
}
public DataTable SearchDetailA()
{
ForeignColorMapDAL da = new ForeignColorMapDAL();
try
{
return da.SearchDetailA();
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return null;
}
}
public DataTable SearchDetailB()
{
ForeignColorMapDAL da = new ForeignColorMapDAL();
try
{
return da.SearchDetailB();
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return null;
}
}
public DataTable SearchColorByBarCode(string barcode)
{
try
{
ForeignColorMapDAL da = new ForeignColorMapDAL();
return da.SearchColorByBarCode(barcode);
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return null;
}
}
}
}

592
MESClassLibrary/DAL/painting/ForeignColorMapDAL.cs

@ -0,0 +1,592 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using MESClassLibrary.BLL.Log;
namespace MESClassLibrary.DAL.painting
{
public class ForeignColorMapDAL
{
public DataTable SearchInfoA()
{
try
{
string sql = @"DECLARE @barcode nvarchar(100),
@productInfo nvarchar(100),
@createTime dateTime
IF OBJECT_ID('TEMPDB..#a') IS NOT NULL
DROP TABLE #a
create table #a (BarCode nvarchar(100),productInfo nvarchar(100),createTime dateTime)
--truncate table #c
DECLARE cursor_name CURSOR FOR --
SELECT barcode,CreateTime FROM dbo.tb_StockIn WHERE createTime BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:30:01') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:00') AND pass=1
ORDER BY createTime DESC
OPEN cursor_name --
FETCH NEXT FROM cursor_name INTO @barcode ,@createTime --
WHILE @@FETCH_STATUS = 0
BEGIN
SELECT TOP 1 @productInfo=productInfo FROM dbo.tb_InspectResult WHERE barcode=@barcode ORDER BY createTime DESC
insert into #a(BarCode,ProductInfo,CreateTime) values(@barcode,@productInfo,@createTime)
FETCH NEXT FROM cursor_name INTO @barcode,@createTime
END
CLOSE cursor_name --
DEALLOCATE cursor_name --
SELECT COUNT(*) AS c1 ,
(SELECT COUNT(*) FROM #a WHERE productInfo LIKE '%%' ) c2
FROM #a WHERE productInfo LIKE '%%'";
// SqlHelper.ExecuteNonQuery(SqlHelper.GetConnSting(), CommandType.Text, sql1, null);
// string sql = @"SELECT COUNT(*) AS c1 ,
// (SELECT COUNT(*) FROM #c WHERE productInfo LIKE '%槛%' ) c2
// FROM #c WHERE productInfo LIKE '%保%' ";
// string sql = @"select count(*) as c1 ,
// (select count(*) from view_stockin where ([createtime] between convert(datetime,substring(convert(nvarchar(50),getdate(),120),1,10)+ ' 07:30:01') and convert(datetime,substring(convert(nvarchar(50),getdate(),120),1,10)+ ' 19:30:00')) and productinfo like '%槛%' and pass=1) c2
// from view_stockin where ([createtime] between convert(datetime,substring(convert(nvarchar(50),getdate(),120),1,10)+ ' 07:30:01') and convert(datetime,substring(convert(nvarchar(50),getdate(),120),1,10)+ ' 19:30:00')) and productinfo like '%保%' and pass=1 ";
return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, null).Tables[0];
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return null;
}
}
public DataTable SearchInfoB()
{
try
{
string sql = "";
if (DateTime.Now > DateTime.Parse(DateTime.Now.ToShortDateString() + " 19:30:00") && DateTime.Now < DateTime.Parse(DateTime.Now.ToShortDateString() + " 23:59:59"))
{
sql = @"DECLARE @barcode nvarchar(100),
@productInfo nvarchar(100),
@createTime dateTime
IF OBJECT_ID('TEMPDB..#c') IS NOT NULL
DROP TABLE #c
create table #c (BarCode nvarchar(100),productInfo nvarchar(100),createTime dateTime)
--truncate table #c
DECLARE cursor_name CURSOR FOR --
SELECT barcode,CreateTime FROM dbo.tb_StockIn WHERE createTime BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:01') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:59:59') AND pass=1
ORDER BY createTime DESC
OPEN cursor_name --
FETCH NEXT FROM cursor_name INTO @barcode ,@createTime --
WHILE @@FETCH_STATUS = 0
BEGIN
SELECT TOP 1 @productInfo=productInfo FROM dbo.tb_InspectResult WHERE barcode=@barcode ORDER BY createTime DESC
insert into #c(BarCode,ProductInfo,CreateTime) values(@barcode,@productInfo,@createTime)
--PRINT 'ID'+@productInfo
FETCH NEXT FROM cursor_name INTO @barcode,@createTime
END
CLOSE cursor_name --
DEALLOCATE cursor_name --
SELECT COUNT(*) AS c1 ,
(SELECT COUNT(*) FROM #c WHERE productInfo LIKE '%%' ) c2
FROM #c WHERE productInfo LIKE '%%'";
// sql = @"SELECT COUNT(*) AS c1 ,
// (SELECT COUNT(*) FROM View_StockIn WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:01') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:59:59')) AND productInfo LIKE '%槛%' and pass=1) c2
// FROM View_StockIn WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:01') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:59:59')) AND productInfo LIKE '%保%' and pass=1";
}
if (DateTime.Now > DateTime.Parse(DateTime.Now.ToShortDateString() + " 00:00:00") && DateTime.Now < DateTime.Parse(DateTime.Now.ToShortDateString() + " 07:30:00"))
{
sql = @"DECLARE @barcode nvarchar(100),
@productInfo nvarchar(100),
@createTime dateTime
IF OBJECT_ID('TEMPDB..#c') IS NOT NULL
DROP TABLE #c
create table #c (BarCode nvarchar(100),productInfo nvarchar(100),createTime dateTime)
--truncate table #c
DECLARE cursor_name CURSOR FOR --
SELECT barcode,CreateTime FROM dbo.tb_StockIn WHERE createTime BETWEEN DATEADD(day,-1, CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:01')) AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:30:00') AND pass=1
ORDER BY createTime DESC
OPEN cursor_name --
FETCH NEXT FROM cursor_name INTO @barcode ,@createTime --
WHILE @@FETCH_STATUS = 0
BEGIN
SELECT TOP 1 @productInfo=productInfo FROM dbo.tb_InspectResult WHERE barcode=@barcode ORDER BY createTime DESC
insert into #c(BarCode,ProductInfo,CreateTime) values(@barcode,@productInfo,@createTime)
--PRINT 'ID'+@productInfo
FETCH NEXT FROM cursor_name INTO @barcode,@createTime
END
CLOSE cursor_name --
DEALLOCATE cursor_name --
SELECT COUNT(*) AS c1 ,
(SELECT COUNT(*) FROM #c WHERE productInfo LIKE '%%' ) c2
FROM #c WHERE productInfo LIKE '%%'";
// sql = @"SELECT COUNT(*) AS c1 ,
// (SELECT COUNT(*) FROM View_StockIn WHERE ([createTime] BETWEEN DATEADD(day,-1, CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:01')) AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:30:00')) AND productInfo LIKE '%槛%' and pass=1) c2
// FROM View_StockIn WHERE ([createTime] BETWEEN DATEADD(day,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:01')) AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:59:59')) AND productInfo LIKE '%保%' and pass=1";
}
return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, null).Tables[0];
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return null;
}
}
public DataTable SearchInfoAByB()
{
try
{
string sql = "";
if (DateTime.Now > DateTime.Parse(DateTime.Now.ToShortDateString() + " 19:30:00") && DateTime.Now <= DateTime.Parse(DateTime.Now.ToShortDateString() + " 23:59:59"))
{
sql = @"DECLARE @barcode nvarchar(100),
@productInfo nvarchar(100),
@createTime dateTime
IF OBJECT_ID('TEMPDB..#d') IS NOT NULL
DROP TABLE #d
create table #d (BarCode nvarchar(100),productInfo nvarchar(100),createTime dateTime)
--truncate table #c
DECLARE cursor_name CURSOR FOR --
SELECT barcode,CreateTime FROM dbo.tb_StockIn WHERE createTime BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:30:01') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:00') AND pass=1
ORDER BY createTime DESC
OPEN cursor_name --
FETCH NEXT FROM cursor_name INTO @barcode ,@createTime --
WHILE @@FETCH_STATUS = 0
BEGIN
SELECT TOP 1 @productInfo=productInfo FROM dbo.tb_InspectResult WHERE barcode=@barcode ORDER BY createTime DESC
insert into #d(BarCode,ProductInfo,CreateTime) values(@barcode,@productInfo,@createTime)
--PRINT 'ID'+@productInfo
FETCH NEXT FROM cursor_name INTO @barcode,@createTime
END
CLOSE cursor_name --
DEALLOCATE cursor_name --
SELECT COUNT(*) AS c1 ,
(SELECT COUNT(*) FROM #d WHERE productInfo LIKE '%%' ) c2
FROM #d WHERE productInfo LIKE '%%'";
// sql = @"SELECT COUNT(*) AS c1 ,
// (SELECT COUNT(*) FROM View_StockIn WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:30:01') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:00')) AND productInfo LIKE '%槛%' and pass=1) c2
// FROM View_StockIn WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:30:01') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:00')) AND productInfo LIKE '%保%' and pass=1";
}
if (DateTime.Now > DateTime.Parse(DateTime.Now.ToShortDateString() + " 00:00:00") && DateTime.Now < DateTime.Parse(DateTime.Now.ToShortDateString() + " 07:30:00"))
{
sql = @"DECLARE @barcode nvarchar(100),
@productInfo nvarchar(100),
@createTime dateTime
IF OBJECT_ID('TEMPDB..#d') IS NOT NULL
DROP TABLE #d
create table #d (BarCode nvarchar(100),productInfo nvarchar(100),createTime dateTime)
--truncate table #c
DECLARE cursor_name CURSOR FOR --
SELECT barcode,CreateTime FROM dbo.tb_StockIn WHERE createTime BETWEEN DATEADD(day,-1, CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:30:01')) AND DATEADD(day,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:00')) AND pass=1
ORDER BY createTime DESC
OPEN cursor_name --
FETCH NEXT FROM cursor_name INTO @barcode ,@createTime --
WHILE @@FETCH_STATUS = 0
BEGIN
SELECT TOP 1 @productInfo=productInfo FROM dbo.tb_InspectResult WHERE barcode=@barcode ORDER BY createTime DESC
insert into #d(BarCode,ProductInfo,CreateTime) values(@barcode,@productInfo,@createTime)
--PRINT 'ID'+@productInfo
FETCH NEXT FROM cursor_name INTO @barcode,@createTime
END
CLOSE cursor_name --
DEALLOCATE cursor_name --
SELECT COUNT(*) AS c1 ,
(SELECT COUNT(*) FROM #d WHERE productInfo LIKE '%%' ) c2
FROM #d WHERE productInfo LIKE '%%'";
// sql = @"SELECT COUNT(*) AS c1 ,
// (SELECT COUNT(*) FROM View_StockIn WHERE ([createTime] BETWEEN DATEADD(day,-1, CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:30:01')) AND DATEADD(day,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:00'))) AND productInfo LIKE '%槛%' and pass=1) c2
// FROM View_StockIn WHERE ([createTime] BETWEEN DATEADD(day,-1, CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:30:01')) AND DATEADD(day,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:00'))) AND productInfo LIKE '%保%' and pass=1 ";
}
return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, null).Tables[0];
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return null;
}
}
public DataTable SearchInfoBByA()
{
try
{
string sql = "";
sql = @"DECLARE @barcode nvarchar(100),
@productInfo nvarchar(100),
@createTime dateTime
IF OBJECT_ID('TEMPDB..#b') IS NOT NULL
DROP TABLE #b
create table #b (BarCode nvarchar(100),productInfo nvarchar(100),createTime dateTime)
--truncate table #c
DECLARE cursor_name CURSOR FOR --
SELECT barcode,CreateTime FROM dbo.tb_StockIn WHERE createTime BETWEEN DATEADD(day,-1, CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:00')) AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:29:59') AND pass=1
ORDER BY createTime DESC
OPEN cursor_name --
FETCH NEXT FROM cursor_name INTO @barcode ,@createTime --
WHILE @@FETCH_STATUS = 0
BEGIN
SELECT TOP 1 @productInfo=productInfo FROM dbo.tb_InspectResult WHERE barcode=@barcode ORDER BY createTime DESC
insert into #b(BarCode,ProductInfo,CreateTime) values(@barcode,@productInfo,@createTime)
--PRINT 'ID'+@productInfo
FETCH NEXT FROM cursor_name INTO @barcode,@createTime
END
CLOSE cursor_name --
DEALLOCATE cursor_name --
SELECT COUNT(*) AS c1 ,
(SELECT COUNT(*) FROM #b WHERE productInfo LIKE '%%' ) c2
FROM #b WHERE productInfo LIKE '%%'";
// sql = @"SELECT COUNT(*) AS c1 ,
// (SELECT COUNT(*) FROM View_StockIn WHERE ([createTime] BETWEEN DATEADD(day,-1, CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:00')) AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:29:59')) AND productInfo LIKE '%槛%' and pass=1) c2
// FROM View_StockIn WHERE([createTime] BETWEEN DATEADD(day,-1, CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:00')) AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:29:59')) AND productInfo LIKE '%保%' and pass=1";
return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, null).Tables[0];
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return null;
}
}
public DataTable SearchDetailA()
{
try
{
string sql = @"DECLARE @barcode nvarchar(100),
@productInfo nvarchar(100),
@createTime DATETIME,
@totle INT ,
@ptype NVARCHAR(100),
@color NVARCHAR(100)
IF OBJECT_ID('TEMPDB..#a') IS NOT NULL
DROP TABLE #a
create table #a (BarCode nvarchar(100),productInfo nvarchar(100),createTime dateTime)
--truncate table #c
DECLARE cursor_name CURSOR FOR --
SELECT barcode,CreateTime FROM dbo.tb_StockIn WHERE createTime BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:30:01') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:00') AND pass=1
ORDER BY createTime DESC
OPEN cursor_name --
FETCH NEXT FROM cursor_name INTO @barcode ,@createTime --
WHILE @@FETCH_STATUS = 0
BEGIN
SELECT TOP 1 @productInfo=productInfo FROM dbo.tb_InspectResult WHERE barcode=@barcode ORDER BY createTime DESC
insert into #a(BarCode,ProductInfo,CreateTime) values(@barcode,@productInfo,@createTime)
FETCH NEXT FROM cursor_name INTO @barcode,@createTime
END
CLOSE cursor_name --
DEALLOCATE cursor_name --
IF OBJECT_ID('TEMPDB..#temp') IS NOT NULL
DROP TABLE #temp
create table #temp (id INT IDENTITY(1,1)NOT NULL, totle INT,ptype nvarchar(100),color NVARCHAR(100))
DECLARE a1 CURSOR FOR --
SELECT COUNT(0) totle,SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 )) AS PType,LEFT(productInfo,CHARINDEX(',',productInfo)-1) AS color
FROM #a WHERE productInfo LIKE '%%'
GROUP BY LEFT(productInfo,CHARINDEX(',',productInfo)-1),SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 ))
ORDER BY SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 ))
OPEN a1 --
FETCH NEXT FROM a1 INTO @totle ,@ptype,@color --
WHILE @@FETCH_STATUS = 0
BEGIN
insert into #temp(totle,ptype,color) values(@totle,@ptype,@color)
FETCH NEXT FROM a1 INTO @totle ,@ptype,@color
END
CLOSE a1 --
DEALLOCATE a1 --
DECLARE a2 CURSOR FOR --
SELECT COUNT(0) totle,SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 )) AS PType,LEFT(productInfo,CHARINDEX(',',productInfo)-1) AS color
FROM #a WHERE productInfo LIKE '%%'
GROUP BY LEFT(productInfo,CHARINDEX(',',productInfo)-1),SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 ))
ORDER BY SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 ))
OPEN a2 --
FETCH NEXT FROM a2 INTO @totle ,@ptype,@color --
WHILE @@FETCH_STATUS = 0
BEGIN
insert into #temp(totle,ptype,color) values(@totle,@ptype,@color)
FETCH NEXT FROM a2 INTO @totle ,@ptype,@color
END
CLOSE a2 --
DEALLOCATE a2 --
SELECT * FROM #temp ORDER BY id ";
return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, null).Tables[0];
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return null;
}
}
public DataTable SearchDetailB()
{
try
{
string sql = "";
if (DateTime.Now > DateTime.Parse(DateTime.Now.ToShortDateString() + " 19:30:00") && DateTime.Now < DateTime.Parse(DateTime.Now.ToShortDateString() + " 23:59:59"))
{
sql = @"DECLARE @barcode nvarchar(100),
@productInfo nvarchar(100),
@createTime DATETIME,
@totle INT ,
@ptype NVARCHAR(100),
@color NVARCHAR(100)
IF OBJECT_ID('TEMPDB..#a') IS NOT NULL
DROP TABLE #a
create table #a (BarCode nvarchar(100),productInfo nvarchar(100),createTime dateTime)
--truncate table #c
DECLARE cursor_name CURSOR FOR --
SELECT barcode,CreateTime FROM dbo.tb_StockIn WHERE createTime BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:01') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:59:59') AND pass=1
ORDER BY createTime DESC
OPEN cursor_name --
FETCH NEXT FROM cursor_name INTO @barcode ,@createTime --
WHILE @@FETCH_STATUS = 0
BEGIN
SELECT TOP 1 @productInfo=productInfo FROM dbo.tb_InspectResult WHERE barcode=@barcode ORDER BY createTime DESC
insert into #a(BarCode,ProductInfo,CreateTime) values(@barcode,@productInfo,@createTime)
FETCH NEXT FROM cursor_name INTO @barcode,@createTime
END
CLOSE cursor_name --
DEALLOCATE cursor_name --
IF OBJECT_ID('TEMPDB..#temp') IS NOT NULL
DROP TABLE #temp
create table #temp (id INT IDENTITY(1,1)NOT NULL, totle INT,ptype nvarchar(100),color NVARCHAR(100))
DECLARE a1 CURSOR FOR --
SELECT COUNT(0) totle,SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 )) AS PType,LEFT(productInfo,CHARINDEX(',',productInfo)-1) AS color
FROM #a WHERE productInfo LIKE '%%'
GROUP BY LEFT(productInfo,CHARINDEX(',',productInfo)-1),SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 ))
ORDER BY SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 ))
OPEN a1 --
FETCH NEXT FROM a1 INTO @totle ,@ptype,@color --
WHILE @@FETCH_STATUS = 0
BEGIN
insert into #temp(totle,ptype,color) values(@totle,@ptype,@color)
FETCH NEXT FROM a1 INTO @totle ,@ptype,@color
END
CLOSE a1 --
DEALLOCATE a1 --
DECLARE a2 CURSOR FOR --
SELECT COUNT(0) totle,SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 )) AS PType,LEFT(productInfo,CHARINDEX(',',productInfo)-1) AS color
FROM #a WHERE productInfo LIKE '%%'
GROUP BY LEFT(productInfo,CHARINDEX(',',productInfo)-1),SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 ))
ORDER BY SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 ))
OPEN a2 --
FETCH NEXT FROM a2 INTO @totle ,@ptype,@color --
WHILE @@FETCH_STATUS = 0
BEGIN
insert into #temp(totle,ptype,color) values(@totle,@ptype,@color)
FETCH NEXT FROM a2 INTO @totle ,@ptype,@color
END
CLOSE a2 --
DEALLOCATE a2 --
SELECT * FROM #temp ORDER BY id ";
}
if (DateTime.Now > DateTime.Parse(DateTime.Now.ToShortDateString() + " 00:00:00") && DateTime.Now < DateTime.Parse(DateTime.Now.ToShortDateString() + " 07:30:00"))
{
sql = @"DECLARE @barcode nvarchar(100),
@productInfo nvarchar(100),
@createTime DATETIME,
@totle INT ,
@ptype NVARCHAR(100),
@color NVARCHAR(100)
IF OBJECT_ID('TEMPDB..#a') IS NOT NULL
DROP TABLE #a
create table #a (BarCode nvarchar(100),productInfo nvarchar(100),createTime dateTime)
--truncate table #c
DECLARE cursor_name CURSOR FOR --
SELECT barcode,CreateTime FROM dbo.tb_StockIn WHERE createTime BETWEEN DATEADD(day,-1, CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:01')) AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:30:00') AND pass=1
ORDER BY createTime DESC
OPEN cursor_name --
FETCH NEXT FROM cursor_name INTO @barcode ,@createTime --
WHILE @@FETCH_STATUS = 0
BEGIN
SELECT TOP 1 @productInfo=productInfo FROM dbo.tb_InspectResult WHERE barcode=@barcode ORDER BY createTime DESC
insert into #a(BarCode,ProductInfo,CreateTime) values(@barcode,@productInfo,@createTime)
FETCH NEXT FROM cursor_name INTO @barcode,@createTime
END
CLOSE cursor_name --
DEALLOCATE cursor_name --
IF OBJECT_ID('TEMPDB..#temp') IS NOT NULL
DROP TABLE #temp
create table #temp (id INT IDENTITY(1,1)NOT NULL, totle INT,ptype nvarchar(100),color NVARCHAR(100))
DECLARE a1 CURSOR FOR --
SELECT COUNT(0) totle,SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 )) AS PType,LEFT(productInfo,CHARINDEX(',',productInfo)-1) AS color
FROM #a WHERE productInfo LIKE '%%'
GROUP BY LEFT(productInfo,CHARINDEX(',',productInfo)-1),SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 ))
ORDER BY SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 ))
OPEN a1 --
FETCH NEXT FROM a1 INTO @totle ,@ptype,@color --
WHILE @@FETCH_STATUS = 0
BEGIN
insert into #temp(totle,ptype,color) values(@totle,@ptype,@color)
FETCH NEXT FROM a1 INTO @totle ,@ptype,@color
END
CLOSE a1 --
DEALLOCATE a1 --
DECLARE a2 CURSOR FOR --
SELECT COUNT(0) totle,SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 )) AS PType,LEFT(productInfo,CHARINDEX(',',productInfo)-1) AS color
FROM #a WHERE productInfo LIKE '%%'
GROUP BY LEFT(productInfo,CHARINDEX(',',productInfo)-1),SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 ))
ORDER BY SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 ))
OPEN a2 --
FETCH NEXT FROM a2 INTO @totle ,@ptype,@color --
WHILE @@FETCH_STATUS = 0
BEGIN
insert into #temp(totle,ptype,color) values(@totle,@ptype,@color)
FETCH NEXT FROM a2 INTO @totle ,@ptype,@color
END
CLOSE a2 --
DEALLOCATE a2 --
SELECT * FROM #temp ORDER BY id ";
}
if (DateTime.Now > DateTime.Parse(DateTime.Now.ToShortDateString() + " 07:30:00") && DateTime.Now < DateTime.Parse(DateTime.Now.ToShortDateString() + " 19:30:00"))
{
sql = @"DECLARE @barcode nvarchar(100),
@productInfo nvarchar(100),
@createTime DATETIME,
@totle INT ,
@ptype NVARCHAR(100),
@color NVARCHAR(100)
IF OBJECT_ID('TEMPDB..#a') IS NOT NULL
DROP TABLE #a
create table #a (BarCode nvarchar(100),productInfo nvarchar(100),createTime dateTime)
--truncate table #c
DECLARE cursor_name CURSOR FOR --
SELECT barcode,CreateTime FROM dbo.tb_StockIn WHERE [createTime] BETWEEN DATEADD(day,-1, CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:01')) AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:30:00') AND pass=1
ORDER BY createTime DESC
OPEN cursor_name --
FETCH NEXT FROM cursor_name INTO @barcode ,@createTime --
WHILE @@FETCH_STATUS = 0
BEGIN
SELECT TOP 1 @productInfo=productInfo FROM dbo.tb_InspectResult WHERE barcode=@barcode ORDER BY createTime DESC
insert into #a(BarCode,ProductInfo,CreateTime) values(@barcode,@productInfo,@createTime)
FETCH NEXT FROM cursor_name INTO @barcode,@createTime
END
CLOSE cursor_name --
DEALLOCATE cursor_name --
IF OBJECT_ID('TEMPDB..#temp') IS NOT NULL
DROP TABLE #temp
create table #temp (id INT IDENTITY(1,1)NOT NULL, totle INT,ptype nvarchar(100),color NVARCHAR(100))
DECLARE a1 CURSOR FOR --
SELECT COUNT(0) totle,SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 )) AS PType,LEFT(productInfo,CHARINDEX(',',productInfo)-1) AS color
FROM #a WHERE productInfo LIKE '%%'
GROUP BY LEFT(productInfo,CHARINDEX(',',productInfo)-1),SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 ))
ORDER BY SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 ))
OPEN a1 --
FETCH NEXT FROM a1 INTO @totle ,@ptype,@color --
WHILE @@FETCH_STATUS = 0
BEGIN
insert into #temp(totle,ptype,color) values(@totle,@ptype,@color)
FETCH NEXT FROM a1 INTO @totle ,@ptype,@color
END
CLOSE a1 --
DEALLOCATE a1 --
DECLARE a2 CURSOR FOR --
SELECT COUNT(0) totle,SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 )) AS PType,LEFT(productInfo,CHARINDEX(',',productInfo)-1) AS color
FROM #a WHERE productInfo LIKE '%%'
GROUP BY LEFT(productInfo,CHARINDEX(',',productInfo)-1),SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 ))
ORDER BY SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 ))
OPEN a2 --
FETCH NEXT FROM a2 INTO @totle ,@ptype,@color --
WHILE @@FETCH_STATUS = 0
BEGIN
insert into #temp(totle,ptype,color) values(@totle,@ptype,@color)
FETCH NEXT FROM a2 INTO @totle ,@ptype,@color
END
CLOSE a2 --
DEALLOCATE a2 --
SELECT * FROM #temp ORDER BY id
";
}
return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, null).Tables[0];
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return null;
}
}
public DataTable SearchColorByBarCode(string barcode)
{
try
{
string sql = @"select top 1 paintCode from tb_StockIn where barcode='" + barcode + @"' order by createTime desc";
return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, null).Tables[0];
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(),MethodBase.GetCurrentMethod());
return null;
}
}
}
}

3
MESClassLibrary/MESClassLibrary.csproj

@ -130,6 +130,7 @@
<Compile Include="BLL\Painting\ChaimUpRecordBll.cs" />
<Compile Include="BLL\Painting\InspectResultBLL.cs" />
<Compile Include="BLL\Painting\PaintBarCodeBLL.cs" />
<Compile Include="BLL\Painting\ForeignColorMapBLL.cs" />
<Compile Include="BLL\Painting\StockInBLL.cs" />
<Compile Include="BLL\Plan247\Plan247BLL.cs" />
<Compile Include="BLL\PlasticBLL.cs" />
@ -213,6 +214,7 @@
<Compile Include="DAL\Mistake247\RecordDAL.cs" />
<Compile Include="DAL\painting\InspectResultDAL.cs" />
<Compile Include="DAL\painting\PaintBarCodeDAL.cs" />
<Compile Include="DAL\painting\ForeignColorMapDAL.cs" />
<Compile Include="DAL\painting\StockInDAL.cs" />
<Compile Include="DAL\Plan247\Plan247DAL.cs" />
<Compile Include="DAL\Injection\PLCMouldDAL.cs" />
@ -753,6 +755,7 @@
<Compile Include="Model\DefectModel.cs" />
<Compile Include="Model\DeviceModel.cs" />
<Compile Include="Model\DownRecordVO.cs" />
<Compile Include="Model\ForeignColorMapModel.cs" />
<Compile Include="Model\EcharBarModel.cs" />
<Compile Include="Model\GetNewTasksModel.cs" />
<Compile Include="Model\InjectionBadReasonModel.cs" />

18
MESClassLibrary/Model/ForeignColorMapModel.cs

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace MESClassLibrary.Model
{
public class ForeignColorMapModel
{
public string ForeignID { get; set; }
public string TypeCode { get; set; }
public string PartCode { get; set; }
public string PartName { get; set; }
public string Color { get; set; }
public string StockNo { get; set; }
}
}

1
MESWebSite/HttpHandlers/ForeignColorMapHandler.ashx

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

171
MESWebSite/HttpHandlers/ForeignColorMapHandler.ashx.cs

@ -0,0 +1,171 @@
using MESClassLibrary.BLL.BasicInfo;
using MESClassLibrary.EFModel;
using System;
using System.Collections.Generic;
using System.Data;
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 TypeCode = Request.Params["TypeCode"];
string PartCode = Request.Params["PartCode"];
if (string.IsNullOrEmpty(page))
{
page = "0";
}
if (string.IsNullOrEmpty(pagesize))
{
pagesize = "15";
}
ForeignColorMapBLL bll = new ForeignColorMapBLL();
Response.Write(bll.SearchInfo(page, pagesize, TypeCode, PartCode));
Response.End();
}
void SaveInfo()
{
string ForeignID = Request.Params["ID"];
string TypeCode = Request.Params["TypeCode"];
string PartCode = Request.Params["PartCode"];
string PartName = Request.Params["PartName"];
string Color = Request.Params["Color"];
string StockNo = Request.Params["StockNo"];
ForeignColorMapBLL bll = new ForeignColorMapBLL();
tb_ForeignColorMap md = new tb_ForeignColorMap();
md.ID = int.Parse( ForeignID);
md.TypeCode = TypeCode;
md.PartCode = PartCode;
md.Color = Color;
md.StockNo = StockNo;
string partName = PartName;
ProductBLL productBLL = new ProductBLL();
DataTable dt = productBLL.SearchInfoByPartNo( PartCode);
if (dt.Rows.Count == 0)
{
Response.Write($"零件号[{PartCode}]在系统中不存在!");
Response.End();
return;
}
else
{
List<DataRow> rows = dt.AsEnumerable().Where(p => p.Field<string>("StockNo") == StockNo).ToList();
if(rows.Count == 0)
{
Response.Write($"零件号[{PartCode}]与存货代码[{StockNo}]不匹配!");
Response.End();
return;
}
partName = rows[0]["ProductName"].ToString();
}
md.PartName = partName;
if (ForeignID == "0")
{
//新增
//md.ID = 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 ForeignID = Request.Params["ID"];
ForeignColorMapBLL bll = new ForeignColorMapBLL();
tb_ForeignColorMap md = new tb_ForeignColorMap();
md.ID = int.Parse(ForeignID);
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

@ -114,6 +114,7 @@
<Content Include="Manage\CarType.aspx" />
<Content Include="Manage\ChaimDownRecord.aspx" />
<Content Include="Manage\ChaimUpRecord.aspx" />
<Content Include="Manage\ForeignColorMap.aspx" />
<Content Include="Manage\ImgVideo.aspx" />
<Content Include="Manage\InjectionReport.aspx" />
<Content Include="Manage\InjectionScreen.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>
@ -1331,6 +1336,13 @@
<Compile Include="Manage\ChaimUpRecord.aspx.designer.cs">
<DependentUpon>ChaimUpRecord.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\ImgVideo.aspx.cs">
<DependentUpon>ImgVideo.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>

423
MESWebSite/Manage/ForeignColorMap.aspx

@ -0,0 +1,423 @@
<%@ 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;">程序号:
<input type="text" id="TypeCode_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">
<input id="TypeCode" type="text" class="text" style="width: 230px; height: 30px;" />
<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>
<tr>
<td class="title" style="width: 110px;">
<p>
存货代码:
</p>
</td>
<td colspan="2">
<input id="StockNo" 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: '颜色', sortable: 'true', width: 10 },
{ field: 'StockNo', title: '存货代码', 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 ForeignID = isEdit == true ? PrimaryID : 0;
var TypeCode = $('#TypeCode').val();
var PartCode = $('#PartCode').val();
var Color = $('#Color').val();
var StockNo = $('#StockNo').val();
var PartName = $('#PartName').val();
if (TypeCode == "") {
$.messager.alert('提示', '程序号不能为空,请重新输入', 'warning');
return;
}
if (PartCode == "") {
$.messager.alert('提示', '零件号不能为空,请重新输入', 'warning');
return;
}
if (Color == "") {
$.messager.alert('提示', '颜色不能为空,请重新输入', 'warning');
return;
}
if (StockNo == "") {
$.messager.alert('提示', '存货代码不能为空,请重新输入', 'warning');
return;
}
//var r = /^\+?[1-9][0-9]*$/;  //正整数
//if (!r.test(time)) {
// $.messager.alert('提示', '换模时间必须为正整数,请重新输入', 'warning');
// return;
//}
var model = {
ID: ForeignID,
TypeCode: TypeCode,
Color: Color,
PartCode: PartCode,
StockNo: StockNo,
PartName: PartName,
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 if (data == 'false') {
$.messager.alert('提示', '保存失败,请查看是否编号重复', 'warning');
}
else {
$.messager.alert('提示', data, 'warning');
}
},
error: function () {
}
});
}
//查询方法
function SearchInfo() {
var typeCode = $('#TypeCode_s').val();
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;
$('#TypeCode').val(row.TypeCode);
$('#PartCode').val(row.PartCode);
$('#PartName').val(row.PartName);
$('#Color').val(row.Color);
$('#StockNo').val(row.StockNo);
$('#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() {
$('#TypeCode').val('');
$('#PartCode').val('');
$('#PartName').val('');
$('#Color').val('');
$('#StockNo').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;
}
}

20
MESWebSite/Manage/Station.aspx.designer.cs

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

Loading…
Cancel
Save