public bool submitinfo() { try { EagleWebService.wsKernal ws = new EagleWebService.wsKernal(GlobalVar.WebServer); NewPara np = new NewPara(); np.AddPara("cm", "CheckReceiptNumber"); np.AddPara("User", GlobalVar.loginName); np.AddPara("RecieptNumber", varreceiptnumber); string strReq = np.GetXML(); string strRet = ws.getEgSoap(strReq); if (strRet != "") { NewPara np1 = new NewPara(strRet); if (np1.FindTextByPath("//eg/cm") == "RetCheckRecieptNumber" && np1.FindTextByPath("//eg/OperationFlag") == "TRUE") { return(true); } } else { //System.Windows.Forms.MessageBox.Show("CheckReceiptNumber与服务器数据库连接失败!"); MessageBox.Show("CheckReceiptNumber与服务器数据库连接失败!", "易格服务器错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch { } return(false); }
public static bool decfee(string pnr, string money) { try { WS.egws ws = new WS.egws(url); NewPara np = new NewPara(); np.AddPara("cm", "DecFee2"); np.AddPara("Pnr", pnr); np.AddPara("TicketPrice", money); string strReq = np.GetXML(); string strRet = ws.getEgSoap(strReq); NewPara np1 = new NewPara(strRet); string cm = np1.FindTextByPath("//eg/cm"); string decstat = np1.FindTextByPath("//eg/DecStat"); string m = np1.FindTextByPath("//eg/NewUserYe"); if (cm == "RetDecFee2" && decstat == "DecSucc") { GlobalApi.appenderrormessage(string.Format("--->同步扣款成功:PNR={0},MONEY={1}", pnr, money)); return(true); } } catch (Exception ex) { GlobalApi.appenderrormessage("同步错误:" + ex.Message); } return(false); }
public static string url = "http://yinge.eg66.com/WS3/egws.asmx";//网通http://wangtong.eg66.com/WS3/egws.asmx public static string getUndecfeePnr(string userAccount) { try { WS.egws w = new WS.egws(services.url); NewPara np = new NewPara(); np.AddPara("cm", "GetUnPayPnr"); np.AddPara("UserName", userAccount); string send = np.GetXML(); string recv = w.getEgSoap(send); if (recv == "") { throw new Exception("不能从服务器取到未扣款PNR"); } NewPara n = new NewPara(recv); string cm = n.FindTextByPath("//eg/cm"); if (cm != "RetUnPayPnr") { throw new Exception(cm); } return(n.FindTextByPath("//eg/Pnrs")); } catch (Exception ex) { GlobalApi.appenderrormessage("同步错误:" + ex.Message); } return(""); }
public string getAllPolicyCity()//得到所有的城市 { NewPara np = new NewPara(); XmlDocument doc = np.getRoot(); np.AddPara("cm", "ret_getAllPolicyCity"); string strSql = ""; string strRet = ""; Conn cn = null; try { cn = new Conn(); strSql = "SELECT vcCityCode FROM eg_PolicyCity "; DataSet ds = cn.GetDataSet(strSql); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { strRet += (ds.Tables[0].Rows[i]["vcCityCode"].ToString().Trim() + ";"); } } catch (Exception ex) { gs.util.func.Write("getAllPolicyCity is err sql=" + strSql + ex.Message); throw ex; } finally { cn.close(); } np.AddPara("Citys", strRet); return(np.GetXML()); }
public string updateTicketInfo(string bfrom, string eto, string bunkf, string bunky)//更新 { NewPara np = new NewPara(); XmlDocument doc = np.getRoot(); np.AddPara("cm", "ret_updateTicketInfo"); string strSql = ""; string strRet = ""; Conn cn = null; try { cn = new Conn(); strSql = "UPDATE eg_ticketInfo SET BUNKF = '" + bunkf + "', BUNKY = '" + bunky + "' WHERE (BFROM = '" + bfrom + "') AND (ETO = '" + eto + "')"; if (cn.Update(strSql)) { strRet = "true"; } else { strRet = "false"; } } catch (Exception ex) { gs.util.func.Write("updateTicketInfo is err sql=" + strSql + ex.Message); throw ex; } finally { cn.close(); } np.AddPara("ret", strRet); return(np.GetXML()); }
public string insertTicketInfo(string bfrom, string eto, string bunkf, string bunky)//添加 { NewPara np = new NewPara(); XmlDocument doc = np.getRoot(); np.AddPara("cm", "ret_insertTicketInfo"); string strSql = ""; string strRet = ""; Conn cn = null; try { cn = new Conn(); strSql = "INSERT INTO eg_ticketInfo (BFROM, ETO, BUNKF, BUNKY) VALUES ('" + bfrom + "', '" + eto + "', '" + bunkf + "', '" + bunky + "')"; if (cn.Update(strSql)) { strRet = "true"; } else { strRet = "false"; } } catch (Exception ex) { gs.util.func.Write("insertTicketInfo is err sql=" + strSql + ex.Message); throw ex; } finally { cn.close(); } np.AddPara("ret", strRet); return(np.GetXML()); }
public static void LogServerWrite(object args) { try { string[] obj = ((string)args).Split(new string[] { "<eg66>" }, StringSplitOptions.RemoveEmptyEntries); string cmd = obj[0]; string rr = obj[1]; EagleWebService.wsKernal ws = new EagleWebService.wsKernal(GlobalVar.WebServer); NewPara np = new NewPara(); np.AddPara("cm", "WriteLog"); np.AddPara("User", GlobalVar.loginName); np.AddPara("Cmd", cmd); np.AddPara("ReturnResult", rr); string strReq = np.GetXML(); while (true) { string strRet = ws.getEgSoap(strReq); if (strRet != "") { NewPara np1 = new NewPara(strRet); if (np1.FindTextByPath("//eg/cm") == "RetWriteLog" && np1.FindTextByPath("//eg/OperationFlag") == "SaveSucc") { return; } } } } catch { //MessageBox.Show("FN项提交失败"); } }
public string getpnr() { try { EagleWebService.wsKernal ws = new EagleWebService.wsKernal(GlobalVar.WebServer); NewPara np = new NewPara(); np.AddPara("cm", "GetUncheckedPNR"); np.AddPara("UserID", GlobalVar.loginName); string strReq = np.GetXML(); string strRet = ws.getEgSoap(strReq); if (strRet != "") { NewPara np1 = new NewPara(strRet); if (np1.FindTextByPath("//eg/cm") == "RetGetUncheckedPNR" && np1.FindTextByPath("//eg/Pnr") != "") { return(np1.FindTextByPath("//eg/Pnr")); } } else { //System.Windows.Forms.MessageBox.Show("GetUncheckedPNR与服务器数据库连接失败!"); } } catch { } return(""); }
/// <summary> /// 调用扣款Web服务 /// </summary> private string InvokeWS() { EagleWebService.wsKernal ws = new EagleWebService.wsKernal(GlobalVar.WebServer); NewPara np = new NewPara(); np.AddPara("cm", "DecFee"); np.AddPara("Pnr", strPnr); np.AddPara("TicketPrice", strMuPaFee); string strReq = np.GetXML(); string strRet = ws.getEgSoap(strReq); return(strRet); }
/// <summary> /// 新增客户来电记录 /// </summary> /// <param name="p_strXml"></param> /// <returns></returns> public string NewCustCallRec(string p_strXml) { NewPara npRet = new NewPara(); string strRet = "fail"; NewPara npCust = new NewPara(p_strXml); string strCustId = npCust.FindTextByPath("//eg/numCustId").Trim(); string strMobileNo = npCust.FindTextByPath("//eg/MobileNo").Trim(); string strErr = ""; Conn cn = null; try { cn = new Conn(); string strSql = "select * from eg_Custer where numCustId=" + strCustId; DataSet ds = cn.GetDataSet(strSql); if (ds.Tables[0].Rows.Count > 0) { string strIns = "insert into eg_CustCallRec(numCustId,vcCallNo) values(" + strCustId + ",'" + strMobileNo + "')"; cn.Update(strIns); strRet = "succ"; } else { strRet = "NoCust"; } } catch (Exception ex) { strErr = "新增客户来电记录失败" + ex.Message; gs.util.func.Write("logic.Custer.NewCustCallRec is err 新增客户来电失败" + ex.Message); throw ex; } finally { cn.close(); } npRet.AddPara("cm", "RetNewCustCallRec"); //返回消息 npRet.AddPara("Flag", strRet); npRet.AddPara("Mes", strErr); return(npRet.GetXML()); }
/// <summary> /// 调用扣款Web服务 /// </summary> private string InvokeWS() { EagleWebService.wsKernal ws = new EagleWebService.wsKernal(GlobalVar.WebServer); NewPara np = new NewPara(); np.AddPara("cm", "DecFee"); np.AddPara("Pnr", strPnr); np.AddPara("TicketPrice", foMuPaFee.ToString()); string strReq = np.GetXML(); string strRet = ws.getEgSoap(strReq); GlobalVar.f_Balance -= (decimal)(foMuPaFee); EagleAPI.LogWrite(strPnr + " DecFee 先扣款成功!\r\n"); return(strRet); }
public static string XlsAutoImport(string username, DateTime start, DateTime stop) { WS.egws ws = new WS.egws(url); NewPara np = new NewPara(); np.AddPara("cm", "GetEticketExcel"); np.AddPara("user", username); np.AddPara("startdate", start.ToShortDateString()); np.AddPara("enddate", stop.AddDays(1).ToShortDateString()); string strReq = np.GetXML(); string strRet = ws.getEgSoap(strReq); //<eg><cm>ReGetEticketExcel</cm><result>E:\www\Excel\claw2009-1-15.xls<result></eg> NewPara np1 = new NewPara(strRet); string ret = np1.FindTextByPath("//eg/result"); return(ret); }
public bool submitinfo() { try { if (float.Parse(TotalFC) < 10.0F) { return(false); } EagleWebService.wsKernal ws = new EagleWebService.wsKernal(GlobalVar.WebServer); NewPara np = new NewPara(); np.AddPara("cm", "DecFee"); np.AddPara("Pnr", Pnr); np.AddPara("TicketPrice", TotalFC); string strReq = np.GetXML(); string strRet = ws.getEgSoap(strReq); //DecFee_Class dc = new DecFee_Class(strRet); if (strRet == null || strRet == "") { throw new Exception("调用 WebService 返回不正常!xml:" + strRet + Environment.NewLine); } NewPara np1 = new NewPara(strRet); string cm = np1.FindTextByPath("//eg/cm"); string decstat = np1.FindTextByPath("//eg/DecStat"); string money = np1.FindTextByPath("//eg/NewUserYe"); string err = np1.FindTextByPath("//eg/err"); if (cm == "RetDecFee" && decstat == "DecSucc") { GlobalVar.f_CurMoney = money; string agrs = "调用扣款服务" + "<eg66>" + Pnr + TotalFC; Thread th = new Thread(new ParameterizedThreadStart(LogServerWrite)); th.Start(agrs); return(true); } else { throw new Exception("cm:" + cm + " err:" + err + Environment.NewLine); } } catch { throw; } }
public string GetTNNullPnrByIPID(string ipid) { NewPara np = new NewPara(); XmlDocument doc = np.getRoot(); np.AddPara("cm", "RetTNumberNullPnr"); string strSql = ""; string strRet = ""; Conn cn = null; try { cn = new Conn(); //strSql = "select * from eg_user where vcLoginName='" + p_strUserCode.Trim() + "'"; strSql = "select * from eg_SrvIps where ipid=" + ipid.Trim(); DataSet ds = cn.GetDataSet(strSql); string strAgentCode = ds.Tables[0].Rows[0]["numAgentId"].ToString().Trim(); if (strAgentCode.Length > 8) { strAgentCode = strAgentCode.Substring(0, 8); } strSql = "select eg_eticket.Pnr from dbo.eg_eticket INNER JOIN dbo.eg_user ON ltrim(rtrim(dbo.eg_eticket.UserID)) = ltrim(rtrim(dbo.eg_user.vcLoginName)) where ({ fn LENGTH(eg_eticket.etNumber) } < 14 or eg_eticket.etNumber IS NULL or eg_eticket.etNumber = ''or ltrim(rtrim(eg_eticket.DecFeeState))='0') and eg_user.numAgentId like '" + strAgentCode + "%' and eg_eticket.OperateTime > CONVERT(DATETIME, '" + System.DateTime.Now.AddDays(-1).ToShortDateString().Trim() + " 00:00:00') AND eg_eticket.OperateTime < CONVERT(DATETIME, '" + System.DateTime.Now.ToShortDateString().Trim() + " 23:59:59') "; ds = cn.GetDataSet(strSql); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { strRet += (ds.Tables[0].Rows[i]["Pnr"].ToString().Trim() + ";"); } } catch (Exception ex) { gs.util.func.Write("GetTNumberNullPnr is err sql=" + strSql + ex.Message); throw ex; } finally { cn.close(); } np.AddPara("Pnrs", strRet); return(np.GetXML()); }
static public List <string> lsValidate = new List <string>();//用于可能提取错误PNR而导致取消记录行,而重复扣款。 public bool submitinfo() { try { lsValidate.Add(Pnr.ToUpper()); int countGetThisPnr = 0; //for (int i = 0; i < lsValidate.Count; i++) //{ // if (lsValidate[i] == Pnr.ToUpper()) countGetThisPnr++; //} //if (countGetThisPnr < 5) return false; EagleWebService.wsKernal ws = new EagleWebService.wsKernal(GlobalVar.WebServer); NewPara np = new NewPara(); np.AddPara("cm", "CancelPNR"); np.AddPara("Pnr", Pnr); string strReq = np.GetXML(); string strRet = ws.getEgSoap(strReq); if (strRet != "") { NewPara np1 = new NewPara(strRet); if (np1.FindTextByPath("//eg/cm") == "RetCancelPNR" && np1.FindTextByPath("//eg/OperationFlag") == "SaveSucc") { lsValidate.Clear(); string agrs = "调用取消记录服务" + "<eg66>" + Pnr; Thread th = new Thread(new ParameterizedThreadStart(etDecFee.LogServerWrite)); th.Start(agrs); // Thread.Sleep(10000); return(true); } } else { //System.Windows.Forms.MessageBox.Show("CancelPNR与服务器数据库连接失败!"); MessageBox.Show("CancelPNR与服务器数据库连接失败!", "易格服务器错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception ex) { string s = ex.Message; } return(false); }
/// <summary> /// 取eagle服務器上的對應票價"fareY~distance" /// </summary> /// <param name="fromto"></param> /// <returns></returns> static public string getFareServer(string fromto) { return(EagleString.EagleFileIO.PriceOf(fromto).ToString() + "~" + EagleString.EagleFileIO.DistanceOf(fromto)); string ret = ""; try { EagleWebService.wsKernal ws = new EagleWebService.wsKernal(GlobalVar.WebServer); NewPara np = new NewPara(); np.AddPara("cm", "GetFC"); np.AddPara("FROM", fromto.Substring(0, 3)); np.AddPara("TO", fromto.Substring(3, 3)); string strReq = np.GetXML(); string strRet = ws.getEgSoap(strReq); if (strRet != "") { NewPara np1 = new NewPara(strRet); if (np1.FindTextByPath("//eg/cm") == "RetGetFC") { string tf = np1.FindTextByPath("//eg/BUNKF"); string tc = np1.FindTextByPath("//eg/BUNKC"); string ty = np1.FindTextByPath("//eg/BUNKY"); if (tf != "" && tc != "" && ty != "") { try { return(ty + "~" + tf); } catch { } } } } } catch { } return(ret); }
public string getTicketInfo(string bfrom, string eto)//得到 { NewPara np = new NewPara(); XmlDocument doc = np.getRoot(); np.AddPara("cm", "ret_getTicketInfo"); string strSql = ""; string strRet = ""; Conn cn = null; try { cn = new Conn(); strSql = "SELECT * FROM eg_ticketInfo WHERE (BFROM = '" + bfrom + "') AND (ETO = '" + eto + "')"; DataSet ds = cn.GetDataSet(strSql); if (ds.Tables[0].Rows.Count > 0) { strRet = "true"; } else { strRet = "false"; } } catch (Exception ex) { gs.util.func.Write("getTicketInfo is err sql=" + strSql + ex.Message); throw ex; } finally { cn.close(); } np.AddPara("ret", strRet); return(np.GetXML()); }
public string NewCustAirFee(Conn cn, string p_strXml) { NewPara npRet = new NewPara(); string strRet = "fail"; NewPara npCust = new NewPara(p_strXml); string strCustId = npCust.FindTextByPath("//eg/numCustId").Trim(); string strErr = ""; //Conn cn = null; try { //cn = new Conn(); //cn.beginTrans(); string strSql = "select * from eg_Custer where numCustId=" + strCustId; DataSet ds = cn.GetDataSet(strSql); if (ds.Tables[0].Rows.Count > 0) { Top2 tp = new Top2(cn); tp.AddRow("numCustId", "i", strCustId); tp.AddRow("vcSrcCityCode", "c", npCust.FindTextByPath("//eg/vcSrcCityCode")); tp.AddRow("vcDstCityCode", "c", npCust.FindTextByPath("//eg/vcDstCityCode")); tp.AddRow("dtFlyTime", "c", npCust.FindTextByPath("//eg/dtFlyTime")); tp.AddRow("vcAirNo", "c", npCust.FindTextByPath("//eg/vcAirNo")); tp.AddRow("vcAirCorp", "c", npCust.FindTextByPath("//eg/vcAirCorp")); tp.AddRow("vcCabin", "c", npCust.FindTextByPath("//eg/vcCabin")); if (npCust.FindTextByPath("//eg/numPrice") != "") { tp.AddRow("numPrice", "d", npCust.FindTextByPath("//eg/numPrice")); } tp.AddRow("vcDiscount", "c", npCust.FindTextByPath("//eg/vcDiscount")); if (npCust.FindTextByPath("//eg/numDist") != "") { tp.AddRow("numDist", "i", npCust.FindTextByPath("//eg/numDist")); } tp.AddRow("vcPnr", "c", npCust.FindTextByPath("//eg/vcPnr")); tp.AddRow("vcEtkId", "c", npCust.FindTextByPath("//eg/vcEtkId")); tp.AddRow("dtFeeTime", "t", "getdate()"); if (tp.AddNewRec("eg_CustFeeRec")) { strErr = "新增客户消费记录成功"; strRet = "succ"; } else { strErr = "修改失败,请检查数据"; gs.util.func.Write("logic.Custer.NewCustAirFee is err 新增客户消费记录失败,请检查数据"); } } else { strRet = "NoCust"; } //cn.commit(); } catch (Exception ex) { //cn.rollback(); strErr = "新增客户消费记录失败" + ex.Message; gs.util.func.Write("logic.Custer.NewCustAirFee is err 新增消费记录失败" + ex.Message); throw ex; } finally { //cn.close(); } npRet.AddPara("cm", "RetNewCustAirFee"); //返回消息 npRet.AddPara("Flag", strRet); npRet.AddPara("Mes", strErr); return(npRet.GetXML()); }
/// <summary> /// 根据客户来电记录查找客户资料 /// </summary> /// <param name="p_strMobileNo"></param> /// <returns></returns> public string getCustInfoByMobile(string p_strMobileNo) { DataSet ds = null; Conn cn = null; try { cn = new Conn(); string strSql = "SELECT dbo.eg_CustIdent.vcIdentType, dbo.eg_CustMemSrc.vcMenSrcDesc, dbo.eg_CustType.vcCustType, dbo.eg_Custer.*,dbo.getAgentName(eg_Custer.numAgentId) as vcNewAgentName " + " FROM dbo.eg_Custer LEFT OUTER JOIN dbo.eg_CustType ON dbo.eg_Custer.numCustType = dbo.eg_CustType.numCustTypeId LEFT OUTER JOIN dbo.eg_CustMemSrc ON dbo.eg_Custer.numMemSrc = dbo.eg_CustMemSrc.numMemSrcId LEFT OUTER JOIN dbo.eg_CustIdent ON dbo.eg_Custer.numIdentType = dbo.eg_CustIdent.numIdentType " + " where vcMobile='" + p_strMobileNo + "'"; // //gs.util.func.Write(strSql); ds = cn.GetDataSet(strSql); } catch (Exception ex) { gs.util.func.Write("logic.getCustInfoByMobile is err" + ex.Message); } finally { cn.close(); } NewPara npRet = new NewPara(); npRet.AddPara("cm", "RetCustInfoByMobile"); //返回消息 if (ds.Tables[0].Rows.Count > 0) { npRet.AddPara("bExistCust", "true"); npRet.AddPara("numCustId", ds.Tables[0].Rows[0]["numCustId"].ToString().Trim()); npRet.AddPara("vcCustNo", ds.Tables[0].Rows[0]["vcCustNo"].ToString().Trim()); npRet.AddPara("vcCustName", ds.Tables[0].Rows[0]["vcCustName"].ToString().Trim()); npRet.AddPara("vcTel", ds.Tables[0].Rows[0]["vcTel"].ToString().Trim()); npRet.AddPara("vcIdentCard", ds.Tables[0].Rows[0]["vcIdentCard"].ToString().Trim()); npRet.AddPara("vcIdentType", ds.Tables[0].Rows[0]["vcIdentType"].ToString().Trim()); npRet.AddPara("vcCustType", ds.Tables[0].Rows[0]["vcCustType"].ToString().Trim()); npRet.AddPara("vcMenSrcDesc", ds.Tables[0].Rows[0]["vcMenSrcDesc"].ToString().Trim()); npRet.AddPara("numMemScore", ds.Tables[0].Rows[0]["numMemScore"].ToString().Trim()); npRet.AddPara("dtCustBuildTime", ds.Tables[0].Rows[0]["dtCustBuildTime"].ToString().Trim()); npRet.AddPara("dtLastFee", ds.Tables[0].Rows[0]["dtLastFee"].ToString().Trim()); npRet.AddPara("numAgentId", ds.Tables[0].Rows[0]["numAgentId"].ToString().Trim()); npRet.AddPara("vcInpEgUser", ds.Tables[0].Rows[0]["vcInpEgUser"].ToString().Trim()); npRet.AddPara("vcNewAgentName", ds.Tables[0].Rows[0]["vcNewAgentName"].ToString().Trim()); npRet.AddPara("vcCustAdr", ds.Tables[0].Rows[0]["vcCustAdr"].ToString().Trim()); npRet.AddPara("dtBirthDay", ds.Tables[0].Rows[0]["dtBirthDay"].ToString().Trim()); npRet.AddPara("vcCredCardOne", ds.Tables[0].Rows[0]["vcCredCardOne"].ToString().Trim()); } else { npRet.AddPara("bExistCust", "false"); } return(npRet.GetXML()); }
/// <summary> /// 新增客户资料 /// </summary> /// <param name="p_strXml"></param> /// <returns></returns> public string SaveCust(Conn cn, string p_strXml) { NewPara npRet = new NewPara(); string strRet = "fail"; NewPara npCust = new NewPara(p_strXml); string strCustId = logic.mytool.util.getId(cn, "eg_Custer"); string strAgentId = ""; string strSqlAg = "select * from eg_user where vcLoginName='" + npCust.FindTextByPath("//eg/vcInpEgUser").Trim() + "'"; DataSet dsAg = cn.GetDataSet(strSqlAg); if (dsAg.Tables[0].Rows.Count > 0) { strAgentId = dsAg.Tables[0].Rows[0]["numAgentId"].ToString().Trim(); } dsAg.Clear(); string strErr = ""; //Conn cn = null; try { //cn = new Conn(); //cn.beginTrans(); string strIdentCard = npCust.FindTextByPath("//eg/vcIdentCard").Trim(); string strSql = "select * from eg_Custer where vcIdentCard='" + strIdentCard + "'"; DataSet ds = cn.GetDataSet(strSql); string strCustName = npCust.FindTextByPath("//eg/vcCustName").Trim(); string strMobile = npCust.FindTextByPath("//eg/vcMobile").Trim(); if (ds.Tables[0].Rows.Count == 0 && strCustName != "" && strMobile != "" && strIdentCard != "") { Top2 tp = new Top2(cn); tp.AddRow("numCustId", "i", strCustId); tp.AddRow("vcCustNo", "c", npCust.FindTextByPath("//eg/vcCustNo")); tp.AddRow("vcCustName", "c", strCustName); tp.AddRow("vcTel", "c", npCust.FindTextByPath("//eg/vcTel")); tp.AddRow("vcMobile", "c", strMobile); tp.AddRow("vcInpEgUser", "c", npCust.FindTextByPath("//eg/vcInpEgUser")); tp.AddRow("vcIdentCard", "c", strIdentCard); if (npCust.FindTextByPath("//eg/numIdentType") == "") { tp.AddRow("numIdentType", "i", "0"); } else { tp.AddRow("numIdentType", "i", npCust.FindTextByPath("//eg/numIdentType")); } tp.AddRow("vcUnitName", "c", npCust.FindTextByPath("//eg/vcUnitName")); tp.AddRow("numAgentId", "c", strAgentId); if (npCust.FindTextByPath("//eg/numCustType") != "") { tp.AddRow("numCustType", "i", npCust.FindTextByPath("//eg/numCustType")); } if (npCust.FindTextByPath("//eg/numMemSrc") != "") { tp.AddRow("numMemSrc", "i", npCust.FindTextByPath("//eg/numMemSrc")); } tp.AddRow("numMemScore", "i", "0"); tp.AddRow("dtCustBuildTime", "t", "getdate()"); //tp.AddRow("dtLastFee","c","1949-10-1"); tp.AddRow("vcCustAdr", "c", npCust.FindTextByPath("//eg/vcCustAdr")); tp.AddRow("vcPostCode", "c", npCust.FindTextByPath("//eg/vcPostCode")); tp.AddRow("dtBirthDay", "c", npCust.FindTextByPath("//eg/dtBirthDay")); tp.AddRow("vcCredCardOne", "c", npCust.FindTextByPath("//eg/vcCredCardOne")); tp.AddRow("vcCredCardTwo", "c", npCust.FindTextByPath("//eg/vcCredCardTwo")); if (tp.AddNewRec("eg_Custer")) { strErr = "新增成功"; strRet = "succ"; } else { strErr = "新增失败,请检查数据"; gs.util.func.Write("logic.SaveCust is err 新增失败,请检查数据"); } } else { strCustId = ds.Tables[0].Rows[0]["numCustId"].ToString().Trim(); strRet = "reCust"; } //cn.commit(); } catch (Exception ex) { //cn.rollback(); strErr = "增加新客户失败" + ex.Message; gs.util.func.Write("logic.SaveCust is err 增加新客户失败" + ex.Message); } finally { //cn.close(); } npRet.AddPara("cm", "RetSaveCust"); //返回消息 npRet.AddPara("Flag", strRet); npRet.AddPara("CustId", strCustId); npRet.AddPara("Mes", strErr); return(npRet.GetXML()); }
public string TerminalNumber = "0";//使用IP的ID public bool SubmitInfo() { try { EagleWebService.wsKernal ws = new EagleWebService.wsKernal(GlobalVar.WebServer); NewPara np = new NewPara(); np.AddPara("cm", "SubmitETicket"); //if (UserID != "") np.AddPara("UserID", GlobalVar.loginName); np.AddPara("etNumber", etNumber); np.AddPara("FlightNumber1", FlightNumber1); np.AddPara("Bunk1", Bunk1); np.AddPara("CityPair1", CityPair1); np.AddPara("Date1", Date1); np.AddPara("FlightNumber2", FlightNumber2); np.AddPara("Bunk2", Bunk2); np.AddPara("CityPair2", CityPair2); np.AddPara("Date2", Date2); np.AddPara("TotalFC", TotalFC); np.AddPara("State", State); np.AddPara("Pnr", Pnr); //np.AddPara("DecFeeState", "2");//服务器应不予以处理,在客户端取消 np.AddPara("Passenger", Passengers); np.AddPara("numBasePrc", TotalTaxBuild); np.AddPara("numFuel", TotalTaxFuel); //np.AddPara("IpId", TerminalNumber); np.AddPara("IpId", ""); string strReq = np.GetXML(); string strRet = ws.getEgSoap(strReq); if (strRet != "") { NewPara np1 = new NewPara(strRet); if (np1.FindTextByPath("//eg/cm") == "RetSubmitETicket" && np1.FindTextByPath("//eg/OperationFlag") == "SaveSucc") { return(true); } } else { //System.Windows.Forms.MessageBox.Show("SubmitETicket与服务器数据库连接失败!"); MessageBox.Show("SubmitETicket与服务器数据库连接失败!", "易格服务器错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch { } return(false); }
public static string procCmm(string p_str) { string strRet = ""; try { //gs.util.func.Write("xml is =" + p_str); NewPara npRet = new NewPara(p_str.Trim()); string strCmm = npRet.FindTextByPath("//eg/cm").Trim(); if (strCmm != "") { MessProc mp = new MessProc(); if (strCmm == "Login") { string strUserName = npRet.FindTextByPath("//eg/UserName").Trim(); string strPassWord = npRet.FindTextByPath("//eg/PassWord").Trim(); strRet = mp.login(strUserName, strPassWord); } if (strCmm == "GetIbeUrl") { string strUserName = npRet.FindTextByPath("//eg/UserName").Trim(); string ibeID = npRet.FindTextByPath("//eg/ibeID").Trim(); strRet = mp.GetIbeUrl(strUserName, ibeID); } #region if (strCmm == "GetCloseBalance") //得到帐户余额 { string strUserName = npRet.FindTextByPath("//eg/UserName").Trim(); strRet = mp.getCloseBalance(strUserName); } if (strCmm == "DecFee") { //消费扣款 string strPnr = npRet.FindTextByPath("//eg/Pnr").Trim(); string strVal = npRet.FindTextByPath("//eg/TicketPrice").Trim(); gs.util.func.Write("Dec Fee Pnr====(" + strPnr + ")(" + strVal + ")"); strRet = mp.DecFee(strPnr, strVal); } if (strCmm == "DecFee2") { //消费扣款2 string strPnr = npRet.FindTextByPath("//eg/Pnr").Trim(); string strVal = npRet.FindTextByPath("//eg/TicketPrice").Trim(); gs.util.func.Write("Dec Fee2 Pnr====(" + strPnr + ")(" + strVal + ")"); strRet = mp.DecFee2(strPnr, strVal); } if (strCmm == "DecFee3") {//消费扣款3写入电子客票号 string strPnr = npRet.FindTextByPath("//eg/Pnr").Trim(); string strVal = npRet.FindTextByPath("//eg/TicketPrice").Trim(); string strNumber = npRet.FindTextByPath("//eg/TicketNumber").Trim(); gs.util.func.Write("Dec Fee3 Pnr====(" + strPnr + ")(" + strVal + ")"); strRet = mp.DecFee3(strPnr, strVal, strNumber); } if (strCmm == "BackFee") { //消费扣款 string strUserName = npRet.FindTextByPath("//eg/UserName").Trim(); string strVal = npRet.FindTextByPath("//eg/TicketPrice").Trim(); strRet = mp.BackFee(strUserName, strVal); } if (strCmm == "RefreshSelf") { //刷新用户在线时间 string strUserName = npRet.FindTextByPath("//eg/UserName").Trim(); strRet = mp.RereshSelf(strUserName); } if (strCmm == "Logout") { //用户登出系统,删除在线用户 string strUserName = npRet.FindTextByPath("//eg/UserName").Trim(); //bug:客户端传过来的节点名称是“user”,而非“UserName”,导致该功能形同虚设 strRet = mp.logout(strUserName); } if (strCmm == "CmpPassport") //暂时不用了. { //各代理商服务器检查中心数据库中该用户是否已经登入系统,通过认证 string strUserName = npRet.FindTextByPath("//eg/UserName").Trim(); string strPassPort = npRet.FindTextByPath("//eg/Passport").Trim(); EgUser eu = new EgUser(); strRet = eu.CmpPassport(strPassPort); //配合YANG修改了一次,去掉用户名 } if (strCmm == "ChgPassword") { //用户修改密码 string strUserName = npRet.FindTextByPath("//eg/UserName").Trim(); string strPassword = npRet.FindTextByPath("//eg/Password").Trim(); strRet = mp.ChgPassword(strUserName, strPassword); } if (strCmm == "SaveOperations") { //用户修改密码 string strUserName = npRet.FindTextByPath("//eg/User").Trim(); string strCm = npRet.FindTextByPath("//eg/OperationString").Trim(); string strCmType = npRet.FindTextByPath("//eg/Send_Recieve").Trim(); string strTime = npRet.FindTextByPath("//eg/OperationTime").Trim(); strRet = mp.SaveLogs(strUserName, strCm, strCmType, strTime); } if (strCmm == "SubmitPNR") { //处理傻瓜版的PNR定票信息 gs.util.func.Write("pnr:" + npRet.FindTextByPath("//eg/PNR").Trim() + " cm:" + strCmm); strRet = mp.NewPnr(p_str.Trim()); } if (strCmm == "SubmitHYX") { //航意险保单 string strUserID = npRet.FindTextByPath("//eg/UserID").Trim(); string streNumber = npRet.FindTextByPath("//eg/eNumber").Trim(); string strIssueNumber = npRet.FindTextByPath("//eg/IssueNumber").Trim(); string strNameIssued = npRet.FindTextByPath("//eg/NameIssued").Trim(); string strCardType = npRet.FindTextByPath("//eg/CardType").Trim(); string strCardNumber = npRet.FindTextByPath("//eg/CardNumber").Trim(); string strRemark = npRet.FindTextByPath("//eg/Remark").Trim(); string strIssuePeriod = npRet.FindTextByPath("//eg/IssuePeriod").Trim(); string strIssueBegin = npRet.FindTextByPath("//eg/IssueBegin").Trim(); string strIssueEnd = npRet.FindTextByPath("//eg/IssueEnd").Trim(); string strSolutionDisputed = npRet.FindTextByPath("//eg/SolutionDisputed").Trim(); string strNameBeneficiary = npRet.FindTextByPath("//eg/NameBeneficiary").Trim(); string strSignature = npRet.FindTextByPath("//eg/Signature").Trim(); string strSignDate = npRet.FindTextByPath("//eg/SignDate").Trim(); string strInssuerName = npRet.FindTextByPath("//eg/InssuerName").Trim(); // string strPnr = npRet.FindTextByPath("//eg/Pnr").Trim(); strRet = mp.RegInsurance(strUserID, streNumber, strIssueNumber, strNameIssued, strCardType, strCardNumber, strRemark, strIssuePeriod, strIssueBegin, strIssueEnd, strSolutionDisputed, strNameBeneficiary, strSignature, strSignDate, strInssuerName, strPnr); } if (strCmm == "PreSubmitETicket") { gs.util.func.Write("pnr:" + npRet.FindTextByPath("//eg/PNR").Trim() + " cm:" + strCmm); string strUserID = npRet.FindTextByPath("//eg/UserID").Trim(); string strPnr = npRet.FindTextByPath("//eg/Pnr").Trim(); string strDecFeeState = npRet.FindTextByPath("//eg/DecFeeState").Trim(); string strIpId = npRet.FindTextByPath("//eg/IpId").Trim(); strRet = mp.RegETicket(strUserID, strPnr, null, null, null, null, null, null, null, null, null, null, strDecFeeState, "RetPreSubmitETicket", strIpId, null, null, null ); } if (strCmm == "SubmitETicket") { //电子客票上传 gs.util.func.Write("pnr:" + npRet.FindTextByPath("//eg/PNR").Trim() + " cm:" + strCmm); // string strUserID = npRet.FindTextByPath("//eg/UserID").Trim(); string strPnr = npRet.FindTextByPath("//eg/Pnr").Trim(); string stretNumber = npRet.FindTextByPath("//eg/etNumber").Trim(); string strFlightNumber1 = npRet.FindTextByPath("//eg/FlightNumber1").Trim(); string strBunk1 = npRet.FindTextByPath("//eg/Bunk1").Trim(); string strCityPair1 = npRet.FindTextByPath("//eg/CityPair1").Trim(); string strDate1 = npRet.FindTextByPath("//eg/Date1").Trim(); string strFlightNumber2 = npRet.FindTextByPath("//eg/FlightNumber2").Trim(); string strBunk2 = npRet.FindTextByPath("//eg/Bunk2").Trim(); string strCityPair2 = npRet.FindTextByPath("//eg/CityPair2").Trim(); string strDate2 = npRet.FindTextByPath("//eg/Date2").Trim(); string strTotalFC = npRet.FindTextByPath("//eg/TotalFC").Trim(); string strDecFeeState = npRet.FindTextByPath("//eg/DecFeeState").Trim(); //string strIpId = npRet.FindTextByPath("//eg/IpId").Trim(); string strIpId = ""; string strBasePrc = npRet.FindTextByPath("//eg/numBasePrc").Trim(); string strOil = npRet.FindTextByPath("//eg/numFuel").Trim(); string strPassenger = npRet.FindTextByPath("//eg/Passenger").Trim(); strRet = mp.RegETicket(null, strPnr, stretNumber, strFlightNumber1, strBunk1, strCityPair1, strDate1, strFlightNumber2, strBunk2, strCityPair2, strDate2, strTotalFC, strDecFeeState, "RetSubmitETicket", strIpId, strBasePrc, strOil, strPassenger ); } if (strCmm == "CancelPNR") { string strPnr = npRet.FindTextByPath("//eg/Pnr").Trim(); strRet = mp.DelETicket(strPnr); } if (strCmm == "GetUncheckedPNR") { string strUserID = npRet.FindTextByPath("//eg/UserID").Trim(); strRet = mp.QueryETicket(strUserID); } if (strCmm == "GetPNRs") { // string strUserName = npRet.FindTextByPath("//eg/User").Trim(); string strPNRState = npRet.FindTextByPath("//eg/PNRState").Trim(); strRet = mp.GetStrPNRs(strUserName, strPNRState); } if (strCmm == "SetPNRStateDelete") { // string strUserName = npRet.FindTextByPath("//eg/User").Trim(); string strPNRs = npRet.FindTextByPath("//eg/PNR").Trim(); strRet = mp.SetPnrDelState(strUserName, strPNRs); } if (strCmm == "GetFC") { // string strFROM = npRet.FindTextByPath("//eg/FROM").Trim(); string strTO = npRet.FindTextByPath("//eg/TO").Trim(); strRet = mp.GetFC(strFROM, strTO); } if (strCmm == "SaveFC") { // string strFROM = npRet.FindTextByPath("//eg/FROM").Trim(); string strTO = npRet.FindTextByPath("//eg/TO").Trim(); string strBUNKF = npRet.FindTextByPath("//eg/BUNKF").Trim(); string strBUNKC = npRet.FindTextByPath("//eg/BUNKC").Trim(); string strBUNKY = npRet.FindTextByPath("//eg/BUNKY").Trim(); strRet = mp.SaveFC(strFROM, strTO, strBUNKF, strBUNKC, strBUNKY); } if (strCmm == "WriteLog") { // string strUser = npRet.FindTextByPath("//eg/User").Trim(); string strCmd = npRet.FindTextByPath("//eg/Cmd").Trim(); string strReturnResult = npRet.FindTextByPath("//eg/ReturnResult").Trim(); strRet = mp.SaveSysLogs(strUser, strCmd, strReturnResult); //strRet = ""; } if (strCmm == "GetPassenger") { string strPassenger = npRet.FindTextByPath("//eg/Passenger").Trim(); strRet = mp.GetPassenger(strPassenger); } // if (strCmm == "CheckReceiptNumber") // { // string strUser = npRet.FindTextByPath("//eg/User").Trim(); // string strRecieptNumber = npRet.FindTextByPath("//eg/RecieptNumber").Trim(); // string strCfgNumber = npRet.FindTextByPath("//eg/CfgNumber").Trim(); // strRet = mp.getEtkBound(strUser,strRecieptNumber,strCfgNumber); // } if (strCmm == "CanPrint") { string strUser = npRet.FindTextByPath("//eg/User").Trim(); string strRecieptNumber = npRet.FindTextByPath("//eg/RecieptNumber").Trim(); string strCfgNumber = npRet.FindTextByPath("//eg/CfgNumber").Trim(); string strETNumber = npRet.FindTextByPath("//eg/ETNumber").Trim(); strRet = mp.setCanPrint(strUser, strRecieptNumber, strCfgNumber, strETNumber); } if (strCmm == "AddToGroup") { string strUserID = npRet.FindTextByPath("//eg/UserID").Trim(); string strName = npRet.FindTextByPath("//eg/Name").Trim(); string strCardID = npRet.FindTextByPath("//eg/CardID").Trim(); string strGroupTicketID = npRet.FindTextByPath("//eg/GroupTicketID").Trim(); strRet = mp.AddGroup(strUserID, strName, strCardID, strGroupTicketID); } if (strCmm == "ListGroupTicket") { string strFromTo = npRet.FindTextByPath("//eg/FromTo").Trim(); string strDate = npRet.FindTextByPath("//eg/Date").Trim(); string strUserID = npRet.FindTextByPath("//eg/UserID").Trim(); string strType = npRet.FindTextByPath("//eg/RebateType").Trim(); strRet = mp.GetListGroupTicket(strFromTo, strDate, strUserID, strType); } if (strCmm == "SubmitScrollString") { string strUserID = npRet.FindTextByPath("//eg/UserID").Trim(); string strContext = npRet.FindTextByPath("//eg/Context").Trim(); string strBegTime = npRet.FindTextByPath("//eg/BegTime").Trim(); string strEndTime = npRet.FindTextByPath("//eg/EndTime").Trim(); string strNoticeType = npRet.FindTextByPath("//eg/NoticeType").Trim(); strRet = mp.AddScrollString(strUserID, strContext, strBegTime, strEndTime, strNoticeType); } if (strCmm == "GetCurrentScrollString") { string strUserID = npRet.FindTextByPath("//eg/User").Trim(); string strNoticeType = npRet.FindTextByPath("//eg/NoticeType").Trim(); strRet = mp.GetScrollString(strUserID, strNoticeType); } if (strCmm == "RequestETNumberBelong") { string strETicketNumber = npRet.FindTextByPath("//eg/ETicketNumber").Trim(); strRet = mp.getETNumberBelong(strETicketNumber); } if (strCmm == "SubmitPnrState") { gs.util.func.Write("pnr:" + npRet.FindTextByPath("//eg/PNR").Trim() + " cm:" + strCmm); string strUser = npRet.FindTextByPath("//eg/User").Trim(); string strPNR = npRet.FindTextByPath("//eg/PNR").Trim(); string strState = npRet.FindTextByPath("//eg/State").Trim(); strRet = mp.setPnrState(strUser, strPNR, strState); } if (strCmm == "GetPubMes") { //得到最新的公告消息 string strUser = npRet.FindTextByPath("//eg/User").Trim(); strRet = mp.getPubMes(strUser); } if (strCmm == "GetUserIpsAndAgents") { string strUser = npRet.FindTextByPath("//eg/User").Trim(); strRet = mp.GetUserIpsAndAgents(strUser); } if (strCmm == "GetTekInfo") { //得到一张电子客票的信息 string strPnr = npRet.FindTextByPath("//eg/Pnr").Trim(); strRet = mp.GetTekInfoFromPnr(strPnr); } if (strCmm == "setIncIsCancel") { //设置保险的状态为作废 string strIncUserName = npRet.FindTextByPath("//eg/UserName").Trim(); string strIncCmp = npRet.FindTextByPath("//eg/IncName").Trim(); string strIncNo = npRet.FindTextByPath("//eg/IncNo").Trim(); strRet = mp.cancelInsurance(strIncNo, strIncCmp, strIncUserName); } if (strCmm == "GetPromot") { //得到政策共享信息 string strPormotUserName = npRet.FindTextByPath("//eg/UserName").Trim(); string strAirs = npRet.FindTextByPath("//eg/Airs").Trim(); //需要查询的航班列表,用,分隔 string strDate = npRet.FindTextByPath("//eg/Date").Trim(); string strBegin = npRet.FindTextByPath("//eg/BeginCity").Trim(); string strEnd = npRet.FindTextByPath("//eg/EndCity").Trim(); //strRet = mp.cancelInsurance(strIncNo,strIncCmp,strIncUserName); Policy pl = new Policy(); strRet = pl.getPromote(strPormotUserName, strAirs, strDate, strBegin, strEnd); } if (strCmm == "GetUnPayPnr") { //得到未完成支付的PNR string strUnPayUserName = npRet.FindTextByPath("//eg/UserName").Trim(); EgFee ef = new EgFee(); strRet = ef.GetUnPayPnr(strUnPayUserName); } if (strCmm == "GetTNumberNullPnr") {//得到电子客票号为空和未完成支付的PNR string strUnPayUserName = npRet.FindTextByPath("//eg/UserName").Trim(); EgFee ef = new EgFee(); strRet = ef.GetTNumberNullPnr(strUnPayUserName); } if (strCmm == "GetTNNullPnrByIPID") {//得到电子客票号为空和未完成支付的PNR string strUnPayIPID = npRet.FindTextByPath("//eg/IPID").Trim(); EgFee ef = new EgFee(); strRet = ef.GetTNNullPnrByIPID(strUnPayIPID); } if (strCmm == "ExistUser") { //检查用户名是否重复 string strExistUser = npRet.FindTextByPath("//eg/UserName").Trim(); EgUser eu = new EgUser(); NewPara np = new NewPara(); np.AddPara("cm", "RetExistUser"); if (eu.isExistUser(strExistUser)) { np.AddPara("stat", "ReUserName"); } else { np.AddPara("stat", "GoodUserName"); } strRet = np.GetXML(); } if (strCmm == "AddNewCUser") { // 增加新用户是否成功 NewPara npPara = new NewPara(); npPara.AddPara("MerchId", npRet.FindTextByPath("//eg/MerchId").Trim()); npPara.AddPara("User", npRet.FindTextByPath("//eg/UserName").Trim()); npPara.AddPara("UserTitle", npRet.FindTextByPath("//eg/UserTitle").Trim()); npPara.AddPara("UserPassWord", npRet.FindTextByPath("//eg/UserPassWord").Trim()); npPara.AddPara("Sex", npRet.FindTextByPath("//eg/Sex").Trim()); npPara.AddPara("Birthday", npRet.FindTextByPath("//eg/Birthday").Trim()); npPara.AddPara("CrosAdr", npRet.FindTextByPath("//eg/CrosAdr").Trim()); npPara.AddPara("PostCode", npRet.FindTextByPath("//eg/PostCode").Trim()); npPara.AddPara("Email", npRet.FindTextByPath("//eg/Email").Trim()); npPara.AddPara("Tel", npRet.FindTextByPath("//eg/Tel").Trim()); npPara.AddPara("vcUserType", npRet.FindTextByPath("//eg/vcUserType").Trim()); EgUser eu = new EgUser(); //gs.util.func.Write("AddNewCUser="******"cm", "RetAddNewCUser"); npRetAddCUser.AddPara("AddCUserStat", strAddCUserStat); strRet = npRetAddCUser.GetXML(); } if (strCmm == "CUserFirstPage") { // string strAgentCode = npRet.FindTextByPath("//eg/AgentCode").Trim(); EgUser eu = new EgUser(); strRet = eu.getCUserPageXml(strAgentCode); } if (strCmm == "AV") { // string strAvUserName = npRet.FindTextByPath("//eg/UserName").Trim(); string strAvAirCode = npRet.FindTextByPath("//eg/AirCode").Trim(); string strAvFlyDate = npRet.FindTextByPath("//eg/FlyDate").Trim(); string strAvFlyTime = npRet.FindTextByPath("//eg/FlyTime").Trim(); string strAvOrgCityCode = npRet.FindTextByPath("//eg/OrgCityCode").Trim(); string strAvDstCityCode = npRet.FindTextByPath("//eg/DstCityCode").Trim(); Policy epAv = new Policy(); strRet = epAv.getAv(strAvUserName, strAvAirCode, strAvFlyDate, strAvFlyTime, strAvOrgCityCode, strAvDstCityCode); } if (strCmm == "SentOrder") { // string strOrderSent = npRet.FindTextByPath("//eg/OrderPara").Trim(); Order iob = new Order(); strRet = iob.Submit185Order(strOrderSent); } if (strCmm == "GetNewOrderMes") { // 得到网站最新的订单请求 Order iob2 = new Order(); strRet = iob2.getNewOrderList(); } if (strCmm == "LoginXyt") { string strUserName = npRet.FindTextByPath("//eg/UserName").Trim(); string strPassWord = npRet.FindTextByPath("//eg/PassWord").Trim(); strRet = mp.loginXyt(strUserName, strPassWord); } if (strCmm == "SaveCust") { //新增一个客户 Custer cu = new Custer(); strRet = cu.SaveCust(npRet.GetXML()); } if (strCmm == "UpdateCust") { //修改客户资料 Custer cu = new Custer(); strRet = cu.UpdateCust(npRet.GetXML()); } if (strCmm == "CustAirFee") { //新增客户消费记录 Custer cu = new Custer(); strRet = cu.NewCustAirFee(npRet.GetXML()); } if (strCmm == "GetCustInfoByMobile") { //得到客户资料 Custer cu = new Custer(); strRet = cu.getCustInfoByMobile(npRet.FindTextByPath("//eg/MobileNo").Trim()); } if (strCmm == "NewCustCallRec") { //新增客户来电 Custer cu = new Custer(); strRet = cu.NewCustCallRec(npRet.GetXML()); } if (strCmm == "GetCustLastCalls") { //得到客户最近10次来电 Custer cu = new Custer(); strRet = cu.GetCustLastCalls(npRet.FindTextByPath("//eg/numCustId").Trim()); } //打印,脱机打印,行程单号的记录 added by chenqj if (strCmm == "ReceiptNumberLog") { NewPara np = new NewPara(); np.AddPara("cm", "RetReceiptNumberLog"); try { string username = npRet.FindTextByPath("//eg/username").Trim(); string pnr = npRet.FindTextByPath("//eg/pnr").Trim(); string receiptNumber = npRet.FindTextByPath("//eg/receiptNumber").Trim(); string isOffline = npRet.FindTextByPath("//eg/isOffline").Trim(); eTicket.LogIt(username, pnr, receiptNumber, isOffline); np.AddPara("err", string.Empty); } catch (Exception ee) { np.AddPara("err", ee.Message); } strRet = np.GetXML(); } if (strCmm == "Check443") { string strKey = npRet.FindTextByPath("//eg/Key").Trim(); NewPara np443 = new NewPara(); np443.AddPara("cm", "RetCheck443"); if (strKey == "eg66aeg66a") { np443.AddPara("Flag", "true"); } else { np443.AddPara("Flag", "false"); } strRet = np443.GetXML(); } //如果是查询K座信息 if (strCmm == "GetKBunkInfo") { string strFromTo = npRet.FindTextByPath("//eg/fromto").Trim(); string strDate = npRet.FindTextByPath("//eg/date").Trim(); strRet = mp.GetKBunkInfo(strFromTo, strDate); } //如果是提交K座申请 if (strCmm == "ApplyKBunkInfo") { //string strFromTo = npRet.FindTextByPath("//eg/fromto").Trim(); XmlNode xn = npRet.FindNodeByPath("//eg/applyinfo"); strRet = mp.ApplyKBunkApplication(xn); } if (strCmm == "DisplayKBunkInfo") { //string strFromTo = npRet.FindTextByPath("//eg/fromto").Trim(); ///XmlNode xn = npRet.FindNodeByPath("//eg/applyinfo"); string orderid = npRet.FindTextByPath("//eg/orderid").Trim(); strRet = mp.DisplayKBunkInfo(orderid); } if (strCmm == "ProcessKOrder") { //string strFromTo = npRet.FindTextByPath("//eg/fromto").Trim(); ///XmlNode xn = npRet.FindNodeByPath("//eg/applyinfo"); strRet = mp.ProcessKOrder(npRet); } if (strCmm == "IsDecFee") { gs.util.func.Write("pnr:" + npRet.FindTextByPath("//eg/PNR").Trim() + " cm:" + strCmm); strRet = mp.IsDecFee(npRet); } //cityTicketInfo wsl add //得到所有的城市 if (strCmm == "GetAllPolicyCity") { CityTicketInfo cti = new CityTicketInfo(); strRet = cti.getAllPolicyCity(); } //更新票面信息 if (strCmm == "UpdateTicketInfo") { string bfrom = npRet.FindTextByPath("//eg/bfrom").Trim(); string eto = npRet.FindTextByPath("//eg/eto").Trim(); string bunkf = npRet.FindTextByPath("//eg/bunkf").Trim(); string bunky = npRet.FindTextByPath("//eg/bunky").Trim(); CityTicketInfo cti = new CityTicketInfo(); strRet = cti.updateTicketInfo(bfrom, eto, bunkf, bunky); } //添加票面信息 if (strCmm == "InsertTicketInfo") { string bfrom = npRet.FindTextByPath("//eg/bfrom").Trim(); string eto = npRet.FindTextByPath("//eg/eto").Trim(); string bunkf = npRet.FindTextByPath("//eg/bunkf").Trim(); string bunky = npRet.FindTextByPath("//eg/bunky").Trim(); CityTicketInfo cti = new CityTicketInfo(); strRet = cti.insertTicketInfo(bfrom, eto, bunkf, bunky); } //得到票面信息 if (strCmm == "GetTicketInfo") { string bfrom = npRet.FindTextByPath("//eg/bfrom").Trim(); string eto = npRet.FindTextByPath("//eg/eto").Trim(); CityTicketInfo cti = new CityTicketInfo(); strRet = cti.getTicketInfo(bfrom, eto); } if (strCmm == "GetEticketExcel") { string strUser = npRet.FindTextByPath("//eg/user").Trim(); string stardate = npRet.FindTextByPath("//eg/startdate").Trim(); string enddate = npRet.FindTextByPath("//eg/enddate").Trim(); strRet = mp.GetEticketReport(strUser, stardate, enddate); } //得到服务器ip地址与端口号 wsl add if (strCmm == "setIPID") { string ipid = npRet.FindTextByPath("//eg/ipid").Trim(); strRet = mp.setIPID(ipid); } //得到所有的服务器ip地址与端口号 wsl add if (strCmm == "getIPID") { strRet = mp.getIPID(); } #endregion } else { //如果返回为空,说明命令不存在 NewPara np = new NewPara(); np.AddPara("cm", "CmNotFound"); //返回消息说明请求命令没找到或指令内容为空 strRet = np.GetXML(); } } catch (Exception ex) { gs.util.func.Write("requestXML=[" + p_str + "] exception=[" + ex.Message + "]"); NewPara np = new NewPara(); np.AddPara("cm", "CmErr"); //返回消息说明命令解析不正常 np.AddPara("err", ex.Message); strRet = np.GetXML(); } //logic.GlobalFunc.iGlobalUserNum--; return(strRet); }
/// <summary> /// 得到客户最近10次来电记录 /// </summary> /// <param name="p_strCustId"></param> /// <returns></returns> public string GetCustLastCalls(string p_strCustId) { NewPara npRet = new NewPara(); string strRet = ""; string strFeeRet = ""; Conn cn = null; try { cn = new Conn(); string strSql = "select top 10 * from eg_CustCallRec where numCustId=" + p_strCustId + " order by dtCallTime desc"; DataSet ds = cn.GetDataSet(strSql); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { strRet += ds.Tables[0].Rows[i]["vcCallNo"].ToString().Trim() + "~" + ds.Tables[0].Rows[i]["dtCallTime"].ToString().Trim() + "$"; } if (strRet != "") { strRet = strRet.Substring(0, strRet.Length - 1); } ds.Clear(); //strSql = "select top 10 * from eg_CustFeeRec where numCustId=" + p_strCustId + " order by numRecId desc"; strSql = "SELECT top 10 dbo.eg_PolicyAir.vcAirName AS vcAirName,dbo.eg_PolicyCity.vcCityName AS vcSrcCityName,eg_PolicyCity_1.vcCityName AS vcDstCityName, dbo.eg_CustFeeRec.* " + " FROM dbo.eg_CustFeeRec LEFT OUTER JOIN dbo.eg_PolicyAir ON dbo.eg_CustFeeRec.vcAirCorp = dbo.eg_PolicyAir.vcAirCode LEFT OUTER JOIN dbo.eg_PolicyCity eg_PolicyCity_1 ON dbo.eg_CustFeeRec.vcDstCityCode = eg_PolicyCity_1.vcCityCode LEFT OUTER JOIN dbo.eg_PolicyCity ON dbo.eg_CustFeeRec.vcSrcCityCode = dbo.eg_PolicyCity.vcCityCode where numCustId=" + p_strCustId + " order by numRecId desc"; ds = cn.GetDataSet(strSql); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { strFeeRet += ds.Tables[0].Rows[i]["vcAirName"].ToString().Trim() + "~" + ds.Tables[0].Rows[i]["vcSrcCityName"].ToString().Trim() + "~" + ds.Tables[0].Rows[i]["vcDstCityName"].ToString().Trim() + "~" + ds.Tables[0].Rows[i]["dtFlyTime"].ToString().Trim() + "~" + ds.Tables[0].Rows[i]["vcAirNo"].ToString().Trim() + "~" + ds.Tables[0].Rows[i]["vcCabin"].ToString().Trim() + "~" + ds.Tables[0].Rows[i]["numPrice"].ToString().Trim() + "~" + ds.Tables[0].Rows[i]["vcDiscount"].ToString().Trim() + "~" + ds.Tables[0].Rows[i]["vcPnr"].ToString().Trim() + "~" + ds.Tables[0].Rows[i]["dtFeeTime"].ToString().Trim() + "$"; } if (strRet != "") { strFeeRet = strFeeRet.Substring(0, strFeeRet.Length - 1); } ds.Clear(); } catch (Exception ex) { gs.util.func.Write("logic.Custer.getCustLastCalls is err 得到客户最近10次来电记录失败" + ex.Message); throw ex; } finally { cn.close(); } npRet.AddPara("cm", "RetGetCustLastCalls"); //返回消息 npRet.AddPara("Content", strRet); npRet.AddPara("AirFee", strFeeRet); return(npRet.GetXML()); }
public bool submitinfo() { try { EagleWebService.wsKernal ws = new EagleWebService.wsKernal(GlobalVar.WebServer); NewPara np = new NewPara(); np.AddPara("cm", "PreSubmitETicket"); np.AddPara("UserID", GlobalVar.loginName); np.AddPara("Pnr", EagleAPI.etstatic.Pnr); np.AddPara("DecFeeState", "0"); string ipid = mystring.substring(GlobalVar.officeNumberCurrent, 0, 6); if (ipid.Length != 6) { if (!GlobalVar.loginLC.bSameAllConfig) { throw new Exception("—预提交—配置号错误?配置号为:" + ipid); } else { ipid = GlobalVar.loginLC.thesameipid; } } np.AddPara("IpId", ipid); if (EagleAPI.etstatic.Pnr.Trim().Length != 5) { throw new Exception("—预提交—PNR错误?PNR为:" + EagleAPI.etstatic.Pnr); } string strReq = np.GetXML(); string strRet = ws.getEgSoap(strReq); if (strRet != "") { NewPara np1 = new NewPara(strRet); if (np1.FindTextByPath("//eg/cm") == "RetPreSubmitETicket" && np1.FindTextByPath("//eg/OperationFlag") == "SaveSucc") { EagleAPI.LogWrite(EagleAPI.etstatic.Pnr + " PreSubmitETicket 预提交成功!\r\n"); return(true); } else if (np1.FindTextByPath("//eg/cm") != "CmErr") { System.Windows.Forms.MessageBox.Show(strReq); } else { return(true); } } else { MessageBox.Show("PreSubmitETicket与服务器数据库连接失败!", "易格服务器错误", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Source + ex.Message); } return(false); }
/// <summary> /// 修改客户资料 /// </summary> /// <param name="p_strXml"></param> /// <returns></returns> public string UpdateCust(string p_strXml) { NewPara npRet = new NewPara(); string strRet = "fail"; NewPara npCust = new NewPara(p_strXml); string strCustId = npCust.FindTextByPath("//eg/numCustId").Trim(); //string strAgentId = Right.getAgent(npCust.FindTextByPath("//eg/vcInpEgUser").Trim()); string strErr = ""; Conn cn = null; try { cn = new Conn(); //cn.beginTrans(); string strIdentCard = npCust.FindTextByPath("//eg/vcIdentCard").Trim(); string strSql = "select * from eg_Custer where vcIdentCard='" + strIdentCard + "' and numCustId<>" + strCustId; DataSet ds = cn.GetDataSet(strSql); if (ds.Tables[0].Rows.Count == 0) { Top2 tp = new Top2(cn); //tp.AddRow("numCustId","i",strCustId); tp.AddRow("vcCustNo", "c", npCust.FindTextByPath("//eg/vcCustNo")); tp.AddRow("vcCustName", "c", npCust.FindTextByPath("//eg/vcCustName")); tp.AddRow("vcTel", "c", npCust.FindTextByPath("//eg/vcTel")); tp.AddRow("vcMobile", "c", npCust.FindTextByPath("//eg/vcMobile")); //tp.AddRow("vcInpEgUser","c",npCust.FindTextByPath("//eg/vcInpEgUser")); tp.AddRow("vcIdentCard", "c", strIdentCard); tp.AddRow("numIdentType", "i", npCust.FindTextByPath("//eg/numIdentType")); tp.AddRow("vcUnitName", "c", npCust.FindTextByPath("//eg/vcUnitName")); //tp.AddRow("numAgentId","c",strAgentId); tp.AddRow("numCustType", "i", npCust.FindTextByPath("//eg/numCustType")); tp.AddRow("numMemSrc", "i", npCust.FindTextByPath("//eg/numMemSrc")); //tp.AddRow("numMemScore","i","0"); tp.AddRow("dtCustBuildTime", "t", "getdate()"); //tp.AddRow("dtLastFee","c","1949-10-1"); tp.AddRow("vcCustAdr", "c", npCust.FindTextByPath("//eg/vcCustAdr")); tp.AddRow("vcPostCode", "c", npCust.FindTextByPath("//eg/vcPostCode")); tp.AddRow("dtBirthDay", "c", npCust.FindTextByPath("//eg/dtBirthDay")); tp.AddRow("vcCredCardOne", "c", npCust.FindTextByPath("//eg/vcCredCardOne")); tp.AddRow("vcCredCardTwo", "c", npCust.FindTextByPath("//eg/vcCredCardTwo")); if (tp.Update("eg_Custer", "numCustId", strCustId)) { strErr = "修改成功"; strRet = "succ"; } else { strErr = "修改失败,请检查数据"; gs.util.func.Write("logic.UpdateCust is err 修改失败,请检查数据"); } } else { strRet = "reCust"; } //cn.commit(); } catch (Exception ex) { //cn.rollback(); strErr = "修改客户资料失败" + ex.Message; gs.util.func.Write("logic.UpdateCust is err 修改客户失败" + ex.Message); } finally { cn.close(); } npRet.AddPara("cm", "RetUpdateCust"); //返回消息 npRet.AddPara("Flag", strRet); npRet.AddPara("CustId", strCustId); npRet.AddPara("Mes", strErr); return(npRet.GetXML()); }
private void saveCustInfo(Conn cn, string p_strOper, string p_strCustInfo) { try { string strRet = ""; if (p_strCustInfo.Trim() != "") { strRet = p_strCustInfo.Trim(); if (strRet.IndexOf(";") > 1) { string[] aryCusts = strRet.Split(';'); for (int i = 0; i < aryCusts.Length; i++) { string strACust = aryCusts[i]; if (strACust.IndexOf(";") > 1) { string[] ary = strACust.Split('-'); if (ary.Length > 2) { NewPara npCust = new NewPara(); npCust.AddPara("cm", "SaveCust"); //操作类型说明 npCust.AddPara("vcInpEgUser", p_strOper); npCust.AddPara("vcIdentCard", ary[1]); npCust.AddPara("vcCustName", ary[0]); npCust.AddPara("vcMobile", ary[2]); npCust.AddPara("numMemSrc", "2"); Custer cu = new Custer(); cu.SaveCust(cn, npCust.GetXML()); } } } } else { if (strRet.IndexOf(";") > 1) { string[] ary = strRet.Split('-'); if (ary.Length > 2) { NewPara npCust = new NewPara(); npCust.AddPara("cm", "SaveCust"); //操作类型说明 npCust.AddPara("vcInpEgUser", p_strOper); npCust.AddPara("vcIdentCard", ary[1]); npCust.AddPara("vcCustName", ary[0]); npCust.AddPara("vcMobile", ary[2]); npCust.AddPara("numMemSrc", "2"); Custer cu = new Custer(); string strRetCust = cu.SaveCust(cn, npCust.GetXML()); //NewPara npRet = new NewPara(strRetCust); //string strCustId = npRet.FindTextByPath("//eg/CustId"); } } } } } catch (Exception ex) { gs.util.func.Write("PnrTicket.saveCustInfo is err" + ex.Message); } }
/// <summary> /// C客户得到自己首页的一些参数 /// </summary> /// <param name="p_strUserName"></param> /// <returns></returns> public string getCUserPageXml(string p_strAgentCode) { NewPara npRet = new NewPara(); XmlDocument doc = npRet.getRoot(); npRet.AddPara("cm", "RetCUserFirstPage"); XmlNode nodeAirs = npRet.AddPara("AirList", ""); XmlNode nodeCitys = npRet.AddPara("CityList", ""); Conn cn = null; try { cn = new Conn(); string strSql = "select '全部' as vcAirName,'' as vcAirCode union select vcAirName,vcAirCode from eg_PolicyAir order by vcAirCode"; DataSet ds = cn.GetDataSet(strSql); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { XmlNode subNodeNew = doc.CreateNode(XmlNodeType.Element, "AAIR", ""); XmlNode subIpNode = null; subIpNode = doc.CreateNode(XmlNodeType.Element, "AirName", ""); subIpNode.AppendChild(doc.CreateTextNode(ds.Tables[0].Rows[i]["vcAirName"].ToString().Trim())); subNodeNew.AppendChild(subIpNode); //把变量值赋进去 subIpNode = doc.CreateNode(XmlNodeType.Element, "AirCode", ""); subIpNode.AppendChild(doc.CreateTextNode(ds.Tables[0].Rows[i]["vcAirCode"].ToString().Trim())); subNodeNew.AppendChild(subIpNode); nodeAirs.AppendChild(subNodeNew); } strSql = "select vcCityPy + '-' + vcCityName as vcCityName,vcCityCode from eg_PolicyCity order by vcCityPy"; ds = cn.GetDataSet(strSql); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { XmlNode subNodeNew = doc.CreateNode(XmlNodeType.Element, "ACITY", ""); XmlNode subIpNode = null; subIpNode = doc.CreateNode(XmlNodeType.Element, "CityName", ""); subIpNode.AppendChild(doc.CreateTextNode(ds.Tables[0].Rows[i]["vcCityName"].ToString().Trim())); subNodeNew.AppendChild(subIpNode); //把变量值赋进去 subIpNode = doc.CreateNode(XmlNodeType.Element, "CityCode", ""); subIpNode.AppendChild(doc.CreateTextNode(ds.Tables[0].Rows[i]["vcCityCode"].ToString().Trim())); subNodeNew.AppendChild(subIpNode); nodeCitys.AppendChild(subNodeNew); } strSql = "select vcWebCUser from eg_AgentCUser where numAgentId='" + p_strAgentCode + "'"; ds = cn.GetDataSet(strSql); string strWebUser = ""; if (ds.Tables[0].Rows.Count > 0) { strWebUser = ds.Tables[0].Rows[0]["vcWebCUser"].ToString().Trim(); } npRet.AddPara("WebUser", strWebUser); //计算当前用户所在代理商所在城市 string strAgentCode = ""; if (p_strAgentCode.Length > 8) { strAgentCode = p_strAgentCode.Substring(0, 8); } else { strAgentCode = p_strAgentCode; } string strSqlCity = "SELECT vcCityCode FROM eg_agent where numAgentId ='" + strAgentCode + "'"; //gs.util.func.Write("strSqlCity=" + strSqlCity); DataSet rsRet = cn.GetDataSet(strSqlCity); string strCityCode = rsRet.Tables[0].Rows[0]["vcCityCode"].ToString().Trim(); //得到用户所在城市 rsRet.Clear(); npRet.AddPara("InCity", strCityCode); } catch (Exception ex) { gs.util.func.Write("WS.EgUser.getCUserPageXml is err" + ex.Message); } finally { cn.close(); } return(npRet.GetXML()); }
/// <summary> /// 河南邮政185接口 /// </summary> /// <param name="p_str185"></param> /// <returns></returns> public string Submit185Order(string p_str185) { Conn cn = null; NewPara np = new NewPara(); XmlDocument doc = np.getRoot(); string strRet = ""; try { string[] ary = p_str185.Split('$'); NewPara npSent = new NewPara(); npSent.AddPara("AirNo", ary[7]); npSent.AddPara("ActionCode", "LL"); npSent.AddPara("DepartTime", Policy.getIBEDate2(ary[33])); npSent.AddPara("Dst", ary[3]); npSent.AddPara("Org", ary[2]); npSent.AddPara("SeatName", ary[11]); npSent.AddPara("EtkPrc", ary[12]); npSent.AddPara("Fule", ary[15]); npSent.AddPara("BaseFee", ary[14]); npSent.AddPara("TkDate", Policy.getIBEDate(ary[33])); npSent.AddPara("PerCount", ary[16]); XmlDocument rootDoc = npSent.getRoot(); XmlNode nodeRecord = npSent.AddPara("record", ""); string strCuster = ary[34]; string[] aryCust = strCuster.Split('~'); for (int iTmp = 0; iTmp < aryCust.Length; iTmp++) { string strACust = aryCust[iTmp]; string[] aryCustView = strACust.Split('*'); string strPerName = aryCustView[0]; string strIdentCardType = aryCustView[1]; string strMobile = aryCustView[2]; string strIdentCardNo = aryCustView[3]; string chInsurance = aryCustView[4]; XmlNode nodeRec = rootDoc.CreateNode(XmlNodeType.Element, "rec", ""); XmlNode subNode = rootDoc.CreateNode(XmlNodeType.Element, "IdCard", ""); subNode.AppendChild(rootDoc.CreateTextNode(strIdentCardNo)); nodeRec.AppendChild(subNode); //把变量值赋进去 subNode = rootDoc.CreateNode(XmlNodeType.Element, "AirCorp", ""); subNode.AppendChild(rootDoc.CreateTextNode(ary[6])); nodeRec.AppendChild(subNode); //把变量值赋进去 subNode = rootDoc.CreateNode(XmlNodeType.Element, "IdType", ""); subNode.AppendChild(rootDoc.CreateTextNode("NI")); nodeRec.AppendChild(subNode); //把变量值赋进去 subNode = rootDoc.CreateNode(XmlNodeType.Element, "CustName", ""); subNode.AppendChild(rootDoc.CreateTextNode(strPerName)); nodeRec.AppendChild(subNode); //把变量值赋进去 nodeRecord.AppendChild(nodeRec); } //TextBox1.Text = npSent.GetXML(); //gs.util.func.Write("1111"); IBECOMService ic = new IBECOMService(); string strPnr = ic.MakeOrder(npSent.GetXML()); gs.util.func.Write("pnr=" + strPnr); np.AddPara("cm", "SubmitWebOrder"); // np.AddPara("pnr", strPnr); //np.AddPara("pnr",ary[0]); np.AddPara("CurUserName", ary[1]); //gs.util.func.Write("CurUserName="******"BeginPort", ary[2]); np.AddPara("EndPort", ary[3]); np.AddPara("BeginPortName", ary[4]); np.AddPara("EndPortName", ary[5]); np.AddPara("AirName", ary[6]); np.AddPara("FlightNo", ary[7]); np.AddPara("DepaTime", ary[8]); np.AddPara("LandTime", ary[9]); np.AddPara("AirType", ary[10]); np.AddPara("SeatName", ary[11]); np.AddPara("EtkPrc", ary[12]); np.AddPara("RealPrc", ary[13]); np.AddPara("BaseFee", ary[14]); np.AddPara("Fule", ary[15]); np.AddPara("PerCounts", ary[16]); np.AddPara("RetGain", ary[17]); np.AddPara("AirRetGain", ary[18]); np.AddPara("PubGain", ary[19]); np.AddPara("PoliId", ary[20]); np.AddPara("Total", ary[21]); //gs.util.func.Write("Total="+ary[21]); np.AddPara("PoliBegin", ary[22]); np.AddPara("PoliEnd", ary[23]); np.AddPara("ProviderAgentName", ary[24]); np.AddPara("ProviderAgentId", ary[25]); np.AddPara("vcSaleContacter", ary[26]); np.AddPara("vcSalMobile", ary[27]); np.AddPara("vcSalTel", ary[28]); np.AddPara("vcSalQq", ary[29]); np.AddPara("vcAddress", ary[30]); //gs.util.func.Write("vcAddress="+ary[30]); np.AddPara("AirCorpName", ary[31]); np.AddPara("Discount", ary[32]); //gs.util.func.Write("Discount="+ary[32]); np.AddPara("FlyDate", ary[33]); //gs.util.func.Write("FlyDate="+ary[33]); //gs.util.func.Write("2222"); //string strCuster = ary[34]; //string[] aryCust = strCuster.Split('~'); XmlNode nodeCusters = np.AddPara("Custer", ""); gs.util.func.Write("aryCust.Length=" + aryCust.Length); for (int iTmp = 0; iTmp < aryCust.Length; iTmp++) { string strACust = aryCust[iTmp]; string[] aryCustView = strACust.Split('*'); XmlNode subCuster = doc.CreateNode(XmlNodeType.Element, "ACUSTER", ""); XmlNode subNode = null; //gs.util.func.Write("aryCustView[0]="+aryCustView[0]); subNode = doc.CreateNode(XmlNodeType.Element, "PerName", ""); subNode.AppendChild(doc.CreateTextNode(aryCustView[0])); subCuster.AppendChild(subNode); //把变量值赋进去 //gs.util.func.Write("aryCustView[1]="+aryCustView[1]); subNode = doc.CreateNode(XmlNodeType.Element, "IdentCardType", ""); subNode.AppendChild(doc.CreateTextNode(aryCustView[1])); subCuster.AppendChild(subNode); //把变量值赋进去 subNode = doc.CreateNode(XmlNodeType.Element, "Mobile", ""); subNode.AppendChild(doc.CreateTextNode(aryCustView[2])); subCuster.AppendChild(subNode); //把变量值赋进去 subNode = doc.CreateNode(XmlNodeType.Element, "IdentCardNo", ""); subNode.AppendChild(doc.CreateTextNode(aryCustView[3])); subCuster.AppendChild(subNode); //把变量值赋进去 subNode = doc.CreateNode(XmlNodeType.Element, "Insurance", ""); subNode.AppendChild(doc.CreateTextNode(aryCustView[4])); subCuster.AppendChild(subNode); //把变量值赋进去 //gs.util.func.Write("aryCustView[4]="+aryCustView[4]); nodeCusters.AppendChild(subCuster); } string strSent = np.GetXML(); cn = new Conn(); cn.beginTrans(); strRet = SubmitOrder(cn, strSent); cn.commit(); } catch (Exception ex) { cn.rollback(); strRet = "outtkerr"; gs.util.func.Write("Submit185Order is err=" + ex.Message); } finally { cn.close(); } return(strRet); }
private void bt_Print_Click(object sender, EventArgs e) { if (dtp保险起始时间.Value < DateTime.Today) { MessageBox.Show("保险起始日期不能早于今日!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } try { if (DateTime.Parse(tb乘机日.Text.Trim()) < DateTime.Today) { MessageBox.Show("乘机日期不能早于当前日期!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } } catch { MessageBox.Show("乘机日期填写格式有误,请核对!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (bLastString == cb被保险人姓名.Text && cb被保险人姓名.Text != "") { if (MessageBox.Show(bLastString + "->已经打印,是否再打印一张?", "警告", MessageBoxButtons.YesNo) == DialogResult.No) { return; } } //bt_Print.Enabled = false; Application.DoEvents(); try { bLianxu = false; try { save_cfg(); } catch (Exception ee) { MessageBox.Show(ee.Message + "save_cfg()"); } if (insuranceNumberLength == 0) { MessageBox.Show("未设置对应险种的保单序号长度insuranceNumberLength"); return; } if (tb保单序号.Text.Trim().Length != insuranceNumberLength) { if (insuranceType == "B09" || insuranceType == "B0D") { ; } else { MessageBox.Show("保单序号长度错误," + insuranceNumberLength.ToString() + "位"); return; } } try { long.Parse(tb保单序号.Text.Trim()); } catch { if ((insuranceType == "B09") || (insuranceType == "B0D")) { ; } else { MessageBox.Show("保单序号只能为数字"); return; } } if (cb被保险人姓名.Text.Trim() == "") { MessageBox.Show("姓名不能为空"); return; } if (tb证件号.Text.Trim() == "") { MessageBox.Show("证件号码不能为空"); return; } try { DateTime dtTemp = DateTime.Parse(tb乘机日.Text.Trim()); if (dtTemp.Year != DateTime.Now.Year) { if (MessageBox.Show("乘机日期:" + tb乘机日.Text + " 请确认!", "注意", MessageBoxButtons.OKCancel) != DialogResult.OK) { return; } } } catch { if (bhyx) { MessageBox.Show("乘机日期格式错误,如2007-4-2"); return; } } tb保单号码.Text = eNumberHead + EagleAPI.GetRandom62(); if (insuranceType == "B08") { tb保单号码.Text = eNumberHead + DateTime.Now.Date.ToString("yyyyMMdd") + tb保单序号.Text; } if (paperHeight == 0 || paperWidth == 0) { MessageBox.Show("未设置打印纸的宽与高paperHeight,paperWidth"); return; } if (!GlobalVar.b_OffLine) { if (cb被保险人姓名.Text.Trim() != GlobalVar.HYXTESTPRINT) { HyxStructs hs = new HyxStructs(); hs.UserID = GlobalVar.loginName; hs.eNumber = tb保单号码.Text; hs.IssueNumber = tb保单序号.Text; hs.NameIssued = cb被保险人姓名.Text; hs.CardType = "航班号" + tb航班号.Text + "乘机日" + tb乘机日.Text;; hs.CardNumber = tb证件号.Text; hs.Remark = insuranceType; //保险种类别名代码B06 hs.IssuePeriod = ""; hs.IssueBegin = (bhyx ? tb乘机日.Text : dtp保险起始时间.Value.ToString()); //必须为时间串 hs.IssueEnd = (bhyx ? tb乘机日.Text : dtp保险终止时间.Value.ToString()); //必须为时间串 hs.SolutionDisputed = ""; hs.NameBeneficiary = tb受益人资料.Text + tb受益人关系.Text; hs.Signature = tb经办人.Text; // tbSignatureDate.Text; hs.SignDate = tb填开日期.Text; //dtp_Date.Value.ToShortDateString(); hs.InssuerName = ""; hs.Pnr = tbPnr.Text; bSubmitting = true; bt_Print.Text = "提交中………………请稍等"; Application.DoEvents(); //while (this.insuranceType=="B07" && GlobalVar.serverAddr== GlobalVar.ServerAddr.HangYiWang) //{ // try // { // string ddd = "adksfj"; // DateTime eee = DateTime.Parse(ddd); // } // catch (Exception ex) // { // MessageBox.Show(ex.Message); // } //} if (insuranceType == "B09" || insuranceType == "B0D") { EagleWebService.wsKernal ws = new EagleWebService.wsKernal(GlobalVar.WebServer); NewPara np = new NewPara(); np.AddPara("cm", "SubmitEagleIns"); np.AddPara("UserAccount", "testaccount"); np.AddPara("UserPassword", "testpassword"); np.AddPara("CardIdNumber", "身份证号"); np.AddPara("FlightNumber", "航班号"); np.AddPara("FlightDate", "乘机日"); np.AddPara("BenefitRelation", "受益人关系"); np.AddPara("BenefitZiliao", "受益人资料"); np.AddPara("Telephone", "电话号码"); np.AddPara("Name", "被保险人名"); np.AddPara("PrintHead", "台头" + insuranceType); string strReq = np.GetXML(); string strRet = ws.getEgSoap(strReq); EP.WebService epws = new EP.WebService(); EP.WebServiceReturnEntity epret = new EP.WebServiceReturnEntity(); if (insuranceType == "B09") { epret = epws.Purchase(GlobalVar2.bxUserAccount, GlobalVar2.bxPassWord, lb公司名称.Text, DateTime.Parse(tb乘机日.Text), tb航班号.Text, tb证件号.Text, cb被保险人姓名.Text, GlobalVar2.bxTelephone, tb受益人关系.Text, tb受益人资料.Text); } else { epret = epws.PurchasePICC(GlobalVar2.bxUserAccount, GlobalVar2.bxPassWord, lb公司名称.Text, DateTime.Parse(tb乘机日.Text), tb航班号.Text, tb证件号.Text, cb被保险人姓名.Text, GlobalVar2.bxTelephone, tb受益人关系.Text, tb受益人资料.Text); } bt_Print.Text = "打印(&P)"; if (!epret.Enabled) { MessageBox.Show(epret.ErrorMsg); return; } else { //打印 tb保单号码.Text = epret.SerialNo; //微机码 tb保单序号.Text = epret.CaseNo; //单证号码 tb经办人.Text = epret.AgentName; //加盟商明称 } } else { if (!hs.SubmitInfo()) { bSubmitting = false; bt_Print.Text = "打印(&P)"; //MessageBox.Show("数据提交失败!请检查保单号是否已被使用,或网络是否正常!"); return; } } bt_Print.Text = "打印(&P)"; bSubmitting = false; } } PrintDialog pd = new PrintDialog(); EagleAPI.PrinterSetupCostom(ptDoc, paperWidth, paperHeight); pd.Document = ptDoc; //DialogResult dr = pd.ShowDialog(); //if (dr == DialogResult.OK) { ptDoc.Print(); } } catch (Exception ee) { MessageBox.Show(ee.Message); } bLastString = cb被保险人姓名.Text; bt_Print.Enabled = true; }
public static streamctrl_enum send(string content, int msgtype) { try { if (GlobalVar.loginName.ToLower() == "bb" && content.ToLower().Contains("etdz")) { return(streamctrl_enum.TEST_ACCOUNT); } #region xepnr操作权限控制 { string t_xepnr = content.ToLower().Trim(); if (t_xepnr.IndexOf("xepnr") == 0 || t_xepnr.IndexOf("~xepnr") >= 0 || t_xepnr.IndexOf("xe") == 0 || t_xepnr.IndexOf("~xe") >= 0) {//并且要在不为ETDZ的情况下,不然在ETDZ的时候,还没有判断就返回了XEPNR:即在ETDZ时不做以下判断 if (EagleAPI.substring(content, 0, 4).ToLower() == "etdz" || content.ToLower().IndexOf("~etdz") >= 0) { ; } else { string t_pnr = EagleAPI.etstatic.Pnr; pnr_statistics ps = new pnr_statistics(); ps.pnr = t_pnr; ps.state = "2"; if (!Model.md.b_00C && t_xepnr.Contains("xepnr")) //不能取消他人PNR,则进行提交判断 { if ((!ps.submit())) //取消失败,则返回失败 { if (t_xepnr.IndexOf("xepnr") == 0 || t_xepnr.IndexOf("~xepnr") >= 0) { return(streamctrl_enum.XEPNR_FAIL); } else { return(streamctrl_enum.XE_FAIL); } } } } } } #endregion if (EagleAPI.substring(content, 0, 4).ToLower() == "etdz" || content.ToLower().IndexOf("~etdz") >= 0) { GlobalVar.b_etdz = true; } GlobalVar.b_pat = (EagleAPI.substring(content, 0, 4).ToLower() == "pat:"); GlobalVar.b_cmd_trfd_AM = ((EagleAPI.substring(content, 0, 7).ToLower() == "trfd:am") || (EagleAPI.substring(content, 0, 7).ToLower() == "trfd am")); GlobalVar.b_cmd_trfd_M = ((EagleAPI.substring(content, 0, 6).ToLower() == "trfd:m") || (EagleAPI.substring(content, 0, 6).ToLower() == "trfd m")); GlobalVar.b_cmd_trfd_L = ((EagleAPI.substring(content, 0, 6).ToLower() == "trfd:l") || (EagleAPI.substring(content, 0, 6).ToLower() == "trfd l")); if (EagleAPI.substring(content, 0, 4).ToLower() == "trfx") { content = content.Replace('*', (char)0x1A); content = content.Replace("/", ""); } if (content == "i" || content == "ig") { GlobalVar.b_etdz = false; GlobalVar.b_enoughMoney = false; GlobalVar.b_endbook = false; } //if(EagleAPI.substring(content,0,1)=="@" || EagleAPI.substring(content,0,1)=="\\")//0926 //bool bEnough = false; #region etdz金额不足控制 if (GlobalVar.b_etdz) { try { bool bIsDecFee = false;//是否扣过款了 if (GlobalVar.newEticket.peaplecount < 1) { GlobalVar.newEticket.peaplecount = 1; } string srvUrl = ""; if (GlobalVar.serverAddr == GlobalVar.ServerAddr.Eagle) { //if (GlobalVar2.gbConnectType == 1) srvUrl = "http://yinge.eg66.com/WS3/egws.asmx"; //if (GlobalVar2.gbConnectType == 2) srvUrl = "http://wangtong.eg66.com/WS3/egws.asmx"; } //else srvUrl = GlobalVar.WebServer; EagleWebService.wsKernal ws = new EagleWebService.wsKernal(srvUrl); NewPara np = new NewPara(); np.AddPara("cm", "IsDecFee"); np.AddPara("pnr", EagleAPI.etstatic.Pnr); string strSent = np.GetXML(); string strreturn = ""; if (GlobalVar.serverAddr == GlobalVar.ServerAddr.Eagle) { strreturn = ws.getEgSoap(strSent); } if (!string.IsNullOrEmpty(strreturn.Trim())) { np = new NewPara(strreturn); string strCm = np.FindTextByPath("//eg/cm"); string strIsDecFee = np.FindTextByPath("//eg/IsDecFee"); if (strCm == "ReIsDecFee" && strIsDecFee.Trim() == "1") { EagleAPI.LogWrite(EagleAPI.etstatic.Pnr + "已经扣过款,不再进行余额检查和扣款!\r\n"); bIsDecFee = true; } } if (!bIsDecFee && (float.Parse(GlobalVar.f_CurMoney) < GlobalVar.f_limitMoneyPerTicket * GlobalVar.newEticket.peaplecount) && float.Parse(GlobalVar.f_CurMoney) < 0)//&& 1==0)float.Parse(GlobalVar.f_CurMoney) < GlobalVar.f_fc || { //余额不足 EagleAPI.LogWrite("<计算是否够金额出票>当前余额为" + GlobalVar.f_CurMoney + ",预计扣款额为" + GlobalVar.f_limitMoneyPerTicket.ToString() + "*" + GlobalVar.newEticket.peaplecount.ToString()); GlobalVar.b_etdz = false; GlobalVar.b_enoughMoney = false; GlobalVar.b_endbook = false; content = "i"; return(streamctrl_enum.NOT_ENOUGH_MONEY); } else { string[] cmdarray = content.Split('~'); bool bHasRtPnrCmd = false; foreach (string c in cmdarray) { if (c.ToLower().Length >= 7 && c.ToLower().IndexOf("rt") == 0) { bHasRtPnrCmd = true; break; } } if ((!bHasRtPnrCmd) && (!GlobalVar.bUsingConfigLonely)) { //return streamctrl_enum.HAS_NO_PNR; } GlobalVar.b_enoughMoney = true; content = content + ""; //初步提交,状态0,预提交 ePlus.eTicket.etPreSubmit etmp = new ePlus.eTicket.etPreSubmit(); bool bsubed = false; for (int iSubmit = 0; iSubmit < 3; iSubmit++) { if (etmp.submitinfo()) { if (GlobalVar.serverAddr == GlobalVar.ServerAddr.KunMing) { int price = EagleString.EagleFileIO.PriceOfPnrInFile(EagleAPI.etstatic.Pnr); GlobalVar.f_Balance -= price; } bsubed = true; break; } } if (!bsubed) { GlobalVar.b_etdz = false; return(streamctrl_enum.PRE_SUBMIT_FAIL); } //预提交成功,则同时提交PNR到PNR统计里 try { pnr_statistics ps = new pnr_statistics(); ps.pnr = EagleAPI.etstatic.Pnr; ps.state = "3"; Thread thSubmitPnr = new Thread(new ThreadStart(ps.submit1)); thSubmitPnr.Start(); } catch { }; } } catch (Exception ex2) { throw new Exception("Ex2 :" + ex2.Message); } } #endregion #region rtxxxxx取当前操作的PNR,注意msgtype=3 { if (msgtype == 3) { string[] arrayTemp = content.Split('~'); for (int i = 0; i < arrayTemp.Length; i++) { if (EagleAPI.substring(arrayTemp[i], 0, 2).ToLower() == "rt" && content.Length >= 7) { EagleAPI.CLEARCMDLIST(msgtype); EagleAPI.etstatic.Pnr = mystring.right(arrayTemp[i].Trim(), 5); } } } } #endregion content = content.Replace((char)0x0A, (char)0x0D);//发送中换行\r转换成\n log.strSend = content;//同Command.SendString connect_4_Command.SendString = content; GlobalVar.b_querryCommand = false; GlobalVar.b_otherCommand = false; return(streamctrl_enum.NONE); } catch (Exception ex) { throw new Exception("StreamControl : " + ex.Message); } }