发布网友 发布时间:2022-04-09 23:12
共2个回答
懂视网 时间:2022-04-10 03:33
private void btnUpLoad_Click(object sender, EventArgs e) { if (!System.IO.File.Exists(LoadFile)) { MES.PDA.Core.Service.MessageServices.ShowWarm("请先扫描数据并保存!"); tbDelivery.Focus(); return; } else { string mes = string.Empty; int successCount = 0; using (StreamReader sr = new StreamReader(LoadFile)) { String line; while ((line = sr.ReadLine()) != null) { string[] ss = line.Split(‘,‘); if (ss.Length > 0) { List<string> ls = new List<string>(); ls.Add(ss[0]); ls.Add(ss[1]); ls.Add(ss[2]); string sql = "{?=call apps.cux_pda_load_scan_utl.data_load(" + StrUtil.BuildPara(ls) + ")}"; //MES.PDA.Core.Service.MessageServices.ShowWarm(sql); //return; string ret = (string)MES.PDA.Core.Service.DatabaseAccessService.execute(sql, ReturnType.STRING); if (!ret.StartsWith("0@")) { mes += ret + ",数据为delivery_id:" + ss[0].ToString() + ",item_id:" + ss[0].ToString() + "。lot_num:" + ss[2].ToString(); mes += " "; } else { successCount = successCount + 1; } } } } string sql1 = "{?=call apps.cux_pda_load_scan_utl.end_data_load(‘" + tbDelivery.Text.Trim() + "‘)}"; //MES.PDA.Core.Service.MessageServices.ShowWarm(sql); //return; string ret1 = (string)MES.PDA.Core.Service.DatabaseAccessService.execute(sql1, ReturnType.STRING); if (!ret1.StartsWith("0@")) { mes += "改动交货单下载状态失败!" + ret1; } mes = "数据上传成功:" + successCount.ToString() + "条。
" + mes; MES.PDA.Core.Service.MessageServices.ShowWarm(mes); System.IO.File.Delete(LoadFile); System.IO.File.Delete(DownFile); } }
PDA开发数据由本地上传至DB
标签:star pps 并保存 core string .sh sys 开发 text
热心网友 时间:2022-04-10 00:41
给你3种解决方案