public string validOrder(string orderName) { string rtn = ""; if (orderName.IndexOf("_") > 0) { string[] nameCode = orderName.Split('_'); if (nameCode.Length == 2) { string code = nameCode[1]; verifyCode = code; try { string strOrder = webService.isExistOrder(code, CurrentUser.UserName); if (strOrder.Length > 2) { vjList = getValidate(strOrder); if (vjList.name.Length > 0) { return(rtn); } string pType = vjList.peopleType; } else if (strOrder == "-1") { rtn = "验证码不存在,或者被使用,"; } else if (strOrder == "-2") { rtn = "门店用户未设置所属门店,"; } else if (strOrder == "-3") { rtn = "订单预约门店与使用门店不同,"; } else if (strOrder == "-4") { rtn = "订单状态不可用,"; } } catch (Exception ex) { rtn = "验证时出错"; string er = ex.ToString(); LogHelper.WriteLog(ex.ToString()); } } else { rtn = "验证码录入有误,"; } } else { rtn = "验证码录入有误,"; } return(rtn); }
private ValidateJson getValidate(string strJson) { ValidateJson vj = new ValidateJson(); try { vj = JsonConvert.DeserializeObject <ValidateJson>(strJson); } catch (Exception ex) { string ss = ex.ToString(); } return(vj); }
public bool uploadInfo(int type, string vCode) //type 0: 正常上传, type 1: 补充上传 { bool rtn = false; string code = ""; bool isCorrect = false; string errormsg = ""; string name = ""; if (File.Exists(testFile)) { if (File.Exists(sourceFile)) { File.Delete(sourceFile); } File.Copy(testFile, sourceFile); FileInfo fileInfo = new FileInfo(sourceFile); //有最新文件,开始上传数据 //先检查数据源中的校验码是否正确 Excel.ApplicationClass excel = new Excel.ApplicationClass(); //MessageBox.Show(excel.Version); excel.Visible = false; excel.Workbooks.Open(sourceFile, Type.Missing, Type.Missing, Type.Missing, "halleluja", Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing); Excel.Worksheet ws = (Excel.Worksheet)excel.Worksheets[2]; name = ((Excel.Range)ws.Cells[3, 3]).Text.ToString(); sourceFileName = name; excel.Quit(); IntPtr t = new IntPtr(excel.Hwnd); int k = 0; GetWindowThreadProcessId(t, out k); System.Diagnostics.Process p = System.Diagnostics.Process.GetProcessById(k); p.Kill(); if (type == 0) { if (Patient.w_code != "") { code = Patient.w_code; verifyCode = code; try { //string file = System.Windows.Forms.Application.StartupPath + "/HealthTesting.lic"; //string lic = fileToStr(file); //string strOrder = webService.isExistOrder_v2(code, CurrentUser.UserName, lic); string strOrder = webService.isExistOrder(code, CurrentUser.UserName); if (strOrder.Length > 2) { vjList = getValidate(strOrder); if (vjList.name.Length > 0) { isCorrect = true; } string pType = vjList.peopleType; //if (pType == "1") //{ // isAdult = false; //} //else //{ // isAdult = true; //} } else if (strOrder == "0") { errormsg = "诊疗人不存在,"; } else if (strOrder == "-1") { errormsg = "订单不存在,或者被使用"; } else if (strOrder == "-2") { errormsg = "门店用户未设置所属门店,"; } else if (strOrder == "-3") { errormsg = "订单预约门店与使用门店不同,"; } else if (strOrder == "-4") { errormsg = "订单状态不可用,"; } else if (strOrder == "-5") { errormsg = "设备不存在,"; } else if (strOrder == "-6") { errormsg = "设备未绑定服务,"; } else if (strOrder == "-7") { errormsg = "设备使用次数为0,"; } else if (strOrder == "-8") { errormsg = "设备服务未到开始可用时间,"; } else if (strOrder == "-9") { errormsg = "设备服务使用时间已到期,"; } } catch (Exception ex) { string er = ex.ToString(); LogHelper.WriteLog(ex.ToString()); } } else { errormsg = "验证码录入有误,"; } } else { verifyCode = vCode; isCorrect = true; } //上传文件到服务器 //verifyCode = "hahahaha"; FTPUpLoad(); //有更新文件,但是文件有问题 if (!isCorrect) { File.Delete(sourceFile); //SetValue("ChangeTime", latestTime); LogHelper.WriteLog(sourceFileName + "-" + errormsg + "文件存在问题,云端处理数据失败!"); //XtraMessageBox.Show(sourceFileName + "-" + errormsg + "云端处理数据失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return(false); } //SetValue("ChangeTime", latestTime); LogHelper.WriteLog("开始云端处理数据"); //copyTemp(); string temp = System.Windows.Forms.Application.StartupPath + "/DevExpress.Map.v16.2.dll"; copyStream(reportFile, temp); //上传数据 //Thread thdSub = new Thread(new ThreadStart(ThreadFun)); //thdSub.Start(); rtn = ThreadFun(); } return(rtn); }
public string validCode(string verifyCode) { string rtn = ""; try { //string file = System.Windows.Forms.Application.StartupPath + "/HealthTesting.lic"; //string lic = fileToStr(file); //string strOrder = webService.isExistOrder_v2(verifyCode, CurrentUser.UserName, lic); string strOrder = webService.isExistOrder(verifyCode, CurrentUser.UserName); if (strOrder.Length > 2) { vjList = getValidate(strOrder); if (vjList.name.Length > 0) { return(rtn); } string pType = vjList.peopleType; } else if (strOrder == "0") { rtn = "诊疗人不存在,"; } else if (strOrder == "-1") { rtn = "订单不存在,或者被使用"; } else if (strOrder == "-2") { rtn = "门店用户未设置所属门店,"; } else if (strOrder == "-3") { rtn = "订单预约门店与使用门店不同,"; } else if (strOrder == "-4") { rtn = "订单状态不可用,"; } else if (strOrder == "-5") { rtn = "设备不存在,"; } else if (strOrder == "-6") { rtn = "设备未绑定服务,"; } else if (strOrder == "-7") { rtn = "设备使用次数为0,"; } else if (strOrder == "-8") { rtn = "设备服务未到开始可用时间,"; } else if (strOrder == "-9") { rtn = "设备服务使用时间已到期,"; } } catch (Exception ex) { rtn = "验证时出错"; string er = ex.ToString(); LogHelper.WriteLog(ex.ToString()); } return(rtn); }