public static void UpdateImpWcjs() { //string sql = "select A.JHH,A.ZFH,count(*) WCJS,sum(B.MZ) WCMZ,sum(B.JZ) WCJZ from ImportStorageOrder A,ImportStorageAcceptOrder B "; //sql += "where A.ZFH=B.ZFH and A.JHH=B.JHH and B.WCFlag=2 group by A.JHH,A.ZFH"; //DataTable dt = SqlCe.ExecuteQuery(sql); //for (int i = 0; i < dt.Rows.Count; i++) //{ // SqlCe.ExecuteNonQuery("update ImportStorageOrder set WCJS=" + dt.Rows[i]["WCJS"].ToString() + ",WCMZ=" + dt.Rows[i]["WCMZ"].ToString() + ",WCJZ=" + dt.Rows[i]["WCJZ"].ToString() + " where ZFH='" + dt.Rows[i]["ZFH"].ToString() + "' and JHH='" + dt.Rows[i]["JHH"].ToString() + "'"); //} string sql = "select A.JHH,A.MAKE,count(*) WCJS,sum(B.MZ) WCMZ,sum(B.JZ) WCJZ from ImportStoragePlan A,ImportStorageAcceptOrder B "; sql += "where A.JHH=B.JHH and A.Make=B.Make and B.WCFlag=2 group by A.JHH,A.Make"; DataTable dt = SqlCe.ExecuteQuery(sql); for (int i = 0; i < dt.Rows.Count; i++) { SqlCe.ExecuteNonQuery("update ImportStoragePlan set WCJS=" + dt.Rows[i]["WCJS"].ToString() + ",WCMZ=" + dt.Rows[i]["WCMZ"].ToString() + ",WCJZ=" + dt.Rows[i]["WCJZ"].ToString() + " where JHH='" + dt.Rows[i]["JHH"].ToString() + "' and Make='" + dt.Rows[i]["Make"].ToString() + "'"); } dt.Dispose(); sql = "delete from ImportStorageAcceptOrder where exists(select * from ImportStoragePlan where JS=WCJS and JHH=ImportStorageAcceptOrder.JHH)"; SqlCe.ExecuteNonQuery(sql); //sql = "delete from ImportStorageOrder where exists(select * from ImportStoragePlan where JS=WCJS and JHH=ImportStorageOrder.JHH)"; //SqlCe.ExecuteNonQuery(sql); sql = "delete from ImportStoragePlan where JS=WCJS"; SqlCe.ExecuteNonQuery(sql); }
public static void GetExpAccOrderByPageResults(IAsyncResult ar) { ManualResetEvent ent; ent = (ManualResetEvent)ar.AsyncState; try { DataTable dt = service.EndStore_GetExpAccOrderByPage(ar); bool bval = dt.Rows.Count > 0; if (bval) { for (int i = 0; i < dt.Rows.Count; i++) { string jhh = dt.Rows[i]["PLAN_NO"].ToString(); string make = dt.Rows[i]["MANUFACT_UNIT_CODE"].ToString(); string ckb = dt.Rows[i]["OUTSTORE_ID"].ToString(); string zfh = dt.Rows[i]["CONFIRM_NO"].ToString(); string clh = dt.Rows[i]["MAT_NO"].ToString(); string jz = dt.Rows[i]["NET_WEIGHT"].ToString(); string mz = dt.Rows[i]["GROSS_WEIGHT"].ToString(); //string kw = dt.Rows[i]["KW"].ToString(); string kw = ""; string wcflag = "0"; string ilong = dt.Rows[i]["LENGTH"].ToString(); string iwidth = dt.Rows[i]["WIDTH"].ToString(); string iheight = dt.Rows[i]["THICK"].ToString(); //string fdh = dt.Rows[i]["FDH"].ToString(); string fdh = ""; string scantime = ""; //string zph = dt.Rows[i]["ZPH"].ToString(); string zph = ""; string lh = dt.Rows[i]["PONO"].ToString().Trim(); string clh2 = dt.Rows[i]["MAT_NO2"].ToString(); string pmdm = dt.Rows[i]["GOODS_CODE"].ToString(); string pm = dt.Rows[i]["GOODS_NAME"].ToString(); string hth = dt.Rows[i]["CONTRACT_ID"].ToString(); string yhsj = dt.Rows[i]["REQUIRE_TIME"].ToString(); string sql = "insert into ExportStorageAcceptOrder (JHH,CKB,ZFH,CLH,JZ,MZ,KW,WCFlag,Long,Width,Height,FDH,SCANTIME,ZPH,LH,CLH2,Make,PMDM,PM,HTH,YHSJ) "; sql += "values(" + valuesql("C", jhh) + valuesql("C", ckb) + valuesql("C", zfh) + valuesql("C", clh) + valuesql("N", jz) + valuesql("N", mz) + valuesql("C", kw) + valuesql("N", wcflag); sql += valuesql("C", ilong) + valuesql("C", iwidth) + valuesql("C", iheight) + valuesql("C", fdh) + valuesql("C", scantime) + valuesql("C", zph) + valuesql("C", lh); sql += valuesql("C", clh2) + valuesql("C", make) + valuesql("C", pmdm) + valuesql("C", pm) + valuesql("C", hth) + valuesql("D", yhsj); sql = sql.Substring(0, sql.Length - 1); sql += ")"; SqlCe.ExecuteNonQuery(sql); } ccls += dt.Rows.Count; bDownSucc = true; } ent.Set(); } catch { } }
public static void GetExpPlanByPageResults(IAsyncResult ar) { ManualResetEvent ent; ent = (ManualResetEvent)ar.AsyncState; try { DataTable dt = service.EndStore_GetExpPlanByPage(ar); bool bval = dt.Rows.Count > 0; if (bval) { for (int i = 0; i < dt.Rows.Count; i++) { string jhh = dt.Rows[i]["PLAN_NO"].ToString(); string make = dt.Rows[i]["MANUFACT_UNIT_CODE"].ToString(); string gdh = dt.Rows[i]["SO_NO"].ToString(); string cm = dt.Rows[i]["SHIP_CNAME"].ToString(); string shdw = dt.Rows[i]["RECEIVE_UNIT"].ToString(); string jhdd = dt.Rows[i]["DELIVERY_ADDRESS"].ToString(); string yb = dt.Rows[i]["ClothShelter"].ToString(); string jz = dt.Rows[i]["NET_WEIGHT"].ToString(); string mz = dt.Rows[i]["GROSS_WEIGHT"].ToString(); string js = dt.Rows[i]["PIECES"].ToString(); string ysfs = dt.Rows[i]["TRANS_TYPE"].ToString(); string wcjs = "0"; string wcjz = "0"; string cph = dt.Rows[i]["SHIP_LOT_NUM"].ToString(); string wcmz = "0"; string ckb = dt.Rows[i]["OUTSTORE_ID"].ToString(); string sql = "delete from ExportStorageAcceptOrder where jhh='" + jhh + "' and make='" + make + "'"; SqlCe.ExecuteNonQuery(sql); sql = "delete from ExportStoragePlan where jhh='" + jhh + "' and make='" + make + "'"; SqlCe.ExecuteNonQuery(sql); sql = "insert into ExportStoragePlan(JHH,GDH,CM,SHDW,JHDD,YB,JZ,MZ,JS,YSFS,WCJS,WCMZ,CPH,WCJZ,CKB,Make) "; sql += "values(" + valuesql("C", jhh) + valuesql("C", gdh) + valuesql("C", cm) + valuesql("C", shdw) + valuesql("C", jhdd) + valuesql("C", yb); sql += valuesql("N", jz) + valuesql("N", mz) + valuesql("N", js) + valuesql("C", ysfs) + valuesql("N", wcjs); sql += valuesql("N", wcmz) + valuesql("C", cph) + valuesql("N", wcjz) + valuesql("C", ckb) + valuesql("C", make); sql = sql.Substring(0, sql.Length - 1); sql += ")"; SqlCe.ExecuteNonQuery(sql); } cjhs += dt.Rows.Count; bDownSucc = true; } ent.Set(); } catch { } }
public static void DeleteExpPlan(string jhh, string make) { string sql = "delete from ExportStorageAcceptOrder where JHH='" + jhh + "' and Make='" + make + "'"; SqlCe.ExecuteNonQuery(sql); //sql = "delete from ExportStorageOrder where JHH='" + jhh + "' and Make='" + make + "'"; //SqlCe.ExecuteNonQuery(sql); sql = "delete from ExportStoragePlan where JHH='" + jhh + "' and Make='" + make + "'"; SqlCe.ExecuteNonQuery(sql); }
public static void ClearWtdInScanStatus(string jhh, string lbl, string flag) { string sql = ""; if (flag == "") { ClearWtdOutScanStatus(jhh, lbl); } else { sql = "delete from wtddetail where WTDH='" + jhh + "' and LBL='" + lbl + "'"; SqlCe.ExecuteNonQuery(sql); } }
protected override void AnalyzeDatagram(byte[] datagramBytes) { if (datagramBytes.Length > 0) { string gram = System.Text.Encoding.Default.GetString(datagramBytes, 0, datagramBytes.Length); if (gram != "##0025UAZD00alive;9999@@") { string sql = "insert into RecvMsg(Msg,Done,Lock,RecvTime,ID) values('" + gram.Replace("'", "''") + "',0,0,getDate(),newID())"; SqlCe.ExecuteNonQuery(sql); } base.OnShowDebugMessage(gram); //base.OnDatagramAccepted(); } }
public static void SetCLQuality(string clh, string qa, bool inflag) { string sql; if (inflag) { sql = "update ImportStorageAcceptOrder set QA='" + qa + "' where CLH='" + clh + "'"; SqlCe.ExecuteNonQuery(sql); } else { sql = "update ExportStorageAcceptOrder set QA='" + qa + "' where CLH='" + clh + "'"; SqlCe.ExecuteNonQuery(sql); } }
public static void GetImpPlanByPageResults(IAsyncResult ar) { ManualResetEvent ent; ent = (ManualResetEvent)ar.AsyncState; try { DataTable dt = service.EndStore_GetImpPlanByPage(ar); bool bval = dt.Rows.Count > 0; if (bval) { for (int i = 0; i < dt.Rows.Count; i++) { string jhh = dt.Rows[i]["PLAN_NO"].ToString(); string make = dt.Rows[i]["MANUFACT_UNIT_CODE"].ToString(); string jz = dt.Rows[i]["NET_WEIGHT"].ToString(); string mz = dt.Rows[i]["GROSS_WEIGHT"].ToString(); string js = dt.Rows[i]["PIECES"].ToString(); string wcjs = "0"; string wcjz = "0"; string yhsj = dt.Rows[i]["PLAN_TIME"].ToString(); string wcmz = "0"; string rkb = dt.Rows[i]["INSTORE_ID"].ToString(); string sql = "delete from ImportStorageAcceptOrder where jhh='" + jhh + "' and make='" + make + "'"; SqlCe.ExecuteNonQuery(sql); sql = "delete from ImportStoragePlan where jhh='" + jhh + "' and make='" + make + "'"; SqlCe.ExecuteNonQuery(sql); sql = "insert into ImportStoragePlan(JHH,JZ,MZ,JS,WCJS,WCJZ,YHSJ,WCMZ,RKB,Make) "; sql += "values(" + valuesql("C", jhh) + valuesql("N", jz) + valuesql("N", mz) + valuesql("N", js) + valuesql("N", wcjs); sql += valuesql("N", wcjz) + valuesql("D", yhsj) + valuesql("N", wcmz) + valuesql("C", rkb) + valuesql("C", make); sql = sql.Substring(0, sql.Length - 1); sql += ")"; SqlCe.ExecuteNonQuery(sql); } rjhs += dt.Rows.Count; bDownSucc = true; } ent.Set(); } catch { } }
//public static string GetCurrentKw(string jhh) //{ // string kw = ""; // string sql = "select KW from ZF2KW where JHH='" + jhh + "'"; // DataTable dt = SqlCe.ExecuteQuery(sql); // if (dt.Rows.Count > 0) // { // kw = dt.Rows[0]["KW"].ToString(); // } // dt.Dispose(); // return kw; //} public static void SaveCurrentKw(string zfh, string jhh, string make, string kw) { string sql = "select * from ZF2KW where JHH='" + jhh + "' and Make='" + make + "' and ZFH='" + zfh + "'"; DataTable dt = SqlCe.ExecuteQuery(sql); if (dt.Rows.Count > 0) { sql = "update ZF2KW set KW='" + kw + "' where JHH='" + jhh + "' and Make='" + make + "' and ZFH='" + zfh + "'"; } else { sql = "insert into ZF2KW (ZFH,JHH,Make,KW) values ('" + zfh + "','" + jhh + "','" + make + "','" + kw + "')"; } dt.Dispose(); SqlCe.ExecuteNonQuery(sql); }
public static void SetWtdInScanStatus(string jhh, string clh, string kw, string js, string zl, string now, string lbl) { string sql = "select * from wtddetail where wtdh='" + jhh + "' and clh='" + clh + "'"; DataTable dt = SqlCe.ExecuteQuery(sql); if (dt.Rows.Count > 0) { sql = "update wtddetail set js=" + js + ",zl=" + zl + ",kw='" + kw + "',scantime='" + now + "',wcflag=1,lbl='" + lbl + "' where wtdh='" + jhh + "' and clh='" + clh + "'"; SqlCe.ExecuteNonQuery(sql); } else { sql = "insert into wtddetail (wtdh,clh,js,zl,kw,scantime,wcflag,lbl,flag) values('" + jhh + "','" + clh + "'," + js + "," + zl + ",'" + kw + "','" + now + "',1,'" + lbl + "','A')"; SqlCe.ExecuteNonQuery(sql); } dt.Dispose(); }
public static void FinishExpScanCL(string cph, string jhh, string make, string zfh) { string sql = "update ExportStorageAcceptOrder set WCFlag=2 where WCFlag=1 and CKB='" + Global.sKb + "' "; if (cph != "") { sql += "and exists(select * from ExportStoragePlan B where ExportStorageAcceptOrder.JHH=B.JHH and ExportStorageAcceptOrder.Make=B.Make and B.CPH='" + cph + "') "; } if (jhh != "") { sql += "and JHH='" + jhh + "' and Make='" + make + "' "; } if (zfh != "") { sql += "and ZFH='" + zfh + "'"; } SqlCe.ExecuteNonQuery(sql); }
private void btnDown_Click(object sender, EventArgs e) { if (txtJhh.Text != "") { //string gram = cboMake.Text + ";" + txtJhh.Text + ";" + Global.sKb;//调试 string gram = txtJhh.Text + ";" + Global.sKb; //Business.SendText(Business.msg.Package("ZDWX51", gram)); Business.SendText(Business.msg.Package("ZDUA10", gram)); } else { SqlCe.ExecuteNonQuery("delete ImportStoragePlan"); SqlCe.ExecuteNonQuery("delete ImportStorageAcceptOrder"); SqlCe.ExecuteNonQuery("delete ExportStoragePlan"); SqlCe.ExecuteNonQuery("delete ExportStorageAcceptOrder"); SqlCe.ExecuteNonQuery("delete FrameDetail"); //string gram = cboMake.Text +";All;" + Global.sKb;//调试 string gram = "ALL;" + Global.sKb; //Business.SendText(Business.msg.Package("ZDWX51", gram)); Business.SendText(Business.msg.Package("ZDUA10", gram)); //gram = "##0063UAZD04;0;0;117;919;S;20141022173429;20141022173429;4F35@@"; //string sql = "insert into RecvMsg(Msg,Done,Lock,RecvTime,ID) values('" + gram.Replace("'", "''") + "',0,0,getDate(),newID())"; //SqlCe.ExecuteNonQuery(sql); } btnDown.Enabled = false; Business.callcls = 0; Business.calljhs = 0; Business.ccls = 0; Business.cjhs = 0; Business.rallcls = 0; Business.ralljhs = 0; Business.rcls = 0; Business.rjhs = 0; showMessage("等待UACS反馈"); }
public static void FinishImpScanCL(string jhh, string make) { string sql = "update ImportStorageAcceptOrder set WCFlag=2 where WCFlag=1 and JHH='" + jhh + "' and Make='" + make + "'"; SqlCe.ExecuteNonQuery(sql); }
public static void ClearZF2KW() { string sql = "delete from ZF2KW"; SqlCe.ExecuteNonQuery(sql); }
public static void ClearImpScanStatus(string jhh, string make, string zfh, string clh) { string sql = "update ImportStorageAcceptOrder set WCFlag=0,SCANTIME='',KW='',CH='' where CLH='" + clh + "' and ZFH='" + zfh + "' and JHH='" + jhh + "' and Make='" + make + "'"; SqlCe.ExecuteNonQuery(sql); }
public static void ClearWtdOutScanStatus(string jhh, string lbl) { string sql = "update wtddetail set WCFlag=0,SCANTIME='',lbl=clh where LBL='" + lbl + "' and WTDH='" + jhh + "'"; SqlCe.ExecuteNonQuery(sql); }
private bool SaveDetailTbl() { string sql = ""; string nvsql = ""; int looplength = _fields.Length - _loopindex - 1; string[] whsql = new string[_loopnum]; sql = " where 1=1 "; for (int i = 0; i < _loopindex; i++) { if (_fields[i].IsPK == 1) { nvsql = namevaluesql(_fields[i].FieldType, _fields[i].FieldName, _content[i]); if (nvsql != "") { sql += "and " + nvsql + " "; } } } for (int i = 0; i < _loopnum; i++) { whsql[i] = sql; for (int j = _loopindex + 1; j < _fields.Length; j++) { if (_fields[j].IsPK == 1) { nvsql = namevaluesql(_fields[j].FieldType, _fields[j].FieldName, _content[j + i * looplength]); if (nvsql != "") { whsql[i] += "and " + nvsql + " "; } } } } if (_operation == "D") { for (int i = 0; i < _loopnum; i++) { sql = "delete from " + _dtablename + whsql[i]; try { SqlCe.ExecuteNonQuery(sql); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.Message); System.Diagnostics.Debug.WriteLine(sql); SqlCe.ExecuteNonQuery("insert into error values('" + sql.Replace("'", "''") + "','" + ex.Message.Replace("'", "''") + "',getDate())"); } } return(true); } for (int i = 0; i < _loopnum; i++) { bool bExist = false; DataTable dt = SqlCe.ExecuteQuery("select * from " + _dtablename + whsql[i]); if (dt.Rows.Count > 0) { bExist = true; } dt.Dispose(); if (bExist == false) { sql = "insert into " + _dtablename + "("; for (int j = 0; j < _loopindex; j++) { if ((_fields[j].IsPK == 1 || _fields[j].IsPK == 2) && _fields[j].FieldType != "") { sql += _fields[j].FieldName + ","; } } for (int j = _loopindex + 1; j < _fields.Length; j++) { if (_fields[j].FieldType != "") { sql += _fields[j].FieldName + ","; } } sql = sql.Substring(0, sql.Length - 1); sql += ") values ("; for (int j = 0; j < _loopindex; j++) { if ((_fields[j].IsPK == 1 || _fields[j].IsPK == 2) && _fields[j].FieldType != "") { sql += valuesql(_fields[j].FieldType, _content[j]); } } for (int j = _loopindex + 1; j < _fields.Length; j++) { if (_fields[j].FieldType != "") { sql += valuesql(_fields[j].FieldType, _content[j + i * looplength]); } } sql = sql.Substring(0, sql.Length - 1); sql += ")"; try { SqlCe.ExecuteNonQuery(sql); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.Message); System.Diagnostics.Debug.WriteLine(sql); SqlCe.ExecuteNonQuery("insert into error values('" + sql.Replace("'", "''") + "','" + ex.Message.Replace("'", "''") + "',getDate())"); } } else { sql = "update " + _dtablename + " set "; for (int j = 0; j < _loopindex; j++) { if (_fields[j].IsPK == 2 && _fields[j].FieldType != "") { nvsql = namevaluesql(_fields[j].FieldType, _fields[j].FieldName, _content[j]); if (nvsql != "") { sql += nvsql + ","; } } } for (int j = _loopindex + 1; j < _fields.Length; j++) { if (_fields[j].IsPK == 0 && _fields[j].FieldType != "") { nvsql = namevaluesql(_fields[j].FieldType, _fields[j].FieldName, _content[j + i * looplength]); if (nvsql != "") { sql += nvsql + ","; } } } sql = sql.Substring(0, sql.Length - 1); sql += whsql[i]; try { SqlCe.ExecuteNonQuery(sql); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.Message); System.Diagnostics.Debug.WriteLine(sql); SqlCe.ExecuteNonQuery("insert into error values('" + sql.Replace("'", "''") + "','" + ex.Message.Replace("'", "''") + "',getDate())"); } } } return(true); }
public static void SetExpScanStatus(string jhh, string make, string zfh, string clh, string now) { string sql = "update ExportStorageAcceptOrder set WCFlag=1,SCANTIME='" + now + "' where CLH='" + clh + "' and ZFH='" + zfh + "' and JHH='" + jhh + "' and Make='" + make + "'"; SqlCe.ExecuteNonQuery(sql); }
public static void ClearExpFrameLayout(string tch) { string sql = "delete from FrameLayerOutExp where ParkID='" + tch + "'"; SqlCe.ExecuteNonQuery(sql); }
public static void RecvData(string Datagram) { if (msg.UnPackage(Datagram)) { switch (msg.MessageID) { //case "WXZD03": // SqlCe.ExecuteNonQuery("delete from FrameDetail where kjh='" + msg.ItemValue("KJH") + "' and stamp!='" + msg.ItemValue("stamp") + "' "); // break; case "UAZD02": SqlCe.ExecuteNonQuery("delete from FrameLayout where FrameID='" + msg.ItemValue("FrameID") + "' and ParkID='" + msg.ItemValue("ParkID") + "' and Mold='" + msg.ItemValue("Mold") + "'"); break; case "UAZD03": SqlCe.ExecuteNonQuery("delete from FrameLayoutExp where FrameID='" + msg.ItemValue("FrameID") + "' and ParkID='" + msg.ItemValue("ParkID") + "'"); break; case "UAZD05": if (Global.curFrame != null) { Global.curFrame.HCH = msg.ItemValue("HCH"); } SqlCe.ExecuteNonQuery("delete from TaskOrder where HCH='" + msg.ItemValue("HCH") + "'"); break; default: break; } msg.Save(); switch (msg.MessageID) { //case "WXZD03": // InvokeMethod(Global.frmCurrent, "RefreshFrameInfo", new object[] { }); // break; //case "WXZD1B": // Global.sZdh = msg.ItemValue("ch"); // string dtRemote = msg.ItemValue("sj"); // if (dtRemote != "") // { // SystemTime st = new SystemTime(); // st.wYear = ushort.Parse(dtRemote.Substring(0, 4)); // st.wMonth = ushort.Parse(dtRemote.Substring(4, 2)); // st.wDay = ushort.Parse(dtRemote.Substring(6, 2)); // st.Whour = ushort.Parse(dtRemote.Substring(8, 2)); // st.wMinute = ushort.Parse(dtRemote.Substring(10, 2)); // st.wSecond = ushort.Parse(dtRemote.Substring(12, 2)); // SetLocalTime(st); // } // break; //case "WXZD1E": // SqlCe.ExecuteNonQuery("delete from SendMsg where GramID='" + msg.ItemValue("dwh") + "' and GramTime='" + msg.ItemValue("sj") + "'"); // break; case "UAZD01": //UACS反馈信息 string sMsg = ""; switch (msg.ItemValue("Message_No")) { case "PT_CarArrive": sMsg = "框架入位"; SetCurFrameStatus(FrameStatus.PT_CarArrive); if (Global.curFrame != null) { Global.curFrame.CarArrived = true; } InvokeMethod(Global.frmCurrent, "showDialogMsg", new object[] { "停车位" + msg.ItemValue("Parking_No") + "框架已经入位!" }); break; case "PT_LaserStart": sMsg = "扫描启动"; SetCurFrameStatus(FrameStatus.PT_LaserStart); break; case "PT_LaserEnd": SetCurFrameStatus(FrameStatus.PT_LaserEnd); sMsg = "扫描结束"; break; case "PS_In_PortableEnd": sMsg = "入库上传"; SetCurFrameStatus(FrameStatus.PS_In_PortableEnd); InvokeMethod(Global.frmCurrent, "showDialogMsg", new object[] { "入库框架材料布局信息已经上传!" }); break; case "PT_CranePlanCreated": SetCurFrameStatus(FrameStatus.PT_CranePlanCreated); sMsg = "生成计划"; break; case "PS_OperateStart": sMsg = "作业开始"; SetCurFrameStatus(FrameStatus.PS_OperateStart); break; case "PS_OperatePause": sMsg = "作业暂停"; SetCurFrameStatus(FrameStatus.PS_OperatePause); break; case "PS_Out_PortableEnd": sMsg = "出库上传"; SetCurFrameStatus(FrameStatus.PS_Out_PortableEnd); break; case "PS_CarLeave": sMsg = "框架离位"; SetCurFrameStatus(FrameStatus.PS_CarLeave); if (Global.curFrame != null) { //Global.curFrame.CarArrived = false; if (Global.curFrame.KZ == "空" || Global.curFrame.KZ == "拼") { ClearExpFrameLayout(msg.ItemValue("Parking_No")); } } break; case "PT_OperateFini": sMsg = "作业完成"; SetCurFrameStatus(FrameStatus.PT_OperateFini); ClearTaskOrder(msg.ItemValue("Parking_No")); if (Global.curFrame != null) { if (Global.curFrame.KZ == "重") { ClearImpFrameLayout(msg.ItemValue("Parking_No")); } } break; case "FeedBack4CheckBank": sMsg = "盘库信息已经接收"; InvokeMethod(Global.frmCurrent, "showDialogMsg", new object[] { sMsg }); break; } if (sMsg != "") { if (msg.ItemValue("Ret") == "-1") { sMsg += "异常"; sMsg += msg.ItemValue("Message"); } else if (msg.ItemValue("Ret") == "1") { sMsg += "正常"; } InvokeMethod(Global.frmCurrent, "showMessage", new object[] { sMsg }); } break; case "UAZD02": //入库配载图 string mold = msg.ItemValue("Mold"); if (mold == "20") //激光扫描结果 { if (Global.curFrame != null) { Global.curFrame.status = FrameStatus.PT_LaserEnd; if (Global.frmCurrent.Name == "FrameIn") { if (Global.curFrame.KZ == "重") { InvokeMethod(Global.frmCurrent, "to_frmDgv", new object[] { }); } } else if (Global.frmCurrent.Name == "frmDgv") { if (Global.curFrame.KZ == "重") { //暂时屏蔽激光扫描功能 //InvokeMethod(Global.frmCurrent, "LoadData", new object[] { }); } } } } break; case "UAZD03": //出库配载图 if (Global.curFrame != null) { if (Global.curFrame.KZ == "空" || Global.curFrame.KZ == "拼") { InvokeMethod(Global.frmCurrent, "to_frmSxChange", new object[] { }); } } break; case "UAZD04": rstamp = msg.ItemValue("stamp"); ralljhs = int.Parse(msg.ItemValue("RJHS")); rallcls = int.Parse(msg.ItemValue("RCLS")); rjhs = 0; rcls = 0; cstamp = msg.ItemValue("stamp"); calljhs = int.Parse(msg.ItemValue("CJHS")); callcls = int.Parse(msg.ItemValue("CCLS")); cjhs = 0; ccls = 0; ThreadStart ts = new ThreadStart(DownLoadPlan); td = new Thread(ts); td.Start(); break; case "UAZD05": InvokeMethod(Global.frmCurrent, "LoadPlan", new object[] { }); break; default: break; } } }
public static void ClearTaskOrder(string tch) { string sql = "delete from TaskOrder where TCH='" + tch + "'"; SqlCe.ExecuteNonQuery(sql); }
public static void SetWtdOutScanStatus(string jhh, string clh, string wjs, string wzl, string now) { string sql = "update wtddetail set WCFlag=1,SCANTIME='" + now + "',wjs=" + wjs + ",wzl=" + wzl + " where CLH='" + clh + "' and WTDH='" + jhh + "'"; SqlCe.ExecuteNonQuery(sql); }
public static void SendText(string datagram) { string data = datagram.Replace("'", "''"); SqlCe.ExecuteNonQuery("insert into SendMsg(Msg,ID,SendTime,Lock,Done) values('" + "##" + data + "@@" + "',newID(),getDate(),0,0)"); }
public static void UpdateImpKw(string jhh, string make, string zfh, string clh, string kw) { string sql = "update ImportStorageAcceptOrder set KW='" + kw + "' where ZFH='" + zfh + "' and JHH='" + jhh + "' and Make='" + make + "' and CLH='" + clh + "'"; SqlCe.ExecuteNonQuery(sql); }
public static void UpdateWtdInKw(string jhh, string lbl, string kw, string js, string zl) { string sql = "update wtddetail set KW='" + kw + "',JS=" + js + ",ZL=" + zl + " where WTDH='" + jhh + "' and LBL='" + lbl + "'"; SqlCe.ExecuteNonQuery(sql); }
private bool SaveMainTbl() { string sql = ""; string nvsql = ""; int fldCnt = (_loopindex >= 0) ? _loopindex : _fields.Length; string whsql = " where 1=1 "; for (int i = 0; i < fldCnt; i++) { if (_fields[i].IsPK == 1) { nvsql = namevaluesql(_fields[i].FieldType, _fields[i].FieldName, _content[i]); if (nvsql != "") { whsql += "and " + nvsql + " "; } } } if (_operation == "D") { sql = "delete from " + _mtablename + whsql; try { SqlCe.ExecuteNonQuery(sql); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.Message); System.Diagnostics.Debug.WriteLine(sql); SqlCe.ExecuteNonQuery("insert into error values('" + sql.Replace("'", "''") + "','" + ex.Message.Replace("'", "''") + "',getDate())"); } return(true); } DataTable dt = SqlCe.ExecuteQuery("select * from " + _mtablename + whsql); bool bExist = false; if (dt.Rows.Count > 0) { bExist = true; } dt.Dispose(); if (bExist == false) { sql = "insert into " + _mtablename + "("; for (int i = 0; i < fldCnt; i++) { if (_fields[i].FieldType != "") { sql += _fields[i].FieldName + ","; } } sql = sql.Substring(0, sql.Length - 1); sql += ") values ("; for (int j = 0; j < fldCnt; j++) { sql += valuesql(_fields[j].FieldType, _content[j]); } sql = sql.Substring(0, sql.Length - 1); sql += ")"; try { SqlCe.ExecuteNonQuery(sql); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.Message); System.Diagnostics.Debug.WriteLine(sql); SqlCe.ExecuteNonQuery("insert into error values('" + sql.Replace("'", "''") + "','" + ex.Message.Replace("'", "''") + "',getDate())"); } } else { sql = "update " + _mtablename + " set "; for (int j = 0; j < fldCnt; j++) { if (_fields[j].IsPK == 0 || _fields[j].IsPK == 2) { nvsql = namevaluesql(_fields[j].FieldType, _fields[j].FieldName, _content[j]); if (nvsql != "") { sql += nvsql + ","; } } } sql = sql.Substring(0, sql.Length - 1); sql = sql + whsql; try { SqlCe.ExecuteNonQuery(sql); } catch (Exception ex) { System.Diagnostics.Debug.WriteLine(ex.Message); System.Diagnostics.Debug.WriteLine(sql); SqlCe.ExecuteNonQuery("insert into error values('" + sql.Replace("'", "''") + "','" + ex.Message.Replace("'", "''") + "',getDate())"); } } return(true); }