Exemplo n.º 1
0
        public bool SaveIns(string strUserID, string streNumber, string strIssueNumber,
                            string strNameIssued, string strCardType, string strCardNumber,
                            string strRemark, string strIssuePeriod, string strIssueBegin,
                            string strIssueEnd, string strSolutionDisputed, string strNameBeneficiary,
                            string strSignature, string strSignDate, string strInssuerName, string strPnr)
        {
            Conn cn   = null;
            bool bRet = false;

            try
            {
                cn = new Conn();

                Top2 tp = new Top2(cn);

                string strCurTime = System.DateTime.Now.ToString();
                tp.AddRow("UserID", "c", strUserID);
                tp.AddRow("eNumber", "c", streNumber);
                tp.AddRow("IssueNumber", "c", strIssueNumber);

                tp.AddRow("NameIssued", "c", strNameIssued);
                tp.AddRow("CardType", "c", strCardType);
                tp.AddRow("CardNumber", "c", strCardNumber);

                tp.AddRow("Remark", "c", strRemark);
                tp.AddRow("IssuePeriod", "c", strIssuePeriod);
                tp.AddRow("IssueBegin", "dt", strIssueBegin);

                tp.AddRow("IssueEnd", "dt", strIssueEnd);
                tp.AddRow("SolutionDisputed", "c", strSolutionDisputed);
                tp.AddRow("NameBeneficiary", "c", strNameBeneficiary);

                tp.AddRow("Signature", "c", strSignature);
                tp.AddRow("SignDate", "dt", strSignDate);
                tp.AddRow("InssuerName", "c", strInssuerName);
                tp.AddRow("Pnr", "c", strPnr);

                if (tp.AddNewRec("eg_insurance"))
                {
                    bRet = true;
                }
            }
            catch (Exception ex)
            {
                gs.util.func.Write("SaveIns is err" + ex.Message);
            }
            finally
            {
                cn.close();
            }
            return(bRet);
        }
