Esempio n. 1
0
        /// <summary>
        /// 客户端生成了一张票据信息,对于傻瓜版
        /// </summary>
        /// <param name="p_strXML"></param> 具体说明见代码末尾
        /// <returns></returns>
        public string NewTickte(string p_strXML)
        {
            Conn   cn          = null;
            string strRet      = "";
            string strCustInfo = "";
            string strOper     = "";

            try
            {
                string  strPnrId    = logic.mytool.util.getId("eg_pnr");
                NewPara npRet       = new NewPara(p_strXML.Trim());
                string  strUserCode = npRet.FindTextByPath("//eg/User").Trim();

                cn = new Conn();
                cn.beginTrans();
                Top2 tp = new Top2(cn);

                string strBz = npRet.FindTextByPath("//eg/Bz").Trim();
                strBz = gs.util.StringTool.getSqlFilterStr(strBz);

                tp.AddRow("numPnrId", "c", strPnrId);
                tp.AddRow("vcPnrNo", "c", npRet.FindTextByPath("//eg/PNR").Trim());
                tp.AddRow("vcLoginName", "c", gs.util.StringTool.getSqlFilterStr(npRet.FindTextByPath("//eg/User").Trim()));
                strOper = gs.util.StringTool.getSqlFilterStr(npRet.FindTextByPath("//eg/User").Trim());
                tp.AddRow("vcPhone", "c", gs.util.StringTool.getSqlFilterStr(npRet.FindTextByPath("//eg/Phone").Trim()));
                tp.AddRow("numPersonCount", "i", npRet.FindTextByPath("//eg/PersonCount").Trim());
                strCustInfo = gs.util.StringTool.getSqlFilterStr(npRet.FindTextByPath("//eg/Names").Trim());
                tp.AddRow("vcNames", "c", strCustInfo);
                tp.AddRow("vcTL", "c", npRet.FindTextByPath("//eg/TL").Trim());

                tp.AddRow("numTkPrc", "d", npRet.FindTextByPath("//eg/numTkPrc").Trim());             //票面价
                tp.AddRow("numRealPrc", "d", npRet.FindTextByPath("//eg/numRealPrc").Trim());         //实收价
                tp.AddRow("numBasePrc", "d", npRet.FindTextByPath("//eg/numBasePrc").Trim());         //基建
                tp.AddRow("numOilPrc", "d", npRet.FindTextByPath("//eg/numOilPrc").Trim());           //燃油
                tp.AddRow("numPoint", "d", npRet.FindTextByPath("//eg/numPoint").Trim());             //返点
                tp.AddRow("numGain", "d", npRet.FindTextByPath("//eg/numGain").Trim());               //利润
                tp.AddRow("numTotal", "d", npRet.FindTextByPath("//eg/numTotal").Trim());             //合计

                tp.AddRow("numStat", "i", "0");
                //tp.AddRow("dtApply","dt",System.DateTime.Now.ToLongTimeString());
                tp.AddRow("dtApply", "t", "getdate()");
                tp.AddRow("vcBz", "c", strBz);


                if (tp.AddNewRec("eg_pnr"))
                {
                    XmlNode nds = npRet.FindNodeByPath("//eg/ATK");
                    for (int i = 0; i < nds.ChildNodes.Count; i++)
                    {
                        XmlNode nodeFlight  = nds.ChildNodes[i].ChildNodes[0];
                        string  strFlightNo = nodeFlight.ChildNodes[0].Value;

                        XmlNode nodeBunk = nds.ChildNodes[i].ChildNodes[1];
                        string  strBunk  = nodeBunk.ChildNodes[0].Value;

                        XmlNode nodeDate = nds.ChildNodes[i].ChildNodes[2];
                        string  strDate  = nodeDate.ChildNodes[0].Value;

                        XmlNode nodeCityPairt = nds.ChildNodes[i].ChildNodes[3];
                        string  strCityPair   = nodeCityPairt.ChildNodes[0].Value;

                        string strIns = "insert into eg_pnrtks(numPnrId,vcFlightNo,vcBunk,vcDate,vcCityPair) values(" + strPnrId +
                                        ",'" + strFlightNo + "','" + strBunk + "','" + strDate + "','" + strCityPair + "')";
                        cn.Update(strIns);
                    }
                    strRet = getOnlineManager(cn, strUserCode, npRet.FindTextByPath("//eg/PNR").Trim());
                }
                cn.commit();
            }
            catch (Exception ex)
            {
                cn.rollback();
                gs.util.func.Write("NewTickte is err" + ex.Message);
            }
            finally
            {
                cn.close();
            }

            /*try
             * {
             *      cn = new Conn();
             *      saveCustInfo(cn,strOper,strCustInfo);//保存客户资料
             * }
             * catch(Exception ex)
             * {
             *      gs.util.func.Write("NewTickte saveCustInfo is err" + ex.Message);
             * }
             * finally
             * {
             *      cn.close();
             * }*/

            return(strRet);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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);
        }