예제 #1
0
        public string setUpData(string id, string type, string info, string typeInfo)
        {
            if (Session[Util.ProjectConfig.ADMINUSER] == null)
            {
                return("");
            }

            string[] idlist = id.Split(';');

            string[] typeInfolist = typeInfo.Split(';');
            for (int i = 0; i < idlist.Length; i++)
            {
                Orderdetaillive live = OrderdetailliveManager.GetOrderdetailliveByPK(int.Parse(idlist[i]));
                if (typeInfolist[i] == "走地全场让球")
                {
                    Orderdetailhdpl hdpl = new Orderdetailhdpl();
                    hdpl.Agent             = live.Agent;
                    hdpl.AgentCommission   = live.AgentCommission;
                    hdpl.AgentPercent      = live.AgentPercent;
                    hdpl.Amount            = live.Amount;
                    hdpl.Awaycn            = live.Awaycn;
                    hdpl.Awayen            = live.Awayen;
                    hdpl.Awayth            = live.Awayth;
                    hdpl.Awaytw            = live.Awaytw;
                    hdpl.Awayvn            = live.Awayvn;
                    hdpl.BeginTime         = live.BeginTime;
                    hdpl.BetItem           = live.BetItem;
                    hdpl.BetType           = live.BetType;
                    hdpl.Coefficient       = live.Coefficient;
                    hdpl.CompanyCommission = live.CompanyCommission;
                    hdpl.CompanyPercent    = live.CompanyPercent;
                    hdpl.Currency          = live.Currency;
                    hdpl.Gameid            = live.Gameid;
                    hdpl.Handicap          = live.Handicap;
                    hdpl.Homecn            = live.Homecn;
                    hdpl.Homeen            = live.Homeen;
                    hdpl.Hometh            = live.Hometh;
                    hdpl.Hometw            = live.Hometw;
                    hdpl.Homevn            = live.Homevn;
                    hdpl.IP                   = live.IP;
                    hdpl.IsHalf               = live.IsHalf;
                    hdpl.Leaguecn             = live.Leaguecn;
                    hdpl.Leagueen             = live.Leagueen;
                    hdpl.Leagueth             = live.Leagueth;
                    hdpl.Leaguetw             = live.Leaguetw;
                    hdpl.Leaguevn             = live.Leaguevn;
                    hdpl.Odds                 = live.Odds;
                    hdpl.OddsType             = live.OddsType;
                    hdpl.OrderID              = live.OrderID;
                    hdpl.Partner              = live.Partner;
                    hdpl.PartnerCommission    = live.PartnerCommission;
                    hdpl.PartnerPercent       = live.PartnerPercent;
                    hdpl.Proportion           = live.Proportion;
                    hdpl.Reason               = info;
                    hdpl.Score                = live.Score;
                    hdpl.Status               = type;
                    hdpl.SubCompany           = live.SubCompany;
                    hdpl.SubCompanyCommission = live.SubCompanyCommission;
                    hdpl.SubCompanyPercent    = live.SubCompanyPercent;
                    hdpl.Time                 = live.Time;
                    hdpl.UserLevel            = live.UserLevel;
                    hdpl.UserName             = live.UserName;
                    hdpl.ValidAmount          = live.ValidAmount;
                    hdpl.WebSiteiID           = live.WebSiteiID;
                    hdpl.ZAgent               = live.ZAgent;
                    hdpl.ZAgentCommission     = live.ZAgentCommission;
                    hdpl.ZAgentPercent        = live.ZAgentPercent;
                    hdpl.Betflag              = live.Betflag;
                    OrderdetailhdplManager.AddOrderdetailhdpl(hdpl);
                }
                else if (typeInfolist[i] == "走地全场大小")
                {
                    Orderdetailoul loul = new Orderdetailoul();
                    loul.Agent             = live.Agent;
                    loul.AgentCommission   = live.AgentCommission;
                    loul.AgentPercent      = live.AgentPercent;
                    loul.Amount            = live.Amount;
                    loul.Awaycn            = live.Awaycn;
                    loul.Awayen            = live.Awayen;
                    loul.Awayth            = live.Awayth;
                    loul.Awaytw            = live.Awaytw;
                    loul.Awayvn            = live.Awayvn;
                    loul.BeginTime         = live.BeginTime;
                    loul.BetItem           = live.BetItem;
                    loul.BetType           = live.BetType;
                    loul.Coefficient       = live.Coefficient;
                    loul.CompanyCommission = live.CompanyCommission;
                    loul.CompanyPercent    = live.CompanyPercent;
                    loul.Currency          = live.Currency;
                    loul.Gameid            = live.Gameid;
                    loul.Handicap          = live.Handicap;
                    loul.Homecn            = live.Homecn;
                    loul.Homeen            = live.Homeen;
                    loul.Hometh            = live.Hometh;
                    loul.Hometw            = live.Hometw;
                    loul.Homevn            = live.Homevn;
                    loul.IP                   = live.IP;
                    loul.IsHalf               = live.IsHalf;
                    loul.Leaguecn             = live.Leaguecn;
                    loul.Leagueen             = live.Leagueen;
                    loul.Leagueth             = live.Leagueth;
                    loul.Leaguetw             = live.Leaguetw;
                    loul.Leaguevn             = live.Leaguevn;
                    loul.Odds                 = live.Odds;
                    loul.OddsType             = live.OddsType;
                    loul.OrderID              = live.OrderID;
                    loul.Partner              = live.Partner;
                    loul.PartnerCommission    = live.PartnerCommission;
                    loul.PartnerPercent       = live.PartnerPercent;
                    loul.Proportion           = live.Proportion;
                    loul.Reason               = info;
                    loul.Score                = live.Score;
                    loul.Status               = type;
                    loul.SubCompany           = live.SubCompany;
                    loul.SubCompanyCommission = live.SubCompanyCommission;
                    loul.SubCompanyPercent    = live.SubCompanyPercent;
                    loul.Time                 = live.Time;
                    loul.UserLevel            = live.UserLevel;
                    loul.UserName             = live.UserName;
                    loul.ValidAmount          = live.ValidAmount;
                    loul.WebSiteiID           = live.WebSiteiID;
                    loul.ZAgent               = live.ZAgent;
                    loul.ZAgentCommission     = live.ZAgentCommission;
                    loul.ZAgentPercent        = live.ZAgentPercent;
                    loul.Betflag              = live.Betflag;
                    OrderdetailoulManager.AddOrderdetailoul(loul);
                }
                else if (typeInfolist[i] == "走地全场标准")
                {
                    Orderdetail1x2l lx2l = new Orderdetail1x2l();
                    lx2l.Agent             = live.Agent;
                    lx2l.AgentCommission   = live.AgentCommission;
                    lx2l.AgentPercent      = live.AgentPercent;
                    lx2l.Amount            = live.Amount;
                    lx2l.Awaycn            = live.Awaycn;
                    lx2l.Awayen            = live.Awayen;
                    lx2l.Awayth            = live.Awayth;
                    lx2l.Awaytw            = live.Awaytw;
                    lx2l.Awayvn            = live.Awayvn;
                    lx2l.BeginTime         = live.BeginTime;
                    lx2l.BetItem           = live.BetItem;
                    lx2l.BetType           = live.BetType;
                    lx2l.Coefficient       = live.Coefficient;
                    lx2l.CompanyCommission = live.CompanyCommission;
                    lx2l.CompanyPercent    = live.CompanyPercent;
                    lx2l.Currency          = live.Currency;
                    lx2l.Gameid            = live.Gameid;
                    lx2l.Handicap          = live.Handicap;
                    lx2l.Homecn            = live.Homecn;
                    lx2l.Homeen            = live.Homeen;
                    lx2l.Hometh            = live.Hometh;
                    lx2l.Hometw            = live.Hometw;
                    lx2l.Homevn            = live.Homevn;
                    lx2l.IP                   = live.IP;
                    lx2l.IsHalf               = live.IsHalf;
                    lx2l.Leaguecn             = live.Leaguecn;
                    lx2l.Leagueen             = live.Leagueen;
                    lx2l.Leagueth             = live.Leagueth;
                    lx2l.Leaguetw             = live.Leaguetw;
                    lx2l.Leaguevn             = live.Leaguevn;
                    lx2l.Odds                 = live.Odds;
                    lx2l.OddsType             = live.OddsType;
                    lx2l.OrderID              = live.OrderID;
                    lx2l.Partner              = live.Partner;
                    lx2l.PartnerCommission    = live.PartnerCommission;
                    lx2l.PartnerPercent       = live.PartnerPercent;
                    lx2l.Proportion           = live.Proportion;
                    lx2l.Reason               = info;
                    lx2l.Score                = live.Score;
                    lx2l.Status               = type;
                    lx2l.SubCompany           = live.SubCompany;
                    lx2l.SubCompanyCommission = live.SubCompanyCommission;
                    lx2l.SubCompanyPercent    = live.SubCompanyPercent;
                    lx2l.Time                 = live.Time;
                    lx2l.UserLevel            = live.UserLevel;
                    lx2l.UserName             = live.UserName;
                    lx2l.ValidAmount          = live.ValidAmount;
                    lx2l.WebSiteiID           = live.WebSiteiID;
                    lx2l.ZAgent               = live.ZAgent;
                    lx2l.ZAgentCommission     = live.ZAgentCommission;
                    lx2l.ZAgentPercent        = live.ZAgentPercent;
                    lx2l.Betflag              = live.Betflag;
                    Orderdetail1x2lManager.AddOrderdetail1x2l(lx2l);
                }
                else if (typeInfolist[i] == "走地半场让球")
                {
                    Orderdetailhdphfl hdphfl = new Orderdetailhdphfl();
                    hdphfl.Agent             = live.Agent;
                    hdphfl.AgentCommission   = live.AgentCommission;
                    hdphfl.AgentPercent      = live.AgentPercent;
                    hdphfl.Amount            = live.Amount;
                    hdphfl.Awaycn            = live.Awaycn;
                    hdphfl.Awayen            = live.Awayen;
                    hdphfl.Awayth            = live.Awayth;
                    hdphfl.Awaytw            = live.Awaytw;
                    hdphfl.Awayvn            = live.Awayvn;
                    hdphfl.BeginTime         = live.BeginTime;
                    hdphfl.BetItem           = live.BetItem;
                    hdphfl.BetType           = live.BetType;
                    hdphfl.Coefficient       = live.Coefficient;
                    hdphfl.CompanyCommission = live.CompanyCommission;
                    hdphfl.CompanyPercent    = live.CompanyPercent;
                    hdphfl.Currency          = live.Currency;
                    hdphfl.Gameid            = live.Gameid;
                    hdphfl.Handicap          = live.Handicap;
                    hdphfl.Homecn            = live.Homecn;
                    hdphfl.Homeen            = live.Homeen;
                    hdphfl.Hometh            = live.Hometh;
                    hdphfl.Hometw            = live.Hometw;
                    hdphfl.Homevn            = live.Homevn;
                    hdphfl.IP                   = live.IP;
                    hdphfl.IsHalf               = live.IsHalf;
                    hdphfl.Leaguecn             = live.Leaguecn;
                    hdphfl.Leagueen             = live.Leagueen;
                    hdphfl.Leagueth             = live.Leagueth;
                    hdphfl.Leaguetw             = live.Leaguetw;
                    hdphfl.Leaguevn             = live.Leaguevn;
                    hdphfl.Odds                 = live.Odds;
                    hdphfl.OddsType             = live.OddsType;
                    hdphfl.OrderID              = live.OrderID;
                    hdphfl.Partner              = live.Partner;
                    hdphfl.PartnerCommission    = live.PartnerCommission;
                    hdphfl.PartnerPercent       = live.PartnerPercent;
                    hdphfl.Proportion           = live.Proportion;
                    hdphfl.Reason               = info;
                    hdphfl.Score                = live.Score;
                    hdphfl.Status               = type;
                    hdphfl.SubCompany           = live.SubCompany;
                    hdphfl.SubCompanyCommission = live.SubCompanyCommission;
                    hdphfl.SubCompanyPercent    = live.SubCompanyPercent;
                    hdphfl.Time                 = live.Time;
                    hdphfl.UserLevel            = live.UserLevel;
                    hdphfl.UserName             = live.UserName;
                    hdphfl.ValidAmount          = live.ValidAmount;
                    hdphfl.WebSiteiID           = live.WebSiteiID;
                    hdphfl.ZAgent               = live.ZAgent;
                    hdphfl.ZAgentCommission     = live.ZAgentCommission;
                    hdphfl.ZAgentPercent        = live.ZAgentPercent;
                    hdphfl.Betflag              = live.Betflag;
                    OrderdetailhdphflManager.AddOrderdetailhdphfl(hdphfl);
                }
                else if (typeInfolist[i] == "走地半场大小")
                {
                    Orderdetailouhfl louhfl = new Orderdetailouhfl();
                    louhfl.Agent             = live.Agent;
                    louhfl.AgentCommission   = live.AgentCommission;
                    louhfl.AgentPercent      = live.AgentPercent;
                    louhfl.Amount            = live.Amount;
                    louhfl.Awaycn            = live.Awaycn;
                    louhfl.Awayen            = live.Awayen;
                    louhfl.Awayth            = live.Awayth;
                    louhfl.Awaytw            = live.Awaytw;
                    louhfl.Awayvn            = live.Awayvn;
                    louhfl.BeginTime         = live.BeginTime;
                    louhfl.BetItem           = live.BetItem;
                    louhfl.BetType           = live.BetType;
                    louhfl.Coefficient       = live.Coefficient;
                    louhfl.CompanyCommission = live.CompanyCommission;
                    louhfl.CompanyPercent    = live.CompanyPercent;
                    louhfl.Currency          = live.Currency;
                    louhfl.Gameid            = live.Gameid;
                    louhfl.Handicap          = live.Handicap;
                    louhfl.Homecn            = live.Homecn;
                    louhfl.Homeen            = live.Homeen;
                    louhfl.Hometh            = live.Hometh;
                    louhfl.Hometw            = live.Hometw;
                    louhfl.Homevn            = live.Homevn;
                    louhfl.IP                   = live.IP;
                    louhfl.IsHalf               = live.IsHalf;
                    louhfl.Leaguecn             = live.Leaguecn;
                    louhfl.Leagueen             = live.Leagueen;
                    louhfl.Leagueth             = live.Leagueth;
                    louhfl.Leaguetw             = live.Leaguetw;
                    louhfl.Leaguevn             = live.Leaguevn;
                    louhfl.Odds                 = live.Odds;
                    louhfl.OddsType             = live.OddsType;
                    louhfl.OrderID              = live.OrderID;
                    louhfl.Partner              = live.Partner;
                    louhfl.PartnerCommission    = live.PartnerCommission;
                    louhfl.PartnerPercent       = live.PartnerPercent;
                    louhfl.Proportion           = live.Proportion;
                    louhfl.Reason               = info;
                    louhfl.Score                = live.Score;
                    louhfl.Status               = type;
                    louhfl.SubCompany           = live.SubCompany;
                    louhfl.SubCompanyCommission = live.SubCompanyCommission;
                    louhfl.SubCompanyPercent    = live.SubCompanyPercent;
                    louhfl.Time                 = live.Time;
                    louhfl.UserLevel            = live.UserLevel;
                    louhfl.UserName             = live.UserName;
                    louhfl.ValidAmount          = live.ValidAmount;
                    louhfl.WebSiteiID           = live.WebSiteiID;
                    louhfl.ZAgent               = live.ZAgent;
                    louhfl.ZAgentCommission     = live.ZAgentCommission;
                    louhfl.ZAgentPercent        = live.ZAgentPercent;
                    louhfl.Betflag              = live.Betflag;
                    OrderdetailouhflManager.AddOrderdetailouhfl(louhfl);
                }
                else if (typeInfolist[i] == "走地半场标准")
                {
                    Orderdetail1x2hfl lx2hfl = new Orderdetail1x2hfl();
                    lx2hfl.Agent             = live.Agent;
                    lx2hfl.AgentCommission   = live.AgentCommission;
                    lx2hfl.AgentPercent      = live.AgentPercent;
                    lx2hfl.Amount            = live.Amount;
                    lx2hfl.Awaycn            = live.Awaycn;
                    lx2hfl.Awayen            = live.Awayen;
                    lx2hfl.Awayth            = live.Awayth;
                    lx2hfl.Awaytw            = live.Awaytw;
                    lx2hfl.Awayvn            = live.Awayvn;
                    lx2hfl.BeginTime         = live.BeginTime;
                    lx2hfl.BetItem           = live.BetItem;
                    lx2hfl.BetType           = live.BetType;
                    lx2hfl.Coefficient       = live.Coefficient;
                    lx2hfl.CompanyCommission = live.CompanyCommission;
                    lx2hfl.CompanyPercent    = live.CompanyPercent;
                    lx2hfl.Currency          = live.Currency;
                    lx2hfl.Gameid            = live.Gameid;
                    lx2hfl.Handicap          = live.Handicap;
                    lx2hfl.Homecn            = live.Homecn;
                    lx2hfl.Homeen            = live.Homeen;
                    lx2hfl.Hometh            = live.Hometh;
                    lx2hfl.Hometw            = live.Hometw;
                    lx2hfl.Homevn            = live.Homevn;
                    lx2hfl.IP                   = live.IP;
                    lx2hfl.IsHalf               = live.IsHalf;
                    lx2hfl.Leaguecn             = live.Leaguecn;
                    lx2hfl.Leagueen             = live.Leagueen;
                    lx2hfl.Leagueth             = live.Leagueth;
                    lx2hfl.Leaguetw             = live.Leaguetw;
                    lx2hfl.Leaguevn             = live.Leaguevn;
                    lx2hfl.Odds                 = live.Odds;
                    lx2hfl.OddsType             = live.OddsType;
                    lx2hfl.OrderID              = live.OrderID;
                    lx2hfl.Partner              = live.Partner;
                    lx2hfl.PartnerCommission    = live.PartnerCommission;
                    lx2hfl.PartnerPercent       = live.PartnerPercent;
                    lx2hfl.Proportion           = live.Proportion;
                    lx2hfl.Reason               = info;
                    lx2hfl.Score                = live.Score;
                    lx2hfl.Status               = type;
                    lx2hfl.SubCompany           = live.SubCompany;
                    lx2hfl.SubCompanyCommission = live.SubCompanyCommission;
                    lx2hfl.SubCompanyPercent    = live.SubCompanyPercent;
                    lx2hfl.Time                 = live.Time;
                    lx2hfl.UserLevel            = live.UserLevel;
                    lx2hfl.UserName             = live.UserName;
                    lx2hfl.ValidAmount          = live.ValidAmount;
                    lx2hfl.WebSiteiID           = live.WebSiteiID;
                    lx2hfl.ZAgent               = live.ZAgent;
                    lx2hfl.ZAgentCommission     = live.ZAgentCommission;
                    lx2hfl.ZAgentPercent        = live.ZAgentPercent;
                    lx2hfl.Betflag              = live.Betflag;
                    Orderdetail1x2hflManager.AddOrderdetail1x2hfl(lx2hfl);
                }
                if (type == "0")
                {
                    Orderdetail1x2hflManager.setBalance(live.UserName, live.Odds < 0 ? live.ValidAmount.ToString() : live.Amount.ToString());
                }
                OrderdetailliveManager.DeleteOrderdetailliveByPK(int.Parse(idlist[i]));
            }
            return("none");
        }