Exemplo n.º 2
0
        public bool SaveGroup(string strUserID, string strName, string strCardID, string strGroupTicketID)
        {
            Conn cn   = null;
            bool bRet = false;

            try
            {
                cn = new Conn();

                Top2 tp = new Top2(cn);

                tp.AddRow("UserID", "c", strUserID);
                tp.AddRow("Name", "c", strName);
                tp.AddRow("CardID", "c", strCardID);
                tp.AddRow("GroupTicketID", "c", strGroupTicketID);


                string  strSql  = "select * from eg_ToGroup where id='" + strGroupTicketID + "'";
                DataSet dsGroup = cn.GetDataSet(strSql);

                if (dsGroup.Tables[0].Rows.Count != 0)
                {
                    int totalNum = int.Parse(dsGroup.Tables[0].Rows[0]["total"].ToString());
                    strSql = "select count(*) from eg_ToGroupContent where GroupTicketID = '" + strGroupTicketID + "'";
                    DataSet dsGroupConten = cn.GetDataSet(strSql);
                    int     existNum      = int.Parse(dsGroupConten.Tables[0].Rows[0][0].ToString());

                    if (totalNum > existNum)
                    {
                        if (tp.AddNewRec("eg_ToGroupContent"))
                        {
                            bRet = true;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                gs.util.func.Write("SaveGroup is err" + ex.Message);
            }
            finally
            {
                cn.close();
            }
            return(bRet);
        }
Exemplo n.º 3
0
        public bool SaveFC(string strFROM, string strTO, string strBUNKF, string strBUNKC, string strBUNKY)
        {
            Conn cn   = null;
            bool bRet = false;

            try
            {
                cn = new Conn();

                Top2 tp = new Top2(cn);

                DataSet ds = cn.GetDataSet("select * from eg_ticketInfo where bfrom='" + strFROM.Trim() + "' and ETO='" + strTO.Trim() + "'");

                tp.AddRow("BFROM", "c", strFROM);
                tp.AddRow("ETO", "c", strTO);
                tp.AddRow("BUNKF", "c", strBUNKF);
                tp.AddRow("BUNKC", "c", strBUNKC);
                tp.AddRow("BUNKY", "c", strBUNKY);

                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (tp.AddNewRec("eg_ticketInfo"))
                    {
                        bRet = true;
                    }
                }
                else
                {
                    if (tp.Update("eg_ticketInfo", " bfrom='" + strFROM.Trim() + "' and ETO='" + strTO.Trim() + "'"))
                    {
                        bRet = true;
                    }
                }
            }
            catch (Exception ex)
            {
                gs.util.func.Write("SaveFC is err" + ex.Message);
            }
            finally
            {
                cn.close();
            }
            return(bRet);
        }
Exemplo n.º 4
0
        public bool SaveETicket(string strUserID, string strPnr, string stretNumber, string
                                strFlightNumber1, string strBunk1, string strCityPair1, string
                                strDate1, string strFlightNumber2, string strBunk2, string
                                strCityPair2, string strDate2, string strTotalFC, string strDecFeeState, string strKey, string strIpId, string strBasePrc, string strOil, string strPassenger)
        {
            Conn cn   = null;
            bool bRet = false;

            try
            {
                cn = new Conn();

                Top2 tp = new Top2(cn);

                string strCurTime = System.DateTime.Now.ToString();

                if (strUserID != null)
                {
                    tp.AddRow("UserID", "c", strUserID);
                }
                if (strPnr != null)
                {
                    tp.AddRow("Pnr", "c", strPnr);
                }
                if (stretNumber != null)
                {
                    tp.AddRow("etNumber", "c", stretNumber);
                }
                if (strFlightNumber1 != null)
                {
                    tp.AddRow("FlightNumber1", "c", strFlightNumber1);
                }
                if (strBunk1 != null)
                {
                    tp.AddRow("Bunk1", "c", strBunk1);
                }
                if (strCityPair1 != null)
                {
                    tp.AddRow("CityPair1", "c", strCityPair1);
                }
                if (strDate1 != null)
                {
                    tp.AddRow("Date1", "c", strDate1);
                }
                if (strFlightNumber2 != null)
                {
                    tp.AddRow("FlightNumber2", "c", strFlightNumber2);
                }
                if (strBunk2 != null)
                {
                    tp.AddRow("Bunk2", "c", strBunk2);
                }
                if (strCityPair2 != null)
                {
                    tp.AddRow("CityPair2", "c", strCityPair2);
                }
                if (strDate2 != null)
                {
                    tp.AddRow("Date2", "c", strDate2);
                }

                //if (strDecFeeState != null)
                //	tp.AddRow("DecFeeState","c",strDecFeeState);

                if (strIpId != null && strIpId.Trim() != "")
                {
                    tp.AddRow("IpId", "c", strIpId);                  //现在已经变成了OFFICE号
                }
                //gs.util.func.Write("the strIpId=" + strIpId);

                if (strBasePrc != null && strBasePrc.Trim() != "")
                {
                    tp.AddRow("numBasePrc", "d", strBasePrc);
                }

                if (strOil != null && strOil.Trim() != "")
                {
                    tp.AddRow("numOilPrc", "d", strOil);
                }

                if (strPassenger != null && strPassenger.Trim() != "")
                {
                    tp.AddRow("Passenger", "c", strPassenger);
                }


                if (strKey == "RetPreSubmitETicket")
                {
                    string    ticketID = "";
                    Insurance ins      = new Insurance();



                    string  strReIns = "select * from eg_eticket where rtrim(ltrim(Pnr))='" + strPnr.Trim() + "' and datediff(day,OperateTime,getdate())<=5";
                    DataSet dsReIns  = cn.GetDataSet(strReIns);
                    if (dsReIns.Tables[0].Rows.Count == 0)
                    {
                        tp.AddRow("DecFeeState", "c", "0");

                        if (strTotalFC != null && strTotalFC.Trim() != "")
                        {
                            tp.AddRow("TotalFC", "c", strTotalFC);
                        }


                        if (tp.AddNewRec("eg_eticket"))
                        {
                            bRet = true;
                        }
                    }
                    else
                    {
                        ticketID = dsReIns.Tables[0].Rows[0]["TicketID"].ToString().Trim();
                        string strNowFC = "";
                        if (dsReIns.Tables[0].Rows[0]["TotalFC"] != null)
                        {
                            strNowFC = dsReIns.Tables[0].Rows[0]["TotalFC"].ToString().Trim();
                        }
                        double dbYe = 0;
                        if (strNowFC != null && strNowFC.Trim() != "")
                        {
                            dbYe = Double.Parse(strNowFC);
                        }

                        if (strNowFC.Trim() == "" || dbYe == 0)
                        {
                            if (strTotalFC != null && strTotalFC.Trim() != "")
                            {
                                tp.AddRow("TotalFC", "c", strTotalFC);
                            }
                            else
                            {
                                tp.AddRow("TotalFC", "c", "0");
                            }
                        }


                        if (tp.Update("eg_eticket", "TicketID", ticketID))
                        {
                            bRet = true;
                        }

                        gs.util.func.Write("SaveETicket is err 该电脑号" + strPnr + "已经存在,不允许重复新增");
                    }

                    /*ticketID = ins.GetEticketByUPD(strUserID,strPnr,strDecFeeState);
                     * if (ticketID == "")
                     * {
                     *      if(tp.AddNewRec("eg_eticket"))
                     *      {
                     *              bRet = true;
                     *      }
                     * }
                     * else
                     * {
                     *      if(tp.Update("eg_eticket","TicketID",ticketID))
                     *      {
                     *              bRet = true;
                     *      }
                     * }*/
                }
                else if (strKey == "RetSubmitETicket")
                {
                    string  strReIns = "select * from eg_eticket where rtrim(ltrim(Pnr))='" + strPnr.Trim() + "' and datediff(day,OperateTime,getdate())<=5";
                    DataSet dsReIns  = cn.GetDataSet(strReIns);
                    if (dsReIns.Tables[0].Rows.Count > 0)
                    {
                        string strNowFC = "";
                        if (dsReIns.Tables[0].Rows[0]["TotalFC"] != null)
                        {
                            strNowFC = dsReIns.Tables[0].Rows[0]["TotalFC"].ToString().Trim();
                        }

                        double dbYe = 0;
                        if (strNowFC.Trim() != "")
                        {
                            dbYe = Double.Parse(strNowFC);
                        }

                        if (strNowFC.Trim() == "" || dbYe == 0)
                        {
                            tp.AddRow("TotalFC", "c", strTotalFC);
                        }
                    }

                    if (tp.Update("eg_eticket", " rtrim(ltrim(Pnr))='" + strPnr + "' and datediff(day,OperateTime,getdate())<=5"))
                    {
                        bRet = true;
                    }
                    else
                    {
                        gs.util.func.Write("SaveETicket is err 已经超过过票时限");
                    }
                }
            }
            catch (Exception ex)
            {
                bRet = false;
                gs.util.func.Write("SaveETicket is err" + ex.Message);
                throw ex;
            }
            finally
            {
                cn.close();
            }
            return(bRet);
        }
Exemplo n.º 5
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);
        }
Exemplo n.º 6
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);
        }
Exemplo n.º 7
0
        /// <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());
        }
Exemplo n.º 8
0
        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());
        }