Пример #1
0
        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());
        }
Пример #2
0
        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());
        }
Пример #3
0
        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());
        }
Пример #4
0
        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());
        }
Пример #5
0
        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());
        }
Пример #6
0
        /// <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);
        }
Пример #7
0
        /// <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());
        }