예제 #2
0
        public string jsff(string g, string hl, string ss)
        {
            if (Session[Util.ProjectConfig.ADMINUSER] == null)
            {
                return("");
            }

            string[] gi  = g.Split(',');
            string[] hls = hl.Split(',');
            string[] s1  = ss.Split(',');
            for (int i = 0; i < gi.Length; i++)
            {
                List <Orderdetail1x2> order = Orderdetail1x2Manager.getorderAll(int.Parse(gi[i]));//获得该场比赛的所有注单
                for (int j = 0; j < order.Count; j++)
                {
                    Orderhistory h = new Orderhistory();
                    order[j].Score = s1[i];
                    switch (int.Parse(order[j].BetType))
                    {
                    /*-----半场让球--------*/
                    case 2:
                    case 6:
                    case 10:
                        if (order[j].BetType == "6")
                        {
                            OrderdetailhdphflManager.DeleteOrderdetailhdphflByPK(order[j].ID);
                        }
                        else
                        {
                            OrderdetailhdphfManager.DeleteOrderdetailhdphfByPK(order[j].ID);
                        }
                        if (order[j].Status == "0")
                        {
                            break;
                        }
                        int    a = 0;
                        double b = 0;
                        if (order[j].Handicap.IndexOf("-") != -1)
                        {
                            /*-------选择主队时a与b的值---------*/
                            if (order[j].Betflag == "H")
                            {
                                a = int.Parse(hls[i].Substring(0, hls[i].IndexOf(':'))) - int.Parse(hls[i].Substring(hls[i].IndexOf(':') + 1));
                                b = a - double.Parse(order[j].Handicap.ToString().Substring(1));
                            }
                            /*-------选择客队时a与b的值--------*/
                            else if (order[j].Betflag == "A")
                            {
                                a = int.Parse(hls[i].Substring(hls[i].IndexOf(':') + 1)) - int.Parse(hls[i].Substring(0, hls[i].IndexOf(':')));
                                b = a - double.Parse(order[j].Handicap.ToString().Substring(1));
                            }
                            /*-------让球数有两个时即(一球/球半)这种情况--------*/
                            double za = double.Parse(order[j].Handicap.Substring(1)) / 0.5;
                            if (int.Parse(za.ToString().Substring(0, (za.ToString().IndexOf('.') == -1 ? za.ToString().Length : za.ToString().IndexOf('.')))) < za)
                            {
                                if (a < 0)
                                {
                                    h.Result = Convert.ToDecimal("-" + (order[j].Odds > 0 ? order[j].Amount : order[j].ValidAmount));
                                }
                                else if (b > 0)
                                {
                                    if (b == 0.25)
                                    {
                                        h.Result = Convert.ToDecimal((order[j].Odds > 0 ? order[j].Amount / 2 : order[j].ValidAmount / 2));
                                    }
                                    else if (b > 0.25)
                                    {
                                        h.Result = Convert.ToDecimal((order[j].Odds > 0 ? order[j].Amount : order[j].ValidAmount));
                                    }
                                }
                                else
                                {
                                    if (b * (-1) == 0.25)
                                    {
                                        h.Result = Convert.ToDecimal("-" + (order[j].Odds > 0 ? order[j].Amount / 2 : order[j].ValidAmount / 2));
                                    }
                                    else if (b * (-1) > 0.25)
                                    {
                                        h.Result = Convert.ToDecimal("-" + (order[j].Odds > 0 ? order[j].Amount : order[j].ValidAmount));
                                    }
                                }
                            }
                            /*------让球只有一个的情况即(球半,一球)这种情况----------*/
                            else
                            {
                                if (b == 0)
                                {
                                    h.Result = 0;
                                }
                                else if (b < 0)
                                {
                                    h.Result = Convert.ToDecimal("-" + (order[j].Odds > 0 ? order[j].Amount : order[j].ValidAmount));
                                }
                                else if (b > 0)
                                {
                                    h.Result = Convert.ToDecimal((order[j].Odds > 0 ? order[j].Amount : order[j].ValidAmount));
                                }
                            }
                        }
                        else
                        {
                            /*-------选择主队时a与b的值---------*/
                            if (order[j].Betflag == "H")
                            {
                                a = int.Parse(hls[i].Substring(0, hls[i].IndexOf(':'))) - int.Parse(hls[i].Substring(hls[i].IndexOf(':') + 1));
                                b = a + double.Parse(order[j].Handicap.ToString().Substring(1));
                            }
                            /*-------选择客队时a与b的值--------*/
                            else if (order[j].Betflag == "A")
                            {
                                a = int.Parse(hls[i].Substring(hls[i].IndexOf(':') + 1)) - int.Parse(hls[i].Substring(0, hls[i].IndexOf(':')));
                                b = a + double.Parse(order[j].Handicap.ToString().Substring(1));
                            }
                            /*-------让球数有两个时即(一球/球半)这种情况--------*/
                            double za = double.Parse(order[j].Handicap) / 0.5;
                            if (int.Parse(za.ToString().Substring(0, (za.ToString().IndexOf('.') == -1 ? za.ToString().Length : za.ToString().IndexOf('.')))) < za)
                            {
                                if (a < 0)
                                {
                                    h.Result = Convert.ToDecimal("-" + (order[j].Odds > 0 ? order[j].Amount : order[j].ValidAmount));
                                }
                                else if (b > 0)
                                {
                                    if (b == 0.25)
                                    {
                                        h.Result = Convert.ToDecimal((order[j].Odds > 0 ? order[j].Amount / 2 : order[j].ValidAmount / 2));
                                    }
                                    else if (b > 0.25)
                                    {
                                        h.Result = Convert.ToDecimal((order[j].Odds > 0 ? order[j].Amount : order[j].ValidAmount));
                                    }
                                }
                                else
                                {
                                    if (b * (-1) == 0.25)
                                    {
                                        h.Result = Convert.ToDecimal("-" + (order[j].Odds > 0 ? order[j].Amount / 2 : order[j].ValidAmount / 2));
                                    }
                                    else if (b * (-1) > 0.25)
                                    {
                                        h.Result = Convert.ToDecimal("-" + (order[j].Odds > 0 ? order[j].Amount : order[j].ValidAmount));
                                    }
                                }
                            }
                            /*------让球只有一个的情况即(球半,一球)这种情况----------*/
                            else
                            {
                                if (b == 0)
                                {
                                    h.Result = 0;
                                }
                                else if (b < 0)
                                {
                                    h.Result = Convert.ToDecimal("-" + (order[j].Odds > 0 ? order[j].Amount : order[j].ValidAmount));
                                }
                                else if (b > 0)
                                {
                                    h.Result = Convert.ToDecimal((order[j].Odds > 0 ? order[j].Amount : order[j].ValidAmount));
                                }
                            }
                        }
                        break;

                    /*---半场让球结束----------*/
                    /*---全场让球----------*/
                    case 0:
                    case 4:
                    case 8:
                        if (order[j].BetType == "4")
                        {
                            OrderdetailhdplManager.DeleteOrderdetailhdplByPK(order[j].ID);
                        }
                        else
                        {
                            OrderdetailhdpManager.DeleteOrderdetailhdpByPK(order[j].ID);
                        }
                        if (order[j].Status == "0")
                        {
                            break;
                        }
                        a = 0;
                        b = 0.0;
                        if (order[j].Handicap.IndexOf("-") != -1)
                        {
                            if (order[j].Betflag == "H")
                            {
                                a = int.Parse(order[j].Score.Substring(0, order[j].Score.IndexOf(':'))) - int.Parse(order[j].Score.Substring(order[j].Score.IndexOf(':') + 1));
                                b = a - double.Parse(order[j].Handicap.ToString().Substring(1));
                            }
                            else if (order[j].Betflag == "A")
                            {
                                a = int.Parse(order[j].Score.Substring(order[j].Score.IndexOf(':') + 1)) - int.Parse(order[j].Score.Substring(0, order[j].Score.IndexOf(':')));
                                b = a - double.Parse(order[j].Handicap.ToString().Substring(1));
                            }
                            double s = double.Parse(order[j].Handicap.Substring(1)) / 0.5;
                            if (int.Parse(s.ToString().Substring(0, (s.ToString().IndexOf('.') == -1 ? s.ToString().Length : s.ToString().IndexOf('.')))) < s)
                            {
                                if (a < 0)
                                {
                                    h.Result = Convert.ToDecimal("-" + (order[j].Odds > 0 ? order[j].Amount : order[j].ValidAmount));
                                }
                                else if (b > 0)
                                {
                                    if (b == 0.25)
                                    {
                                        h.Result = Convert.ToDecimal(order[j].Amount / 2);
                                    }
                                    else if (b > 0.25)
                                    {
                                        h.Result = Convert.ToDecimal(order[j].Amount);
                                    }
                                }
                                else
                                {
                                    if (b * (-1) == 0.25)
                                    {
                                        h.Result = Convert.ToDecimal("-" + (order[j].Odds > 0 ? order[j].Amount / 2 : order[j].ValidAmount / 2));
                                    }
                                    else if (b * (-1) > 0.25)
                                    {
                                        h.Result = Convert.ToDecimal("-" + (order[j].Odds > 0 ? order[j].Amount : order[j].ValidAmount));
                                    }
                                }
                            }
                            else
                            {
                                if (b == 0)
                                {
                                    h.Result = 0;
                                }
                                else if (b < 0)
                                {
                                    h.Result = Convert.ToDecimal("-" + (order[j].Odds > 0 ? order[j].Amount : order[j].ValidAmount));
                                }
                                else if (b > 0)
                                {
                                    h.Result = Convert.ToDecimal((order[j].Odds > 0 ? order[j].Amount : order[j].ValidAmount));
                                }
                            }
                        }
                        else
                        {
                            if (order[j].Betflag == "H")
                            {
                                a = int.Parse(order[j].Score.Substring(0, order[j].Score.IndexOf(':'))) - int.Parse(order[j].Score.Substring(order[j].Score.IndexOf(':') + 1));
                                b = a + double.Parse(order[j].Handicap.ToString());
                            }
                            else if (order[j].Betflag == "A")
                            {
                                a = int.Parse(order[j].Score.Substring(order[j].Score.IndexOf(':') + 1)) - int.Parse(order[j].Score.Substring(0, order[j].Score.IndexOf(':')));
                                b = a + double.Parse(order[j].Handicap.ToString());
                            }
                            double s = double.Parse(order[j].Handicap) / 0.5;
                            if (int.Parse(s.ToString().Substring(0, (s.ToString().IndexOf('.') == -1 ? s.ToString().Length : s.ToString().IndexOf('.')))) < s)
                            {
                                if (a < 0)
                                {
                                    h.Result = Convert.ToDecimal("-" + (order[j].Odds > 0 ? order[j].Amount : order[j].ValidAmount));
                                }
                                else if (b > 0)
                                {
                                    if (b == 0.25)
                                    {
                                        h.Result = Convert.ToDecimal(order[j].Amount / 2);
                                    }
                                    else if (b > 0.25)
                                    {
                                        h.Result = Convert.ToDecimal(order[j].Amount);
                                    }
                                }
                                else
                                {
                                    if (b * (-1) == 0.25)
                                    {
                                        h.Result = Convert.ToDecimal("-" + (order[j].Odds > 0 ? order[j].Amount / 2 : order[j].ValidAmount / 2));
                                    }
                                    else if (b * (-1) > 0.25)
                                    {
                                        h.Result = Convert.ToDecimal("-" + (order[j].Odds > 0 ? order[j].Amount : order[j].ValidAmount));
                                    }
                                }
                            }
                            else
                            {
                                if (b == 0)
                                {
                                    h.Result = 0;
                                }
                                else if (b < 0)
                                {
                                    h.Result = Convert.ToDecimal("-" + (order[j].Odds > 0 ? order[j].Amount : order[j].ValidAmount));
                                }
                                else if (b > 0)
                                {
                                    h.Result = Convert.ToDecimal((order[j].Odds > 0 ? order[j].Amount : order[j].ValidAmount));
                                }
                            }
                        }
                        break;

                    /*---全场让球结束----------*/
                    /*---半场大小----------*/
                    case 3:
                    case 7:
                    case 11:
                        if (order[j].BetType == "7")
                        {
                            OrderdetailouhflManager.DeleteOrderdetailouhflByPK(order[j].ID);
                        }
                        else
                        {
                            OrderdetailouhfManager.DeleteOrderdetailouhfByPK(order[j].ID);
                        }
                        if (order[j].Status == "0")
                        {
                            break;
                        }
                        a = 0;
                        a = int.Parse(hls[i].Substring(0, hls[i].IndexOf(':'))) + int.Parse(hls[i].Substring(hls[i].IndexOf(':') + 1));
                        if (a > double.Parse(order[j].Handicap))
                        {
                            h.Result = (order[j].Betflag == "O" ? (order[j].Amount) : decimal.Parse("-" + (order[j].Odds > 0 ? order[j].Amount : order[j].ValidAmount)));
                        }
                        else if (a < double.Parse(order[j].Handicap))
                        {
                            h.Result = (order[j].Betflag == "U" ? (order[j].Amount) : decimal.Parse("-" + (order[j].Odds > 0 ? order[j].Amount : order[j].ValidAmount)));
                        }
                        else
                        {
                            h.Result = 0;
                        }
                        break;

                    /*---半场大小结束----------*/
                    /*---全场大小----------*/
                    case 1:
                    case 5:
                    case 9:
                        if (order[j].BetType == "5")
                        {
                            OrderdetailoulManager.DeleteOrderdetailoulByPK(order[j].ID);
                        }
                        else
                        {
                            OrderdetailouManager.DeleteOrderdetailouByPK(order[j].ID);
                        }
                        if (order[j].Status == "0")
                        {
                            break;
                        }
                        a = 0;
                        a = int.Parse(order[j].Score.Substring(0, order[j].Score.IndexOf(':'))) + int.Parse(order[j].Score.Substring(order[j].Score.IndexOf(':') + 1));
                        if (a > double.Parse(order[j].Handicap))
                        {
                            h.Result = (order[j].Betflag == "O" ? (order[j].Amount) : decimal.Parse("-" + (order[j].Odds > 0 ? order[j].Amount : order[j].ValidAmount)));
                        }
                        else if (a < double.Parse(order[j].Handicap))
                        {
                            h.Result = (order[j].Betflag == "U" ? (order[j].Amount) : decimal.Parse("-" + (order[j].Odds > 0 ? order[j].Amount : order[j].ValidAmount)));
                        }
                        else
                        {
                            h.Result = 0;
                        }
                        break;

                    /*---全场大小结束----------*/
                    /*---半场标准----------*/
                    case 13:
                    case 15:
                    case 17:
                        if (order[j].BetType == "15")
                        {
                            Orderdetail1x2hflManager.DeleteOrderdetail1x2hflByPK(order[j].ID);
                        }
                        else
                        {
                            Orderdetail1x2hfManager.DeleteOrderdetail1x2hfByPK(order[j].ID);
                        }
                        if (order[j].Status == "0")
                        {
                            break;
                        }
                        a = 0;
                        /*-------选择主队时a与b的值---------*/
                        if (order[j].Betflag == "1")
                        {
                            a = int.Parse(hls[i].Substring(0, hls[i].IndexOf(':'))) - int.Parse(hls[i].Substring(hls[i].IndexOf(':') + 1));
                        }
                        /*-------选择客队时a与b的值--------*/
                        else if (order[j].Betflag == "2")
                        {
                            a = int.Parse(hls[i].Substring(hls[i].IndexOf(':') + 1)) - int.Parse(hls[i].Substring(0, hls[i].IndexOf(':')));
                        }
                        else
                        {
                            a = int.Parse(hls[i].Substring(0, hls[i].IndexOf(':'))) - int.Parse(hls[i].Substring(hls[i].IndexOf(':') + 1));
                        }
                        if (a < 0)
                        {
                            h.Result = decimal.Parse("-" + (order[j].Odds > 0 ? order[j].Amount : order[j].ValidAmount));
                        }
                        else if (a > 0)
                        {
                            h.Result = (order[j].Odds > 0 ? order[j].Amount : order[j].ValidAmount);
                        }
                        else
                        {
                            h.Result = 0;
                        }
                        break;

                    /*---半场标准结束----------*/
                    /*---全场标准----------*/
                    case 12:
                    case 14:
                    case 16:
                        if (order[j].BetType == "14")
                        {
                            Orderdetail1x2lManager.DeleteOrderdetail1x2lByPK(order[j].ID);
                        }
                        else
                        {
                            Orderdetail1x2Manager.DeleteOrderdetail1x2ByPK(order[j].ID);
                        }
                        if (order[j].Status == "0")
                        {
                            break;
                        }
                        a = 0;
                        if (order[j].Betflag == "1")
                        {
                            a = int.Parse(order[j].Score.Substring(0, order[j].Score.IndexOf(':'))) - int.Parse(order[j].Score.Substring(order[j].Score.IndexOf(':') + 1));
                            if (a > 0)
                            {
                                h.Result = order[j].Amount;
                            }
                            else
                            {
                                h.Result = decimal.Parse("-" + order[j].Amount);
                            }
                        }
                        else if (order[j].Betflag == "2")
                        {
                            a = int.Parse(order[j].Score.Substring(order[j].Score.IndexOf(':') + 1)) - int.Parse(order[j].Score.Substring(0, order[j].Score.IndexOf(':')));
                            if (a > 0)
                            {
                                h.Result = order[j].Amount;
                            }
                            else
                            {
                                h.Result = decimal.Parse("-" + order[j].Amount);
                            }
                        }
                        else
                        {
                            a = int.Parse(order[j].Score.Substring(0, order[j].Score.IndexOf(':'))) - int.Parse(order[j].Score.Substring(order[j].Score.IndexOf(':') + 1));
                            if (a == 0)
                            {
                                h.Result = order[j].Amount;
                            }
                            else
                            {
                                h.Result = decimal.Parse("-" + order[j].Amount);
                            }
                        }

                        break;
                        /*---全场标准结束----------*/
                    }
                    h.Odds = order[j].Odds;
                    if (h.Result > 0)
                    {
                        h.Result = h.Result * h.Odds;
                    }
                    h.Agent             = order[j].Agent;
                    h.Scorehalf         = hls[i];
                    h.AgentCommission   = order[j].AgentCommission;
                    h.AgentPercent      = order[j].AgentPercent;
                    h.Amount            = order[j].Amount;
                    h.Awaycn            = order[j].Awaycn;
                    h.Awayen            = order[j].Awayen;
                    h.Awayth            = order[j].Awayth;
                    h.Awaytw            = order[j].Awaytw;
                    h.Awayvn            = order[j].Awayvn;
                    h.BeginTime         = order[j].BeginTime;
                    h.BetItem           = order[j].BetItem;
                    h.BetType           = order[j].BetType;
                    h.Coefficient       = order[j].Coefficient;
                    h.CompanyCommission = order[j].CompanyCommission;
                    h.CompanyPercent    = order[j].CompanyPercent;
                    h.Currency          = order[j].Currency;
                    h.Gameid            = order[j].Gameid;
                    h.Handicap          = order[j].Handicap;
                    h.Homecn            = order[j].Homecn;
                    h.Homeen            = order[j].Homeen;
                    h.Hometh            = order[j].Hometh;
                    h.Hometw            = order[j].Hometw;
                    h.Homevn            = order[j].Homevn;
                    h.IP                   = order[j].IP;
                    h.IsHalf               = order[j].IsHalf;
                    h.Leaguecn             = order[j].Leaguecn;
                    h.Leagueen             = order[j].Leagueen;
                    h.Leagueth             = order[j].Leagueth;
                    h.Leaguetw             = order[j].Leaguetw;
                    h.Leaguevn             = order[j].Leaguevn;
                    h.OddsType             = order[j].OddsType;
                    h.OrderID              = order[j].OrderID;
                    h.Partner              = order[j].Partner;
                    h.PartnerCommission    = order[j].PartnerCommission;
                    h.PartnerPercent       = order[j].PartnerPercent;
                    h.Proportion           = order[j].Proportion;
                    h.Reason               = order[j].Reason;
                    h.Score                = order[j].Score;
                    h.Status               = order[j].Status;
                    h.SubCompany           = order[j].SubCompany;
                    h.SubCompanyCommission = order[j].SubCompanyCommission;
                    h.SubCompanyPercent    = order[j].SubCompanyPercent;
                    h.Time                 = order[j].Time;
                    h.UserLevel            = order[j].UserLevel;
                    h.UserName             = order[j].UserName;
                    h.ValidAmount          = order[j].ValidAmount;
                    h.WebSiteiID           = order[j].WebSiteiID;
                    h.ZAgent               = order[j].ZAgent;
                    h.ZAgentCommission     = order[j].ZAgentCommission;
                    h.ZAgentPercent        = order[j].ZAgentPercent;
                    h.Betflag              = order[j].Betflag;
                    if (h.Result > 0)
                    {
                        if (h.Odds < 0)
                        {
                            if (h.Result == h.Amount * h.Odds * -1)
                            {
                                Orderdetail1x2hflManager.setBalance(h.UserName, (h.Result + h.Amount).ToString());
                            }
                            else if (h.Result == h.Amount / 2 * h.Odds * -1)
                            {
                                Orderdetail1x2hflManager.setBalance(h.UserName, (h.Result + h.Amount / 2 + h.Amount - h.ValidAmount).ToString());
                            }
                        }
                        else
                        {
                            if (h.Result == h.Amount * h.Odds)
                            {
                                Orderdetail1x2hflManager.setBalance(h.UserName, (h.Result + h.Amount).ToString());
                            }
                            else if (h.Result == h.Amount / 2 * h.Odds)
                            {
                                Orderdetail1x2hflManager.setBalance(h.UserName, (h.Result + h.Amount / 2).ToString());
                            }
                        }
                    }
                    else
                    {
                        if ((h.Amount + h.Result) != 0 && h.Status != "0")
                        {
                            Orderdetail1x2hflManager.setBalance(h.UserName, (h.Result + h.Amount).ToString());
                        }
                    }
                    OrderhistoryManager.AddOrderhistory(h);
                }

                //    List<Orderdetail1x2> order1 = Orderdetail1x2Manager.getEscAll(int.Parse(gi[i]));
                //    for (int j = 0; j < order1.Count; j++)
                //    {
                //        Orderhistory h = new Orderhistory();
                //        h.Odds = order1[j].Odds;
                //        h.Agent = order1[j].Agent;
                //        h.AgentCommission = order1[j].AgentCommission;
                //        h.AgentPercent = order1[j].AgentPercent;
                //        h.Amount = order1[j].Amount;
                //        h.Awaycn = order1[j].Awaycn;
                //        h.Awayen = order1[j].Awayen;
                //        h.Awayth = order1[j].Awayth;
                //        h.Awaytw = order1[j].Awaytw;
                //        h.Awayvn = order1[j].Awayvn;
                //        h.BeginTime = order1[j].BeginTime;
                //        h.BetItem = order1[j].BetItem;
                //        h.BetType = order1[j].BetType;
                //        h.Coefficient = order1[j].Coefficient;
                //        h.CompanyCommission = order1[j].CompanyCommission;
                //        h.CompanyPercent = order1[j].CompanyPercent;
                //        h.Currency = order1[j].Currency;
                //        h.Gameid = order1[j].Gameid;
                //        h.Handicap = order1[j].Handicap;
                //        h.Homecn = order1[j].Homecn;
                //        h.Homeen = order1[j].Homeen;
                //        h.Hometh = order1[j].Hometh;
                //        h.Hometw = order1[j].Hometw;
                //        h.Homevn = order1[j].Homevn;
                //        h.IP = order1[j].IP;
                //        h.IsHalf = order1[j].IsHalf;
                //        h.Leaguecn = order1[j].Leaguecn;
                //        h.Leagueen = order1[j].Leagueen;
                //        h.Leagueth = order1[j].Leagueth;
                //        h.Leaguetw = order1[j].Leaguetw;
                //        h.Leaguevn = order1[j].Leaguevn;
                //        h.OddsType = order1[j].OddsType;
                //        h.OrderID = order1[j].OrderID;
                //        h.Partner = order1[j].Partner;
                //        h.PartnerCommission = order1[j].PartnerCommission;
                //        h.PartnerPercent = order1[j].PartnerPercent;
                //        h.Proportion = order1[j].Proportion;
                //        h.Reason = order1[j].Reason;
                //        h.Score = order1[j].Score;
                //        h.Status = order1[j].Status;
                //        h.SubCompany = order1[j].SubCompany;
                //        h.SubCompanyCommission = order1[j].SubCompanyCommission;
                //        h.SubCompanyPercent = order1[j].SubCompanyPercent;
                //        h.Time = order1[j].Time;
                //        h.UserLevel = order1[j].UserLevel;
                //        h.UserName = order1[j].UserName;
                //        h.ValidAmount = order1[j].ValidAmount;
                //        h.WebSiteiID = order1[j].WebSiteiID;
                //        h.ZAgent = order1[j].ZAgent;
                //        h.ZAgentCommission = order1[j].ZAgentCommission;
                //        h.ZAgentPercent = order1[j].ZAgentPercent;
                //        h.Betflag = order1[j].Betflag;
                //        OrderhistoryManager.AddOrderhistory(h);
                //    }
            }
            return("true");
        }