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 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); }
/// <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> /// 执行扣款 /// </summary> /// <returns></returns> private void DoDecFee() { string strRet = ""; if (CalcFee()) { if (Convert.ToInt32(this.strOriginallyBalance) < Convert.ToInt32(this.strMuPaFee)) { throw new Exception("\r\n该用户余额不足,不能出票!\r\n>"); } strRet = InvokeWS(); } else { throw new Exception("\r\n计算多人总票价出错!\r\n>"); } if (strRet == null || strRet == "") { throw new Exception("\r\n调用 WebService 返回不正常!xml:" + strRet + "\r\n>"); } 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") { strCurrentBalance = GlobalVar.f_CurMoney = money; string agrs = "\r\n调用扣款服务" + "<eg66>" + strPnr; strProResult = "\r\n系统开始减款,用户原始余额:" + strOriginallyBalance + "扣款:" + strMuPaFee; strProResult += "\r\n" + "用户当前余额:" + strCurrentBalance + "\r\n"; GlobalVar.b_netdz = true; DoEtdz(); EagleAPI.LogWrite(agrs + strProResult); } else { //if (cm == "RetDecFee" && decstat == "Deced") //{ //} //else //{ throw new Exception("cm:" + cm + " err:" + err + Environment.NewLine); //} } }
private picc2 GetConfig() { FileStream fs = new FileStream(GlobalVar.s_configfile, FileMode.Open, FileAccess.Read); StreamReader sr = new StreamReader(fs, Encoding.Default); string temp = sr.ReadToEnd(); sr.Close(); fs.Close(); picc2 ret = new picc2(); NewPara np = new NewPara(temp); ret.Signature = np.FindTextByPath("//eg/PrintPICC2/Signature"); ret.Conflict = np.FindTextByPath("//eg/PrintPICC2/Conflict"); ret.OffsetX = int.Parse(np.FindTextByPath("//eg/PrintPICC2/OffsetX")); ret.OffsetY = int.Parse(np.FindTextByPath("//eg/PrintPICC2/OffsetY")); ret.SaveNo = np.FindTextByPath("//eg/PrintPICC2/SaveNo"); return(ret); }
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); }
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); } }
public string SubmitOrder(Conn cn, string p_strXML) { //gs.util.func.Write(p_strXML); NewPara npRet = new NewPara(p_strXML.Trim()); string strCmm = npRet.FindTextByPath("//eg/cm").Trim(); string strErr = ""; string strOrderId = ""; string strPnr = ""; if (strCmm == "SubmitWebOrder") { strPnr = npRet.FindTextByPath("//eg/pnr").Trim(); if (strPnr != null && strPnr != "" && strPnr != "fail") { string strCurUserName = npRet.FindTextByPath("//eg/CurUserName").Trim(); try { strOrderId = logic.mytool.util.getId(cn, "eg_PolOrder"); string strCurAgentId = ""; string strSql = "select dbo.getAgentName(eg_user.numAgentId) as agentdepthname,eg_user.*,eg_agent.vcAgentName from dbo.eg_agent INNER JOIN dbo.eg_user ON dbo.eg_agent.numAgentId = dbo.eg_user.numAgentId where eg_user.vcLoginName='" + strCurUserName + "'"; DataSet ds = cn.GetDataSet(strSql); string strAgentDepthName = ""; string strCurUserTitle = ""; if (ds.Tables[0].Rows.Count > 0) { strAgentDepthName = ds.Tables[0].Rows[0]["agentdepthname"].ToString().Trim(); strCurAgentId = ds.Tables[0].Rows[0]["numAgentId"].ToString().Trim(); strCurUserTitle = ds.Tables[0].Rows[0]["vcUserTitle"].ToString().Trim(); } Top2 tp = new Top2(cn); //gs.util.func.Write("txtTotal.Text.Trim()=" + txtTotal.Text.Trim()); tp.AddRow("numOrderId", "i", strOrderId); tp.AddRow("vcBeginPort", "c", npRet.FindTextByPath("//eg/BeginPort").ToString().Trim()); tp.AddRow("vcEndPort", "c", npRet.FindTextByPath("//eg/EndPort").ToString().Trim()); tp.AddRow("vcBeginPortName", "c", npRet.FindTextByPath("//eg/BeginPortName").ToString().Trim()); tp.AddRow("vcEndPortName", "c", npRet.FindTextByPath("//eg/EndPortName").ToString().Trim()); tp.AddRow("vcAirCode", "c", npRet.FindTextByPath("//eg/AirName").ToString().Trim().Substring(0, 2)); //航空公司代码 tp.AddRow("vcFlightNo", "c", npRet.FindTextByPath("//eg/FlightNo").ToString().Trim()); //航班号 tp.AddRow("vcStartTime", "c", npRet.FindTextByPath("//eg/DepaTime").ToString().Trim()); tp.AddRow("vcLandTime", "c", npRet.FindTextByPath("//eg/LandTime").ToString().Trim()); tp.AddRow("vcFlightType", "c", npRet.FindTextByPath("//eg/AirType").ToString().Trim()); tp.AddRow("vcRetTkRule", "c", ""); tp.AddRow("vcSeatName", "c", npRet.FindTextByPath("//eg/SeatName").ToString().Trim()); tp.AddRow("numTkPrc", "d", npRet.FindTextByPath("//eg/EtkPrc").ToString().Trim()); tp.AddRow("numRealPrc", "d", npRet.FindTextByPath("//eg/RealPrc").ToString().Trim()); tp.AddRow("numBase", "d", npRet.FindTextByPath("//eg/BaseFee").ToString().Trim()); tp.AddRow("numFuel", "d", npRet.FindTextByPath("//eg/Fule").ToString().Trim()); tp.AddRow("numPersCount", "i", npRet.FindTextByPath("//eg/PerCounts").ToString().Trim()); tp.AddRow("numRetGain", "d", npRet.FindTextByPath("//eg/RetGain").ToString().Trim()); tp.AddRow("numAirGain", "d", npRet.FindTextByPath("//eg/AirRetGain").ToString().Trim()); tp.AddRow("numPubGain", "d", npRet.FindTextByPath("//eg/PubGain").ToString().Trim()); tp.AddRow("numPoliId", "i", npRet.FindTextByPath("//eg/PoliId").ToString().Trim()); tp.AddRow("numTotal", "d", npRet.FindTextByPath("//eg/Total").ToString().Trim()); tp.AddRow("vcSaleCode", "c", strCurUserName); tp.AddRow("vcSaleUserName", "c", strCurUserTitle); tp.AddRow("vcSaleAgentName", "c", strAgentDepthName); tp.AddRow("vcSaleAgentCode", "c", strCurAgentId); tp.AddRow("dtPoliBegin", "c", npRet.FindTextByPath("//eg/PoliBegin").ToString().Trim()); tp.AddRow("dtPoliEnd", "c", npRet.FindTextByPath("//eg/PoliEnd").ToString().Trim()); tp.AddRow("vcProviderAgentName", "c", npRet.FindTextByPath("//eg/ProviderAgentName").ToString().Trim()); tp.AddRow("vcProviderAgentCode", "c", npRet.FindTextByPath("//eg/ProviderAgentId").ToString().Trim()); tp.AddRow("vcSaleContacter", "c", npRet.FindTextByPath("//eg/vcSaleContacter").ToString().Trim()); tp.AddRow("vcSalMobile", "c", npRet.FindTextByPath("//eg/vcSalMobile").ToString().Trim()); tp.AddRow("vcSalTel", "c", npRet.FindTextByPath("//eg/vcSalTel").ToString().Trim()); tp.AddRow("vcSalQq", "c", npRet.FindTextByPath("//eg/vcSalQq").ToString().Trim()); tp.AddRow("vcAddress", "c", npRet.FindTextByPath("//eg/vcAddress").ToString().Trim()); tp.AddRow("vcAirCorpName", "c", npRet.FindTextByPath("//eg/AirCorpName").ToString().Trim()); tp.AddRow("vcDiscount", "c", npRet.FindTextByPath("//eg/Discount").ToString().Trim()); tp.AddRow("dtFlyDate", "c", npRet.FindTextByPath("//eg/FlyDate").ToString().Trim()); tp.AddRow("dtOrderTime", "t", "getdate()"); tp.AddRow("iTksState", "i", "0"); tp.AddRow("vcPnr", "c", strPnr); string strProviderAgentCode = npRet.FindTextByPath("//eg/ProviderAgentId").ToString().Trim(); string strSaleAgentCode = strCurAgentId; string strSaleAgentName = strAgentDepthName; string strProviderAgentName = npRet.FindTextByPath("//eg/ProviderAgentName").ToString().Trim(); double dbRetGain = Double.Parse(npRet.FindTextByPath("//eg/RetGain").ToString().Trim()); double dbPubGain = Double.Parse(npRet.FindTextByPath("//eg/PubGain").ToString().Trim()); double dbAirGain = Double.Parse(npRet.FindTextByPath("//eg/AirRetGain").ToString().Trim()); double dbRealTkPrc = Double.Parse(npRet.FindTextByPath("//eg/RealPrc").ToString().Trim()); //实收单价 double dbTkPrc = Double.Parse(npRet.FindTextByPath("//eg/EtkPrc").ToString().Trim()); //票面单价 double dbFule = Double.Parse(npRet.FindTextByPath("//eg/Fule").ToString().Trim()); double dbBaseFee = Double.Parse(npRet.FindTextByPath("//eg/BaseFee").ToString().Trim()); int iPerCount = Int32.Parse(npRet.FindTextByPath("//eg/PerCounts").ToString().Trim()); //Response.Write("strProviderAgentCode=" + strProviderAgentCode + "---" + "strSaleAgentCode=" + strSaleAgentCode); if (strProviderAgentCode.Substring(0, 8) == strSaleAgentCode.Substring(0, 8)) { //如果销售商定的是自己的票 double dbSalUserGain = dbTkPrc * dbRetGain / 100 * iPerCount; //得到用户利润 double dbAgentGain = dbTkPrc * (dbAirGain - dbRetGain) / 100 * iPerCount; //得到代理人的利润 //gs.util.func.Write("numSalAgentGainJe=" + dbAgentGain.ToString().Trim()); double dbAgentPrc = dbTkPrc * (100 - dbAirGain) / 100; //得到代理人每张票的单价 double dbAgentTotal = (dbAgentPrc + dbBaseFee + dbFule) * iPerCount; //得到总价 tp.AddRow("numSalUserGainJe", "d", dbSalUserGain.ToString().Trim()); tp.AddRow("numSalAgentGainJe", "d", dbAgentGain.ToString().Trim()); tp.AddRow("numAgentPrc", "d", dbAgentPrc.ToString().Trim()); tp.AddRow("numAgentTotal", "d", dbAgentTotal.ToString().Trim()); tp.AddRow("numIsLocalOrder", "i", "1"); } else { //如果定的是别的供应商的票 double dbSalUserGain = dbTkPrc * dbRetGain / 100 * iPerCount; //得到用户利润 double dbAgentGain = dbTkPrc * (dbPubGain - dbRetGain) / 100 * iPerCount; //得到代理人的利润 double dbAgentPrc = dbTkPrc * (100 - dbPubGain) / 100; //得到代理人每张票的单价 double dbAgentTotal = (dbAgentPrc + dbBaseFee + dbFule) * iPerCount; //得到总价 double dbProviderPrc = dbTkPrc * (100 - dbAirGain) / 100; //得到供应商单价 double dbProviderTotal = (dbProviderPrc + dbBaseFee + dbFule) * iPerCount; //得到供应商总价 double dbProviderGainJe = dbTkPrc * (dbAirGain - dbPubGain) * iPerCount / 100; //得到供应商利润 tp.AddRow("numSalUserGainJe", "d", dbSalUserGain.ToString().Trim()); tp.AddRow("numSalAgentGainJe", "d", dbAgentGain.ToString().Trim()); tp.AddRow("numAgentPrc", "d", dbAgentPrc.ToString().Trim()); tp.AddRow("numAgentTotal", "d", dbAgentTotal.ToString().Trim()); tp.AddRow("numProviderPrc", "d", dbProviderPrc.ToString().Trim()); tp.AddRow("numProviderTotal", "d", dbProviderTotal.ToString().Trim()); tp.AddRow("numProviderGainJe", "d", dbProviderGainJe.ToString().Trim()); tp.AddRow("numIsLocalOrder", "i", "0"); } if (tp.AddNewRec("eg_PolOrder")) { XmlNode nodeCusters = npRet.FindNodeByPath("//eg/Custer"); //gs.util.func.Write("Count=" + nodeCusters.ChildNodes.Count); string strPers = ""; for (int i = 0; i < nodeCusters.ChildNodes.Count; i++) { XmlNode nodeCuster = nodeCusters.ChildNodes[i]; string strPerName = nodeCuster.ChildNodes[0].ChildNodes[0].Value.ToString().Trim(); string strIdentCardType = nodeCuster.ChildNodes[1].ChildNodes[0].Value.ToString().Trim(); string strMobile = nodeCuster.ChildNodes[2].ChildNodes[0].Value.ToString().Trim(); string strIdentCardNo = nodeCuster.ChildNodes[3].ChildNodes[0].Value.ToString().Trim(); string chInsurance = nodeCuster.ChildNodes[4].ChildNodes[0].Value.ToString().Trim(); strPers += (strPerName + ";"); string strIns = "insert into eg_PolOrderView(numOrderId,vcPerName,vcIdentCardType,vcIdentCardNo,vcMobile,bInsurance) values(" + strOrderId + ",'" + strPerName + "','" + strIdentCardType + "','" + strIdentCardNo + "','" + strMobile + "'," + chInsurance + ")"; //Response.Write(strIns + "<br>"); cn.Update(strIns); } strErr = "succ$" + strPnr; } else { strErr = "预定失败,请检查数据"; } } catch (Exception ex) { strErr = "预定失败" + ex.Message; gs.util.func.Write("SubmitOrder is err =" + ex.Message); throw ex; } finally { } } else { strErr = "航信预定失败"; } } return(strErr); }
/// <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 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_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()); }
/// <summary> /// 生成一个新的C客户 /// </summary> /// <param name="p_strXml"></param> /// <returns></returns> public string NewCUser(string p_strXml) { string strRet = ""; NewPara npGet = new NewPara(p_strXml.Trim()); string strMerchId = npGet.FindTextByPath("//eg/MerchId").Trim(); string strUserCode = npGet.FindTextByPath("//eg/User").Trim(); string strUserTitle = npGet.FindTextByPath("//eg/UserTitle").Trim(); string strUserPassWord = npGet.FindTextByPath("//eg/UserPassWord").Trim(); string strSex = npGet.FindTextByPath("//eg/Sex").Trim(); string strBirthday = npGet.FindTextByPath("//eg/Birthday").Trim(); string strCrosAdr = npGet.FindTextByPath("//eg/CrosAdr").Trim(); string strPostCode = npGet.FindTextByPath("//eg/PostCode").Trim(); string strEmail = npGet.FindTextByPath("//eg/Email").Trim(); string strTel = npGet.FindTextByPath("//eg/Tel").Trim(); string strUserType = npGet.FindTextByPath("//eg/vcUserType").Trim(); //NewPara npRet = new NewPara(); //XmlDocument doc = npRet.getRoot(); //npRet.AddPara("Flag","OverUserLimted"); Conn cn = null; try { cn = new Conn(); cn.beginTrans(); //得到C客户设置信息 DataSet dsMerch = cn.GetDataSet("select * from eg_AgentCUser where numAgentId='" + strMerchId + "'"); string strCurAgentId = ""; string strUserClass = ""; string strNewUserId = ""; if (dsMerch.Tables[0].Rows.Count > 0) { strCurAgentId = dsMerch.Tables[0].Rows[0]["numCurAgentId"].ToString().Trim(); strUserClass = dsMerch.Tables[0].Rows[0]["vcUserClass"].ToString().Trim(); } //计算用户名是否合法 JoinAgent ag = new JoinAgent(); bool bCanAdd = ag.getAgentOverUsercountLimt(cn, strCurAgentId); //检测是否超过最大用户数量 bool bExistLoginName = isExistUser(cn, strUserCode); if (bExistLoginName) { //如果用户名存在 strRet = "ReUserName"; } else { if (bCanAdd) { gs.util.DES des = new gs.util.DES(); string strPwd = des.EncryptString(strUserPassWord, gs.util.StringTool.getPubKey(), gs.util.StringTool.getMixKey()); strNewUserId = logic.mytool.util.getId(cn, "eg_user"); Top3 tp = new Top3(cn); tp.AddRow("numUserId", "i", strNewUserId); tp.AddRow("vcLoginName", "c", strUserCode); tp.AddRow("vcPass", "c", strPwd); tp.AddRow("vcUserTitle", "c", strUserTitle); if (strSex != "") { tp.AddRow("vcSex", "c", "男"); } else { tp.AddRow("vcSex", "c", strSex); } tp.AddRow("numRoleId", "i", "0"); tp.AddRow("numAgentId", "c", strCurAgentId); tp.AddRow("vcTel", "c", strTel); if (strBirthday != "") { tp.AddRow("vcBirthday", "c", strBirthday); } else { tp.AddRow("vcBirthday", "c", "2000-1-1"); } tp.AddRow("vcCrosAdr", "c", strCrosAdr); tp.AddRow("vcPostCode", "c", strPostCode); tp.AddRow("vcEmail", "c", strEmail); tp.AddRow("dtRegTime", "dt", System.DateTime.Now.ToLongTimeString()); tp.AddRow("dtLastAcsTime", "dt", System.DateTime.Now.ToLongTimeString()); tp.AddRow("numUserStat", "i", "0"); if (strUserType != "") { tp.AddRow("vcUserType", "c", strUserType); } else { tp.AddRow("vcUserType", "c", "c"); } tp.AddRow("numVal", "d", "0"); tp.AddRow("numStat", "i", "0"); if (tp.AddNewRec("eg_user")) { string strClassSql = "insert into eg_userCm(numUserId,numCmId) values(" + strNewUserId + ",'" + strUserClass + "')"; cn.Update(strClassSql); string strRightSql = "insert into eg_userModu(numUserId,numModuId) select " + strNewUserId + ",numModuId from eg_AgentCUserModus where numAgentId='" + strMerchId + "'"; cn.Update(strRightSql); strRet = "AddSucc"; } else { strRet = "AddFail"; } } else { strRet = "OverUserLimted"; } } cn.commit(); } catch (Exception ex) { gs.util.func.Write("NewCUser is err" + ex.Message); cn.rollback(); } finally { cn.close(); } return(strRet); }