private void SendClearResult() { if (dtClear.Rows.Count > 0) { string gram = Global.sUserId + ","; gram += System.DateTime.Now.ToString("yyyyMMddHHmmss") + ","; gram += Global.sBb + ","; gram += Global.sZyq + ","; gram += System.DateTime.Now.ToString("yyyyMMddHHmmss") + ","; //int j = 0; string str = ""; string kw = ""; int k = 0; for (int i = 0; i < dtClear.Rows.Count; i++) { k = i + 1; kw = dtClear.Rows[i]["KW"].ToString(); int length = kw.Length; if (dtClear.Rows[i]["STATUS"].ToString() == "True") { str += dtClear.Rows[i]["CLH"].ToString() + ","; } else { str += "99999999999,"; } if (length > 4) { if (length == 7) { str += "**" + kw.Substring(0, 5) + k.ToString("00") + "1,"; } else { str += kw.Substring(0, 5) + k.ToString("00") + "1,"; } } else { str += kw + k.ToString("00") + "1,"; } } if (str != "") { gram += rowCnt.ToString() + ","; str += ",";//yt str = str.Substring(0, str.Length - 1); if (Global.sDebug == "False") { Business.SendText(Business.msg.Package("ZDUA16", gram + str));//清盘库材料信息 } frmMessage frmMessage = new frmMessage(); frmMessage.ShowDialog("发送完毕!", "提示", "确定"); frmMessage.Dispose(); } } }
private void btnScan_Click(object sender, EventArgs e) { string data = Global.sUserId + ";"; data += System.DateTime.Now.ToString("yyyyMMddHHmmss") + ";"; data += Global.sBb + ";"; data += Global.sZyq + ";"; data += textTCH.Text + ";"; data += textKJH.Text; if (Global.sDebug == "False") { frmMessage frmMessage = new frmMessage(); frmMessage.ShowDialog("是否进行启动激光扫描操作?", "选择", "确定", "取消"); if (frmMessage.ret == true) { Business.SendText(Business.msg.Package("ZDUA02", data));//启动扫描 } frmMessage.Dispose(); //string gram = "##0378UAZD020402;2001;20;N;4;;;;2200;3000;1100;1900;69;;;;;3150;5400;1100;1900;70;;;;;3600;7800;1100;1900;71;;;;;1650;7800;1100;1900;72;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;9999@@"; //string sql = "insert into RecvMsg(Msg,Done,Lock,RecvTime,ID) values('" + gram.Replace("'", "''") + "',0,0,getDate(),newID())"; //SqlCe.ExecuteNonQuery(sql); Global.curFrame.status = FrameStatus.PT_LaserStart; } }
private void frmClear_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Escape) { Global.frmCurrent = this.Owner; this.Owner.Show(); this.Owner = null; this.Close(); } if (e.KeyCode == Keys.F21) { if (curKW != "") { frmMessage msg = new frmMessage(); msg.ShowDialog("最后一个库位" + curKW + "上没有钢卷?", "选择", "是", "否"); msg.Dispose(); } SendClearResult(); } if (e.KeyCode == Keys.Tab) { //frmWriteOff frm = new frmWriteOff();//销账 //Global.frmCurrent = frm; //frm.Owner = this; //frm.Show(); //this.Hide(); } }
private void button1_Click(object sender, EventArgs e) { AllCode.mlistpileData_Check.Clear(); txtLayer.Text = txtLayer.Text.ToUpper(); string strColumNum = txtLayer.Text;//列号 if (strColumNum.CompareTo("") == 0) { frmMessage frmMessage = new frmMessage(); frmMessage.ShowDialog("请输入列号!", "提示", "确定"); frmMessage.Dispose(); } else { try { SlabWebservice.PileData[] ServiceSlabYardData = AllCode.serviceSlabYard.GetColumnData(strColumNum); string[] stringArrSlabYardData = new string[ServiceSlabYardData.Length]; for (int inta = 0; inta < ServiceSlabYardData.Length; inta++) { string[] stringArrDataThis = new string[6]; stringArrDataThis[0] = ServiceSlabYardData[inta].ColumnNo; //列号 stringArrDataThis[1] = ServiceSlabYardData[inta].DeterminFlag.ToString(); //判断标志 stringArrDataThis[2] = ServiceSlabYardData[inta].LayerNO; //层号 stringArrDataThis[3] = ServiceSlabYardData[inta].MaterialNO; //材料号 stringArrDataThis[4] = ServiceSlabYardData[inta].PileNO; //垛号 // stringArrDataThis[5] = ServiceSlabYardData[inta].POHO; stringArrDataThis[5] = ServiceSlabYardData[inta].RowNo; //行号 stringArrSlabYardData[inta] = DBopt.CombineString(stringArrDataThis); //组合字符串 } //将数据写到txt中 stringSlabDownLoadDataFile = AllCode.stringBootDir + "\\listSlabData.txt";//在wince根目录创建listSlabData.txt文件 if (System.IO.File.Exists(stringSlabDownLoadDataFile)) { System.IO.File.Delete(stringSlabDownLoadDataFile); } int intSucInsert = 0; //将数据写到硬盘txt int intfileAddSlabDB = DDSkyDll.Net20.LocalDB.Insert(stringSlabDownLoadDataFile, stringArrSlabYardData, AllCode.intDataLength - 3, ref intSucInsert); if (intSucInsert != 0) { AllCode.mbParent.Show(string.Format("数据下载成功!"), "OK", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1); ifExitFile = true; } else { AllCode.mbParent.Show(string.Format("数据下载失败!"), "错误", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1); ifExitFile = false; } } catch (Exception e1) { System.Diagnostics.Debug.WriteLine(e1.Message); frmMessage frmMessage = new frmMessage(); frmMessage.ShowDialog(e1.Message, "提示", "确定"); frmMessage.Dispose(); } } }
private void addCoil(CoilPoint p, string text) { if (p.row >= 0) { if (Global.coils.ContainsKey(p)) { if (Global.coils[p].clh != "") { frmMessage frmMessage = new frmMessage(); if (Global.coils[p].clh != text) { frmMessage.ShowDialog("当前位置已经存在板坯!", "提示", "确定"); } else { frmMessage.ShowDialog("是否取消当前位置上的板坯?", "选择", "是", "否"); if (frmMessage.ret == true) { deleteCoil(p); } } frmMessage.Dispose(); } else { doScanSesult(Global.curFrame.KZ, p, text, DateTime.Now.ToString("yyyyMMddHHmmss")); } } else { doScanSesult(Global.curFrame.KZ, p, text, DateTime.Now.ToString("yyyyMMddHHmmss")); } } }
private void frmLogin_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Space) { aliveTimer.Enabled = false; recvTimer.Enabled = false; sendFailTimer.Enabled = false; sendTimer.Enabled = false; Global.Exit(); Application.Exit(); } if (e.KeyCode == Keys.F3) { getUserInf(); } if (e.KeyCode == Keys.F4) { frmMessage frmMessage = new frmMessage(); frmMessage.ShowDialog("是否恢复系统文件?", "提示", "确定", "取消"); if (frmMessage.ret == true) { FileInfo iFile = new FileInfo(Global.appPath + @"\s.sdf"); iFile.CopyTo(Global.appPath + @"\update\store.sdf", true); PsionTeklogix.Power.PowerManagement.WarmBoot(); } frmMessage.Dispose(); } }
//库位 private void addKw(string kw) { bool bExists = false; DataRow row; for (int i = 0; i < dtClear.Rows.Count; i++) { if (dtClear.Rows[i]["KW"].ToString() == kw) { curRow = i; dgClear.CurrentCell = new DataGridCell(i, 0); dgClear.Select(i); dgClear.Invalidate(); bExists = true; break; } } if (!bExists) { bool val = true; if (curKW != "") { frmMessage msg = new frmMessage(); msg.ShowDialog("库位" + curKW + "上没有钢卷?", "选择", "是", "否"); val = msg.ret; msg.Dispose(); } if (val) { // string iKwRowString = kw.Substring(0, 5) + "-" + Convert.ToInt32(kw.Substring(5)); //dtClear.Rows.Add(new object[] { iKwRowString, "", "True" }); for (int i = 1; i <= dtClear.Rows.Count; i++) { row = dtClear.NewRow(); if (row["KW"].ToString().Equals("") && i != Convert.ToInt32(kw.Substring(5))) { row["KW"] = kw.Substring(0, 5) + "-" + i.ToString(); } else { row["KW"] = kw.Substring(0, 5) + "-" + Convert.ToInt32(kw.Substring(5)); curRow = i; } row["CLH"] = ""; row["STATUS"] = "True"; dtClear.Rows.Add(row); } //curRow = dtClear.Rows.Count - 1; dgClear.CurrentCell = new DataGridCell(curRow, 0); dgClear.Select(curRow); dgClear.Invalidate(); PsionTeklogix.Sound.Beeper.Beeper.PlayTone(5000, 500, 100); curKW = kw; } } }
public void showDialogMsg(string msg) { Global.UIThread(this, delegate { frmMessage dialog = new frmMessage(); dialog.ShowDialog(msg, "提示", "确定"); dialog.Dispose(); }); }
private void SendClearResult() { if (dtClear.Rows.Count > 0) { string gram = Global.sUserId + ","; gram += System.DateTime.Now.ToString("yyyyMMddHHmmss") + ","; gram += Global.sBb + ","; gram += Global.sZyq + ","; gram += System.DateTime.Now.ToString("yyyyMMddHHmmss") + ","; //int j = 0; string str = ""; int layer = 0; int numCHL = 0; int k = 0; string kw = ""; for (int i = 0; i < dtClear.Rows.Count; i++) { k = i + 1; kw = dtClear.Rows[i]["KW"].ToString(); if (dtClear.Rows[i]["CLH"].ToString() != "") { layer = Convert.ToInt32(dtClear.Rows[i]["CH"]); str += dtClear.Rows[i]["CLH"].ToString() + ","; // str += layer.ToString("00") +","; numCHL++; } str += kw + ","; //if (kw.Length > 4) //{ // str += kw.Substring(0, 5) + k.ToString("00") + "1,"; //} //else //{ // str += kw + k.ToString("00") + "1,"; //} } if (str != "") { gram += numCHL.ToString() + ","; str += ",";//yt str = str.Substring(0, str.Length - 1); if (Global.sDebug == "False") { Business.SendText(Business.msg.Package("ZDUA16", gram + str));//清盘库材料信息 } frmMessage frmMessage = new frmMessage(); frmMessage.ShowDialog("发送完毕!", "提示", "确定"); frmMessage.Dispose(); } } }
private void SendClearResult() { if (dtClear.Rows.Count > 0) { string gram = Global.sUserId + AllCode.stringInterfaceChar; gram += System.DateTime.Now.ToString("yyyyMMddHHmmss") + AllCode.stringInterfaceChar; gram += Global.sBb + AllCode.stringInterfaceChar; gram += Global.sZyq + AllCode.stringInterfaceChar; gram += System.DateTime.Now.ToString("yyyyMMddHHmmss") + AllCode.stringInterfaceChar; string str = ""; for (int i = 0; i < dtClear.Rows.Count; i++) { if (dtClear.Rows[i]["STATUS"].ToString() == "True") { str += dtClear.Rows[i]["CLH"].ToString() + AllCode.stringInterfaceChar; int length = dtClear.Rows[i]["KW"].ToString().Length; //old if (length == 7) if (length == 6) { str += "**" + dtClear.Rows[i]["KW"].ToString() + "1" + AllCode.stringInterfaceChar; } else { str += dtClear.Rows[i]["KW"].ToString() + "1" + AllCode.stringInterfaceChar; } } else { str += "99999999999" + AllCode.stringInterfaceChar; str += dtClear.Rows[i]["KW"].ToString() + "0" + AllCode.stringInterfaceChar; } } if (str != "") { gram += dtClear.Rows.Count.ToString() + AllCode.stringInterfaceChar; str = str.Substring(0, str.Length - 1); if (Global.sDebug == "False") { Business.SendText(Business.msg.Package("ZDUA16", gram + str + AllCode.stringInterfaceChar));//清盘库材料信息 } frmMessage frmMessage = new frmMessage(); frmMessage.ShowDialog("发送完毕!", "提示", "确定"); frmMessage.Dispose(); } } }
public void GetUserInfResult(IAsyncResult ar) { WebService.Service ws = (WebService.Service)ar.AsyncState; try { string sql; string userid; string pwd; DataTable dt = new DataTable(); try { dt = ws.EndgetUserInf(ar); sql = "delete from userinf"; SqlCe.ExecuteNonQuery(sql); for (int i = 0; i < dt.Rows.Count; i++) { userid = dt.Rows[i]["USERID"].ToString(); pwd = dt.Rows[i]["PWD"].ToString(); sql = "insert into userinf (USERID,PWD) values('" + userid + "','" + pwd + "')"; SqlCe.ExecuteNonQuery(sql); } frmMessage frmMessage = new frmMessage(); frmMessage.ShowDialog("用户资料库已更新!", "提示", "确定"); frmMessage.Dispose(); } catch (Exception e) { System.Diagnostics.Debug.WriteLine(e.Message); } finally { dt.Dispose(); } } catch { } finally { ws.Dispose(); } }
private void addCl(string clh) { if (curRow >= 0) { int index = 0; bool bExists = false; for (int i = 0; i < dtClear.Rows.Count; i++) { if (dtClear.Rows[i]["CLH"].ToString() == clh) { index = i; bExists = true; break; } } if (!bExists) { if (dtClear.Rows[curRow]["CLH"].ToString() == "") { dtClear.Rows[curRow]["CLH"] = clh; PsionTeklogix.Sound.Beeper.Beeper.PlayTone(5000, 500, 100); //curRow = -1; if (dtClear.Rows[curRow]["KW"].ToString() == curKW) { curKW = ""; } } } else { frmMessage frmMessage = new frmMessage(); frmMessage.ShowDialog("是否取消" + clh + "的库位信息?", "选择", "确定", "取消"); if (frmMessage.ret == true) { dtClear.Rows.RemoveAt(index); curRow = -1; } frmMessage.Dispose(); } } txtJs.Text = dtClear.Rows.Count.ToString(); }
private void btnLeave_Click(object sender, EventArgs e) { if (Global.sDebug == "False") { frmMessage frmMessage = new frmMessage(); frmMessage.ShowDialog(Global.curFrame.QY + Global.curFrame.CH + "是否已经离开停车位?", "选择", "确定", "取消"); if (frmMessage.ret == true) { string data = Global.sUserId + ";"; data += System.DateTime.Now.ToString("yyyyMMddHHmmss") + ";"; data += Global.sBb + ";"; data += Global.sZyq + ";"; data += Global.curFrame.TCH; Business.SendText(Business.msg.Package("ZDUA08", data));//单车作业开始 } frmMessage.Dispose(); } }
//材料号 private void addCl(string clh) { bool bExists = false; // if (dtClear.Rows[i]["CLH"].ToString() != "") { } for (int i = 0; i < dtClear.Rows.Count; i++) { if (dtClear.Rows[i]["CLH"].ToString() == clh) { int j = i + 1; frmMessage frmMessage = new frmMessage(); frmMessage.ShowDialog("与第" + j + "层重复,是否取消" + j + "层材料号" + clh + "?", "选择", "是", "否"); if (frmMessage.ret == true) { dtClear.Rows[i]["CLH"] = ""; } frmMessage.Dispose(); bExists = true; break; } } if (!bExists) { if (curRow >= 0) { dtClear.Rows[curRow]["CLH"] = clh; PsionTeklogix.Sound.Beeper.Beeper.PlayTone(5000, 500, 100); } } int cnt = 0; for (int i = 0; i < dtClear.Rows.Count; i++) { if (dtClear.Rows[i]["CLH"].ToString() != "") { cnt++; } } //txtJs.Text = cnt.ToString(); }
private void addKw(string kw) { bool bExists = false; for (int i = 0; i < dtClear.Rows.Count; i++) { if (dtClear.Rows[i]["KW"].ToString() == kw) { curRow = i; dgClear.CurrentCell = new DataGridCell(i, 0); dgClear.Select(i); dgClear.Invalidate(); bExists = true; break; } } if (!bExists) { bool val = true; if (curKW != "") { frmMessage msg = new frmMessage(); msg.ShowDialog("库位" + curKW + "上没有钢卷?", "选择", "是", "否"); val = msg.ret; msg.Dispose(); } if (val) { dtClear.Rows.Add(new object[] { "", kw, "True" }); curRow = dtClear.Rows.Count - 1; dgClear.CurrentCell = new DataGridCell(curRow, 0); dgClear.Select(curRow); dgClear.Invalidate(); PsionTeklogix.Sound.Beeper.Beeper.PlayTone(5000, 500, 100); curKW = kw; } } }
private void addCL(string text) { bool bAlreadyIn = false; for (int i = 0; i < dtCl.Rows.Count; i++) { string clh = dtCl.Rows[i]["CLH"].ToString(); string lbl = dtCl.Rows[i]["LBL"].ToString(); string jhh = Global.storage.jhh; string flag = dtCl.Rows[i]["FLAG"].ToString(); if (text == lbl) { bAlreadyIn = true; frmMessage frm = new frmMessage(); frm.ShowDialog("是否取消消帐材料" + text, "提示"); if (frm.ret) { dtCl.Rows[i]["WCFlag"] = 0; dtCl.Rows[i]["SCANTIME"] = ""; dtCl.Rows[i]["KW"] = ""; Storage.ClearWtdInScanStatus(jhh, lbl, flag); RefreshData(); curRow = -1; } frm.Dispose(); break; } } if (bAlreadyIn == false) { //弹出窗体,输入件数、重量 wtd2kw("", text, Global.storage.jhh); } }
private void getKJInfo(string kjh) { string sql = "select * from Frame where FrameID='" + kjh + "'"; DataTable dt = SqlCe.ExecuteQuery(sql); if (dt.Rows.Count == 0) { sZZ = ""; iMaxRow = 0; iSpace = 0; frmMessage frmMessage = new frmMessage(); frmMessage.ShowDialog("未找到框架号为:" + kjh + "的框架信息!", "提示", "确定"); frmMessage.Dispose(); } else { sZZ = dt.Rows[0]["Weight"].ToString(); if (dt.Rows[0]["FrameCount"] != DBNull.Value) { iMaxRow = Convert.ToInt32(dt.Rows[0]["FrameCount"]); } else { iMaxRow = 0; } if (dt.Rows[0]["Space"] != DBNull.Value) { iSpace = Convert.ToInt32(dt.Rows[0]["Space"]); } else { iSpace = 0; } } }
private void btnSend_Click(object sender, EventArgs e) { frmMessage frmMessage = new frmMessage(); bool bval = (cboDq.SelectedIndex == 0 && txtKjh.Text.Length == 4) || (cboDq.SelectedIndex > 0 && txtKjh.Text.Length == 6); if (bval == false) { frmMessage.ShowDialog("请输入正确的车号!", "提示", "确定"); frmMessage.Dispose(); return; } frmMessage.ShowDialog("是否需要发送入库消帐电文?", "提示", "是", "否"); bool ret = frmMessage.ret; frmMessage.Dispose(); if (ret) { Global.storage.kjh = ""; Global.storage.dqSelectedIndex = cboDq.SelectedIndex; Global.storage.jxh = txtJxh.Text; Global.storage.dlh1 = txtDL1.Text; Global.storage.dlh2 = txtDL2.Text; Global.storage.djh = txtDJ.Text; btnSend.Enabled = false; foreach (string gram in grams) { string data = DateTime.Now.ToString("yyyyMMddHHmmss") + ";"; data += Global.sBb + ";"; data += Global.sZyq + ";"; data += Global.sKb + ";"; data += Global.sUserId + ";"; data += txtJxh.Text + ";"; data += txtDL1.Text + ";"; data += txtDL2.Text + ";"; data += txtDJ.Text + ";"; data += cboDq.Text + txtKjh.Text + ";"; if (cboStatus.SelectedIndex == 1) { data += "N;"; } else { data += "Y;"; } data += gram; if (Global.sDebug == "False") { Business.SendText(Business.msg.Package("ZDWX55", data)); } } Business.InvokeMethod(this.Owner, "InStore", new object[] { }); Global.frmCurrent = this.Owner; this.Owner.Show(); this.Owner = null; this.Close(); } }
private void SendClearResult() { frmMessage frmMessage = new frmMessage(); //bool bva = (textKJH.Text.Length == 4 && Global.IsNumberic(textKJH.Text) || textKJH.Text.Length == 6); //if (bva == false) //{ // frmMessage.ShowDialog("请输入正确的框架号!", "提示", "确定"); // frmMessage.Dispose(); // return; //} if (!Global.IsNumberic(textHCH.Text) && textHCH.Text.Length == 1) { frmMessage.ShowDialog("请输入正确的行车号!", "提示", "确定"); frmMessage.Dispose(); return; } if (dtClear.Rows.Count > 0) { string gram = Global.sUserId + AllCode.stringInterfaceChar; gram += System.DateTime.Now.ToString("yyyyMMddHHmmss") + AllCode.stringInterfaceChar; gram += Global.sBb + AllCode.stringInterfaceChar; gram += Global.sZyq + AllCode.stringInterfaceChar; // gram += System.DateTime.Now.ToString("yyyyMMddHHmmss") + AllCode.stringInterfaceChar; //gram +=textKJH.Text + AllCode.stringInterfaceChar; //gram +=textHCH.Text + AllCode.stringInterfaceChar; int lengthHCH = textHCH.Text.Length; if (lengthHCH == 1) { gram += "0" + textHCH.Text + AllCode.stringInterfaceChar;//行车号 } else { gram += textHCH.Text + AllCode.stringInterfaceChar; } string str = ""; for (int i = 0; i < dtClear.Rows.Count; i++) { if (dtClear.Rows[i]["STATUS"].ToString() == "True") { str += dtClear.Rows[i]["CLH"].ToString() + AllCode.stringInterfaceChar; int length = dtClear.Rows[i]["KW"].ToString().Length; if (length == 7) { str += "**" + dtClear.Rows[i]["KW"].ToString() + "1" + AllCode.stringInterfaceChar; } else { str += dtClear.Rows[i]["KW"].ToString() + "1" + AllCode.stringInterfaceChar; } str += dtClear.Rows[i]["FLAG"].ToString() + AllCode.stringInterfaceChar; } else { str += "99999999999" + AllCode.stringInterfaceChar; str += dtClear.Rows[i]["KW"].ToString() + "1" + AllCode.stringInterfaceChar; str += "0" + AllCode.stringInterfaceChar; } } if (str != "") { gram += dtClear.Rows.Count.ToString() + AllCode.stringInterfaceChar; str = str.Substring(0, str.Length - 1); if (Global.sDebug == "False") { Business.SendText(Business.msg.Package("ZDUA18", gram + str + AllCode.stringInterfaceChar));//清盘库材料信息 } //frmMessage frmMessage = new frmMessage(); frmMessage.ShowDialog("发送完毕!", "提示", "确定"); frmMessage.Dispose(); } } }
private void downLoad_Click(object sender, EventArgs e) { // string strPlanNum = "20201"; //txtJhh.Text = txtJhh.Text.ToUpper(); //txtJhh.SelectionStart = txtJhh.Text.Length; string strPlanNum = txtJhh.Text; if (strPlanNum.CompareTo("") == 0 || strPlanNum.Length != 5) { frmMessage frmMessage = new frmMessage(); frmMessage.ShowDialog("请输入计划号后5位!", "提示", "确定"); frmMessage.Dispose(); } else { try { //if (strPlanNum.Length!=5) //{ // AllCode.mbParent.Show(string.Format("输入计划号后5位"), "错误", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1); //} string[] ServiceSlabYardData = AllCode.serviceSlabYard.GetPlanMaterial(strPlanNum); // string[] ServiceSlabPlanData={"1234566666","11111166666","2222266666"}; string[] strArrSlabPlanData = ServiceSlabYardData; if (strArrSlabPlanData.Length == 0) { frmMessage frmMessage = new frmMessage(); frmMessage.ShowDialog("该计划无材料", "提示", "确定"); frmMessage.Dispose(); } else { frmMessage frmMessage = new frmMessage(); frmMessage.ShowDialog("下载成功", "提示", "确定"); frmMessage.Dispose(); } for (int inta = 0; inta < strArrSlabPlanData.Length; inta++) { //changeByYang20170205 板坯材料号保存 SaveCurrentSlabMaterials(strPlanNum, strArrSlabPlanData[inta]); } } catch (Exception e1) { System.Diagnostics.Debug.WriteLine(e1.Message); frmMessage frmMessage = new frmMessage(); frmMessage.ShowDialog(e1.Message, "提示", "确定"); frmMessage.Dispose(); } } /////////////////////////// //List<string[]> test = new List<string[]>(); ////缓存web查询信息 //test.Clear(); //String[] str1 = { "1", "23123123", "abc" }; //String[] str2 = { "2", "23456789", "abc" }; //String[] str3 = { "3", "11111111", "abc" }; //test.Add(str1); //test.Add(str2); //test.Add(str3); //int countX = test.Count; //label4.Text = "6"; //label6.Text = countX.ToString(); //for (int i = 0; i < countX; i++) //{ // int j = Convert.ToInt32(test[i][0]); // curPoint = new CoilPoint(Global.curFrame.KJH, j, 1); // addCoil(curPoint, test[i][1]); //} }
private void frmSxChange_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Escape) { Global.frmCurrent = this.Owner; this.Owner.Show(); this.Owner = null; this.Close(); } //else if (e.KeyCode == Keys.Right)//下一页 //{ // if (pageCurrent < pageCount) // { // pageCurrent++; // nCurrent = pageSize * (pageCurrent - 1); // LoadData(); // } //} //else if(e.KeyCode==Keys.Left)//上一页 //{ // if (pageCurrent > 1) // { // pageCurrent--; // nCurrent = pageSize * (pageCurrent - 1); // LoadData(); // } //} else if (e.KeyValue == 239)//环形键 { string data = Global.sUserId + ";"; data += System.DateTime.Now.ToString("yyyyMMddHHmmss") + ";"; data += Global.sBb + ";"; data += Global.sZyq + ";"; data += Global.curFrame.TCH + ";"; data += Global.curFrame.CH; if (Global.sDebug == "False") { frmMessage frmMessage = new frmMessage(); frmMessage.ShowDialog("是否确认启动行车作业?", "选择", "确定", "取消"); if (frmMessage.ret == true) { Business.SendText(Business.msg.Package("ZDUA04", data));//单车作业开始 } frmMessage.Dispose(); } } else if (e.KeyCode == Keys.Back)//DEL键 { if (Global.sDebug == "False") { string data = Global.sUserId + ";"; data += System.DateTime.Now.ToString("yyyyMMddHHmmss") + ";"; data += Global.sBb + ";"; data += Global.sZyq + ";"; data += Global.curFrame.TCH + ";"; data += Global.curFrame.CH + ";"; data += Global.curFrame.HCH;//行车号 frmMessage frmMessage = new frmMessage(); frmMessage.ShowDialog("是否确认暂停行车作业?", "选择", "确定", "取消"); if (frmMessage.ret == true) { Business.SendText(Business.msg.Package("ZDUA05", data));//单车作业暂停 } frmMessage.Dispose(); } } else if (e.KeyCode == Keys.F5)//F1键 { if (Global.sDebug == "False") { string data = Global.sUserId + ";"; data += System.DateTime.Now.ToString("yyyyMMddHHmmss") + ";"; data += Global.sBb + ";"; data += Global.sZyq + ";"; data += "15" + ";";//15号行车 data += System.DateTime.Now.ToString("yyyyMMddHHmmss"); Business.SendText(Business.msg.Package("ZDUA06", data));//控制15号行车紧停 } } else if (e.KeyCode == Keys.F3)//F3键 { if (Global.sDebug == "False") { string data = Global.sUserId + ";"; data += System.DateTime.Now.ToString("yyyyMMddHHmmss") + ";"; data += Global.sBb + ";"; data += Global.sZyq + ";"; data += "17" + ";";//17号行车 data += System.DateTime.Now.ToString("yyyyMMddHHmmss"); Business.SendText(Business.msg.Package("ZDUA06", data));//控制17号行车紧停 } } else if (e.KeyCode == Keys.F4)//F4键 { if (Global.sDebug == "False") { string data = Global.sUserId + ";"; data += System.DateTime.Now.ToString("yyyyMMddHHmmss") + ";"; data += Global.sBb + ";"; data += Global.sZyq + ";"; data += "21" + ";";//21号行车 data += System.DateTime.Now.ToString("yyyyMMddHHmmss"); Business.SendText(Business.msg.Package("ZDUA06", data));//控制21号行车紧停 } } else if (e.KeyCode == Keys.F2)//F2键 { if (Global.sDebug == "False") { string data = Global.sUserId + ";"; data += System.DateTime.Now.ToString("yyyyMMddHHmmss") + ";"; data += Global.sBb + ";"; data += Global.sZyq + ";"; data += "22" + ";";//22号行车 data += System.DateTime.Now.ToString("yyyyMMddHHmmss"); Business.SendText(Business.msg.Package("ZDUA06", data));//控制22号行车紧停 } } else if (e.KeyCode == Keys.Tab) { if (Global.curFrame.KZ == "空" || Global.curFrame.KZ == "拼") { frmDgv frmDgv = new frmDgv(); Global.frmCurrent = frmDgv; frmDgv.Owner = this; frmDgv.Show(); this.Hide(); } } }
private void btnRW_Click(object sender, EventArgs e) { frmMessage frmMessage = new frmMessage(); #if InterfaceTest if (textTCH.Text.Length < 3) #else if (textTCH.Text.Length != 4) #endif { frmMessage.ShowDialog("请输入正确的停车位编号!", "提示", "确定"); frmMessage.Dispose(); return; } bool bva = (cboQY.SelectedIndex == 0 && textKJH.Text.Length == 4 || cboQY.SelectedIndex > 0 && textKJH.Text.Length == 6); if (bva == false) { frmMessage.ShowDialog("请输入正确的车号!", "提示", "确定"); frmMessage.Dispose(); return; } if (cboFX.SelectedIndex == -1) { frmMessage.ShowDialog("请选择框架的方向!", "提示", "确定"); frmMessage.Dispose(); return; } if (cboKZ.SelectedIndex == -1) { frmMessage.ShowDialog("请选择框架的空重状态!", "提示", "确定"); frmMessage.Dispose(); return; } //changeByyangting20170518 //if (Category.SelectedIndex == -1) //{ // frmMessage.ShowDialog("请选择材料种类!", "提示", "确定"); // frmMessage.Dispose(); // return; //} if (Global.IsNumberic(textZZ.Text) == false) { frmMessage.ShowDialog("请输入载重!", "提示", "确定"); frmMessage.Dispose(); return; } string sDirection = ""; if (cboFX.SelectedIndex == 0) { sDirection = "N";//朝北 } else if (cboFX.SelectedIndex == 1) { sDirection = "S"; } #region changeByyang2170518 string whatCategory = ""; if (Category.SelectedIndex == 0) { whatCategory = "J";//钢卷 } else if (Category.SelectedIndex == 1) { whatCategory = "B";//板坯 } #endregion if (cboQY.Text != "") { //changeByyangting20170518 Global.curFrame = new Frame(textTCH.Text, cboQY.Text, textKJH.Text, "0000", cboKZ.Text, sDirection, textZZ.Text, iMaxRow, iSpace, textTDH.Text, whatCategory); } else { //changeByyangting20170518 Global.curFrame = new Frame(textTCH.Text, cboQY.Text, textKJH.Text, textKJH.Text, cboKZ.Text, sDirection, textZZ.Text, iMaxRow, iSpace, textTDH.Text, whatCategory); } Global.curFrame.status = FrameStatus.PT_CarArrive; string data = Global.sUserId + AllCode.stringInterfaceChar; data += System.DateTime.Now.ToString("yyyyMMddHHmmss") + AllCode.stringInterfaceChar; data += Global.sBb + AllCode.stringInterfaceChar; data += Global.sZyq + AllCode.stringInterfaceChar; data += textTCH.Text + AllCode.stringInterfaceChar; data += cboQY.Text + textKJH.Text + AllCode.stringInterfaceChar; if (cboKZ.SelectedIndex == 0) { data += "0" + AllCode.stringInterfaceChar;//空 } else if (cboKZ.SelectedIndex == 1) { data += "1" + AllCode.stringInterfaceChar;//重 } else { data += "9" + AllCode.stringInterfaceChar;//拼 } data += sDirection + AllCode.stringInterfaceChar; data += textZZ.Text + AllCode.stringInterfaceChar; if (textTDH.Text != "") { data += textTDH.Text;//提单号 } data += AllCode.stringInterfaceChar; #region changeByyangting20170518 data += whatCategory + AllCode.stringInterfaceChar; #endregion if (Global.sDebug == "False") { frmMessage.ShowDialog("是否进行" + Global.curFrame.KZ + "框架入位操作?", "选择", "确定", "取消"); if (frmMessage.ret == true) { Business.SendText(Business.msg.Package("ZDUA01", data));//发送入位电文 } frmMessage.Dispose(); } //btnRW.Visible = false; //btnScan.Visible = true; sGroove = ""; }
private void dgWtdCl_KeyUp(object sender, KeyEventArgs e) { if (curRow >= 0) { string jhh = Global.storage.jhh; string clh = dtCl.Rows[curRow]["CLH"].ToString(); string lbl = dtCl.Rows[curRow]["LBL"].ToString(); string qa = dtCl.Rows[curRow]["QA"].ToString(); string kw = dtCl.Rows[curRow]["KW"].ToString(); string sJs = dtCl.Rows[curRow]["JS"].ToString(); string sZl = dtCl.Rows[curRow]["ZL"].ToString(); string sFlag = dtCl.Rows[curRow]["FLAG"].ToString(); if (e.KeyCode == Keys.Enter) { if (dtCl.Rows[curRow]["WCFlag"].ToString() == "0" || dtCl.Rows[curRow]["WCFlag"].ToString() == "") { //弹出窗体,输入件数、重量 //条码字段为空,要求重新绑定条码 wtd2kw(clh, "", jhh, sJs, sZl); } else if (dtCl.Rows[curRow]["WCFlag"].ToString() == "1") { frmMessage frm = new frmMessage(); frm.ShowDialog("是否取消消帐材料" + clh, "提示"); if (frm.ret) { Storage.ClearWtdInScanStatus(jhh, lbl, sFlag); RefreshData(); curRow = -1; } frm.Dispose(); } } if (e.KeyCode == Keys.F2) { if (dtCl.Rows[curRow]["WCFlag"].ToString() == "1") { frmWtdInCl frmWtdInCl = new frmWtdInCl(); frmWtdInCl.ShowDialog(clh, lbl, kw, sJs, sZl); if (frmWtdInCl.ret) { kw = frmWtdInCl.sKw; sJs = frmWtdInCl.sJs; sZl = frmWtdInCl.sZL; lbl = frmWtdInCl.sLbl; dtCl.Rows[curRow]["KW"] = kw; dtCl.Rows[curRow]["JS"] = sJs; dtCl.Rows[curRow]["ZL"] = sZl; Storage.SaveCurrentKw("0000000000", jhh, "SGYS", kw); Storage.UpdateWtdInKw(jhh, lbl, Global.sKb + kw, sJs, sZl); RefreshData(); } frmWtdInCl.Dispose(); } } if (e.KeyCode == Keys.F22 || e.KeyCode == Keys.F23) { frmQuality frmQuality = new frmQuality(); Global.frmCurrent = frmQuality; frmQuality.Owner = this; this.Hide(); frmQuality.Show(clh, qa); } } }
private void frmDgv2_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F21) //环形键 { if (Global.curFrame.KZ == "重") //入库作业 { string data = Global.sUserId + AllCode.stringInterfaceChar; data += System.DateTime.Now.ToString("yyyyMMddHHmmss") + AllCode.stringInterfaceChar; data += Global.sBb + AllCode.stringInterfaceChar; //班别 data += Global.sZyq + AllCode.stringInterfaceChar; //作业区 data += Global.curFrame.TCH + AllCode.stringInterfaceChar; //停车号 data += Global.curFrame.QY + Global.curFrame.CH + AllCode.stringInterfaceChar; //车号 int cnt = 0; string msg = ""; foreach (KeyValuePair <CoilPoint, Coil> kv in Global.coils) { Coil c = kv.Value; if (c.clh != "") { msg += c.p.barcode.Substring(c.p.barcode.Length - 3, 2) + AllCode.stringInterfaceChar; //层号 // msg += c.p.barcode + AllCode.stringInterfaceChar; //层号 //msg += c.zzdy + AllCode.stringInterfaceChar; //制造单元 msg += c.clh + AllCode.stringInterfaceChar; //材料号 //msg += c.scantime + AllCode.stringInterfaceChar; //扫描时间 // msg += c.qa + AllCode.stringInterfaceChar; //质量代码 // msg += c.scanflag.ToString() + AllCode.stringInterfaceChar; //处理标志 // msg += c.wide + AllCode.stringInterfaceChar; //钢卷宽度 //msg += c.diameter + AllCode.stringInterfaceChar; //钢卷内径 cnt++; } } if (cnt > 0) { data += cnt.ToString() + AllCode.stringInterfaceChar;//材料数量 if (msg.Length > 0) { msg = msg.Substring(0, msg.Length - 1); } data += msg; data += AllCode.stringInterfaceChar; if (Global.sDebug == "False") { frmMessage frmMessage = new frmMessage(); frmMessage.ShowDialog("是否上传入库手持扫描结果?", "选择", "确定", "取消"); if (frmMessage.ret == true) { Business.SendText(Business.msg.Package("ZDUA17", data));//入库手持扫描完成 } frmMessage.Dispose(); } } } else//出库作业 { string data = Global.sUserId + ";"; data += System.DateTime.Now.ToString("yyyyMMddHHmmss") + ";"; data += Global.sBb + ";"; data += Global.sZyq + ";"; data += Global.curFrame.TCH + ";"; data += Global.curFrame.QY + Global.curFrame.CH + ";"; int cnt = 0; string msg = ""; foreach (KeyValuePair <CoilPoint, Coil> kv in Global.coils) { Coil c = kv.Value; if (c.clh != "") { msg += c.p.barcode + ";"; //逻辑位置 msg += c.zzdy + ";"; //制造单元 msg += c.clh + ";"; //材料号 msg += c.scantime + ";"; //扫描时间 msg += c.qa + ";"; //质量代码 msg += c.wide + ";"; //钢卷宽度 msg += c.diameter + ";"; //钢卷内径 cnt++; } } if (cnt > 0) { data += cnt.ToString() + ";"; if (msg.Length > 0) { msg = msg.Substring(0, msg.Length - 1); } data += msg; if (Global.sDebug == "False") { frmMessage frmMessage = new frmMessage(); frmMessage.ShowDialog("是否上传出库手持扫描结果?", "选择", "确定", "取消"); if (frmMessage.ret == true) { Business.SendText(Business.msg.Package("ZDUA07", data));//出库手持扫描完成 } frmMessage.Dispose(); } } } if (Global.curFrame.KZ == "重") { frmSxChange frmSxChange = new frmSxChange(); Global.frmCurrent = frmSxChange; frmSxChange.Owner = this; frmSxChange.Show(); this.Hide(); } } else if (e.KeyCode == Keys.Escape) { Global.frmCurrent = this.Owner; this.Owner.Show(); this.Owner = null; this.Close(); } else if (e.KeyCode == Keys.Tab) { if (Global.curFrame.KZ == "重") { frmSxChange frmSxChange = new frmSxChange(); Global.frmCurrent = frmSxChange; frmSxChange.Owner = this; frmSxChange.Show(); this.Hide(); } } else if (e.KeyCode == Keys.F5)//F1键 { if (Global.sDebug == "False") { string data = Global.sUserId + ";"; data += System.DateTime.Now.ToString("yyyyMMddHHmmss") + ";"; data += Global.sBb + ";"; data += Global.sZyq + ";"; data += "15" + ";";//15号行车 data += System.DateTime.Now.ToString("yyyyMMddHHmmss"); Business.SendText(Business.msg.Package("ZDUA06", data));//控制15号行车紧停 } } else if (e.KeyCode == Keys.F3)//F3键 { if (Global.sDebug == "False") { string data = Global.sUserId + ";"; data += System.DateTime.Now.ToString("yyyyMMddHHmmss") + ";"; data += Global.sBb + ";"; data += Global.sZyq + ";"; data += "17" + ";";//17号行车 data += System.DateTime.Now.ToString("yyyyMMddHHmmss"); Business.SendText(Business.msg.Package("ZDUA06", data));//控制17号行车紧停 } } else if (e.KeyCode == Keys.F4)//F4键 { if (Global.sDebug == "False") { string data = Global.sUserId + ";"; data += System.DateTime.Now.ToString("yyyyMMddHHmmss") + ";"; data += Global.sBb + ";"; data += Global.sZyq + ";"; data += "21" + ";";//21号行车 data += System.DateTime.Now.ToString("yyyyMMddHHmmss"); Business.SendText(Business.msg.Package("ZDUA06", data));//控制21号行车紧停 } } else if (e.KeyCode == Keys.F2)//F2键 { if (Global.sDebug == "False") { string data = Global.sUserId + ";"; data += System.DateTime.Now.ToString("yyyyMMddHHmmss") + ";"; data += Global.sBb + ";"; data += Global.sZyq + ";"; data += "22" + ";";//22号行车 data += System.DateTime.Now.ToString("yyyyMMddHHmmss"); Business.SendText(Business.msg.Package("ZDUA06", data));//控制22号行车紧停 } } else if (e.KeyCode == Keys.F22 || e.KeyCode == Keys.F23) { if (curPoint.row >= 0) { if (Global.coils.ContainsKey(curPoint)) { Coil coil = Global.coils[curPoint]; string clh = coil.clh; string qa = coil.qa; if (clh != "") { frmQuality frmQuality = new frmQuality(); Global.frmCurrent = frmQuality; frmQuality.Owner = this; this.Hide(); frmQuality.Show(clh, qa, curPoint); } coil = null; } } } }