Exemplo n.º 1
0
        /// <summary>
        /// 二星定位胆
        /// </summary>
        /// <param name="type"></param>
        /// <param name="date"></param>
        /// <returns></returns>
        public JsonResult PostDwdData(int type, string date)
        {
            date = date.Replace("-", "");
            TendencyDwdModel tmDwd = new TendencyDwdModel();

            if (type == 1)
            {
                var lt_TenThousand = XscpMysqlBLL.QueryTendency1(Tendency1Enum.TenThousand, date, 1);  //万位
                var lt_Thousand    = XscpMysqlBLL.QueryTendency1(Tendency1Enum.Thousand, date, 1);     //千位
                if (lt_TenThousand != null && lt_TenThousand.Count > 0)
                {
                    tmDwd = GetTendencyDwdValue(lt_TenThousand[0], lt_Thousand[0]);
                }
                tmDwd.Sno = "前定";
            }
            else
            {
                var lt_Ten = XscpMysqlBLL.QueryTendency1(Tendency1Enum.Ten, date, 1); //十位
                var lt_One = XscpMysqlBLL.QueryTendency1(Tendency1Enum.One, date, 1); //个位
                if (lt_Ten != null && lt_Ten.Count > 0)
                {
                    tmDwd = GetTendencyDwdValue(lt_Ten[0], lt_One[0]);
                }
                tmDwd.Sno = "后定";
            }

            return(Json(tmDwd, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 2
0
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            int count = 0;

            if (comboBox1.SelectedIndex == 0)
            {
                count = 30;
            }
            else if (comboBox1.SelectedIndex == 1)
            {
                count = 50;
            }
            else if (comboBox1.SelectedIndex == 2)
            {
                count = 100;
            }
            else if (comboBox1.SelectedIndex == 3)
            {
                count = 1380;
            }

            List <Tendency2Model> lt = XscpMysqlBLL.QueryTendency2(this.type, this.date, count);

            LoadData(lt);
        }
Exemplo n.º 3
0
        public JsonResult GetPieRangeTimeData(int type, string startDate = "20170501", string endDate = "20170701")
        {
            if (!string.IsNullOrEmpty(startDate))
            {
                startDate = startDate.Replace("-", "");
            }
            if (!string.IsNullOrEmpty(endDate))
            {
                endDate = endDate.Replace("-", "");
            }

            List <Tendency2Model> lt_lotterys = new List <Tendency2Model>();

            if (type == 1)
            {
                lt_lotterys = XscpMysqlBLL.QueryTendency2Range(Common.Model.Tendency2Enum.Before, startDate, endDate);
            }
            else
            {
                lt_lotterys = XscpMysqlBLL.QueryTendency2Range(Common.Model.Tendency2Enum.After, startDate, endDate);
            }

            List <PieData> lt_pie = new List <PieData>();

            lt_pie.Add(getSomeRangeTimePie(lt_lotterys, EnumLotteryPatter.Big));
            lt_pie.Add(getSomeRangeTimePie(lt_lotterys, EnumLotteryPatter.Small));
            lt_pie.Add(getSomeRangeTimePie(lt_lotterys, EnumLotteryPatter.BigSmall));
            lt_pie.Add(getSomeRangeTimePie(lt_lotterys, EnumLotteryPatter.SmallBig));
            lt_pie.Add(getSomeRangeTimePie(lt_lotterys, EnumLotteryPatter.Dbl));
            lt_pie.Add(getSomeRangeTimePie(lt_lotterys, EnumLotteryPatter.Odd));
            lt_pie.Add(getSomeRangeTimePie(lt_lotterys, EnumLotteryPatter.Pair));
            lt_pie.Add(getSomeRangeTimePie(lt_lotterys, EnumLotteryPatter.OddPair));
            lt_pie.Add(getSomeRangeTimePie(lt_lotterys, EnumLotteryPatter.PairOdd));
            return(Json(lt_pie, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 4
0
        public JsonResult GetPieData(int type, string date, int num = 1380)
        {
            date = date.Replace("-", "");
            List <Tendency2Model> lt_lotterys = new List <Tendency2Model>();

            if (type == 1)
            {
                lt_lotterys = XscpMysqlBLL.QueryTendency2(Common.Model.Tendency2Enum.Before, date, num);
            }
            else
            {
                lt_lotterys = XscpMysqlBLL.QueryTendency2(Common.Model.Tendency2Enum.After, date, num);
            }

            List <PieData> lt_pie = new List <PieData>();

            lt_pie.Add(getSomePie(lt_lotterys, EnumLotteryPatter.Big));
            lt_pie.Add(getSomePie(lt_lotterys, EnumLotteryPatter.Small));
            lt_pie.Add(getSomePie(lt_lotterys, EnumLotteryPatter.BigSmall));
            lt_pie.Add(getSomePie(lt_lotterys, EnumLotteryPatter.SmallBig));
            lt_pie.Add(getSomePie(lt_lotterys, EnumLotteryPatter.Dbl));
            lt_pie.Add(getSomePie(lt_lotterys, EnumLotteryPatter.Odd));
            lt_pie.Add(getSomePie(lt_lotterys, EnumLotteryPatter.Pair));
            lt_pie.Add(getSomePie(lt_lotterys, EnumLotteryPatter.OddPair));
            lt_pie.Add(getSomePie(lt_lotterys, EnumLotteryPatter.PairOdd));
            return(Json(lt_pie, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 5
0
        private void button1_Click(object sender, EventArgs e)
        {
            this.listBox2.Items.Clear();

            int totalMinute = getMinutes();

            if (totalMinute == 0)
            {
                return;
            }

            List <int> ltData = XscpMysqlBLL.CheckLottery(this.date.ToString("yyyyMMdd"));

            if (ltData == null || ltData.Count == 0)
            {
                this.listBox2.Items.Add("无开奖");
                return;
            }

            for (int i = 1; i <= totalMinute; i++)
            {
                if (!ltData.Contains(i))
                {
                    string result = i.ToString().PadLeft(4, '0') + "期";
                    result = result.PadLeft(10, ' ');
                    result = result.PadRight(15, ' ');
                    this.listBox2.Items.Add(result);
                }
            }

            if (this.listBox2.Items.Count == 0)
            {
                this.listBox2.Items.Add("无缺省奖号");
            }
        }
Exemplo n.º 6
0
        public JsonResult PostLoadDigitAllData(int num, string date)
        {
            date = date.Replace("-", "");
            List <Tendency1Model> lt_lotterys = new List <Tendency1Model>();

            lt_lotterys = XscpMysqlBLL.QueryAllTendencyDigit1(date, num);
            return(Json(lt_lotterys, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 7
0
        /// <summary>
        /// 取某一位的,奇、偶、大、小、012路走势
        /// </summary>
        /// <param name="type"></param>
        /// <param name="date"></param>
        /// <returns></returns>
        public JsonResult PostRoadTrendecy(int type, string date, int num)
        {
            date = date.Replace("-", "");
            Tendency1Enum tendency1Enum = (Tendency1Enum)type;
            var           list          = XscpMysqlBLL.QueryTendency1(tendency1Enum, date, num);

            return(Json(list, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 8
0
        public JsonResult PostLoadMaxAllDigit(string date)
        {
            date = date.Replace("-", "");
            Tendency1Model maxLotery = XscpMysqlBLL.QueryAllMaxTendencyDigit1(date, date);

            maxLotery.Sno   = "最大";
            maxLotery.Dtime = "-";
            return(Json(maxLotery, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 9
0
        /// <summary>
        /// 取某一位的,奇、偶、大、小、012路 最大走势
        /// </summary>
        /// <param name="type"></param>
        /// <param name="date"></param>
        /// <param name="num"></param>
        /// <returns></returns>
        public JsonResult PostMaxRoadTrendecy(int type, string date)
        {
            date = date.Replace("-", "");
            Tendency1Enum tendency1Enum = (Tendency1Enum)type;
            TendencyModel tm            = XscpMysqlBLL.QueryMaxTendency1(tendency1Enum, date);

            tm.Sno = "最大";
            return(Json(tm, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 10
0
        public JsonResult PostLoadData(int type, int num, string date)
        {
            date = date.Replace("-", "");
            List <Tendency2Model> lt_lotterys = new List <Tendency2Model>();

            if (type == 1)
            {
                lt_lotterys = XscpMysqlBLL.QueryTendency2(Common.Model.Tendency2Enum.Before, date, num);
            }
            else
            {
                lt_lotterys = XscpMysqlBLL.QueryTendency2(Common.Model.Tendency2Enum.After, date, num);
            }
            return(Json(lt_lotterys, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 11
0
        //public JsonResult PostLoadData(int num, string date)
        //{

        //    var students = new List<Student>
        //    {
        //        new Student(){ID  =1,Name = "张三",Age =20, Birthday = DateTime.Now},
        //        new Student(){ID  =2,Name = "李四",Age =20, Birthday = DateTime.Now}
        //    };

        //    var result = new JsonResult();
        //    result.Data = students;
        //    result.JsonRequestBehavior = JsonRequestBehavior.AllowGet;
        //    return result;
        //}

        /// <summary>
        /// 获取最大奖号
        /// </summary>
        /// <param name="type"></param>
        /// <param name="date"></param>
        /// <returns></returns>
        public JsonResult PostLoadMaxData(int type, string date)
        {
            date = date.Replace("-", "");
            Tendency2Model maxLotery = new Tendency2Model();

            if (type == 1)
            {
                maxLotery       = XscpMysqlBLL.QueryMaxTendency2(Common.Model.Tendency2Enum.Before, date);
                maxLotery.Sno   = "前大";
                maxLotery.Dtime = "-";
            }
            else
            {
                maxLotery       = XscpMysqlBLL.QueryMaxTendency2(Common.Model.Tendency2Enum.After, date);
                maxLotery.Sno   = "后大";
                maxLotery.Dtime = "-";
            }

            return(Json(maxLotery, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 12
0
        /// <summary>
        /// 更新彩票
        /// </summary>
        /// <param name="dt"></param>
        /// <param name="ltData"></param>
        /// <returns></returns>
        public static bool Update(DateTime dt, List <string> ltData)
        {
            try
            {
                ///新增开奖号码
                List <LotteryModel> lt_LotteryModel = XscpMysqlBLL.SaveLottery(CompanyType.Xscp, dt, ltData);

                ///新增一星走势
                XscpMysqlBLL.SaveTendency1(Tendency1Enum.TenThousand, lt_LotteryModel);
                XscpMysqlBLL.SaveTendency1(Tendency1Enum.Thousand, lt_LotteryModel);
                XscpMysqlBLL.SaveTendency1(Tendency1Enum.Hundred, lt_LotteryModel);
                XscpMysqlBLL.SaveTendency1(Tendency1Enum.Ten, lt_LotteryModel);
                XscpMysqlBLL.SaveTendency1(Tendency1Enum.One, lt_LotteryModel);

                ///新增二星走势
                XscpMysqlBLL.SaveTendency2(Tendency2Enum.Before, lt_LotteryModel);
                XscpMysqlBLL.SaveTendency2(Tendency2Enum.After, lt_LotteryModel);
                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Exemplo n.º 13
0
        /// <summary>
        /// 刷新数据
        /// </summary>
        private void refreshData()
        {
            //最新开奖号码
            var lt_lotterys = XscpMysqlBLL.QueryLottery(this.date, 1);

            if (lt_lotterys == null || lt_lotterys.Count == 0)
            {
                return;
            }

            ///加载最新开奖号
            initLottery(lt_lotterys[0]);
            return;

            List <Tendency2Model> lt_tendency2 = new List <Tendency2Model>();

            ///前二星最最大走势
            Tendency2Model maxBefore = XscpMysqlBLL.QueryMaxTendency2(Tendency2Enum.Before, this.date);

            maxBefore.Sno = "前大";
            lt_tendency2.Add(maxBefore);

            ///前二星最近走势势
            var lt_2Before = XscpMysqlBLL.QueryTendency2(Tendency2Enum.Before, this.date, 1);

            if (lt_2Before != null && lt_2Before.Count > 0)
            {
                lt_2Before[0].Sno = "前二";
                lt_tendency2.Add(lt_2Before[0]);
            }

            ///后二星最近走势势
            var lt_2After = XscpMysqlBLL.QueryTendency2(Tendency2Enum.After, this.date, 1);

            if (lt_2After != null && lt_2After.Count > 0)
            {
                lt_2After[0].Sno = "后二";
                lt_tendency2.Add(lt_2After[0]);
            }

            ///后二星最最大走势
            Tendency2Model maxAfter = XscpMysqlBLL.QueryMaxTendency2(Tendency2Enum.After, this.date);

            maxAfter.Sno = "后大";
            lt_tendency2.Add(maxAfter);

            List <TendencyModel> lt_Tendency = new List <TendencyModel>();
            ///前定二星最近走势势
            var lt_TenThousand = XscpMysqlBLL.QueryTendency1(Tendency1Enum.TenThousand, this.date, 1);  //万位
            var lt_Thousand    = XscpMysqlBLL.QueryTendency1(Tendency1Enum.Thousand, this.date, 1);     //千位

            ///后定最近走势势
            var lt_Ten = XscpMysqlBLL.QueryTendency1(Tendency1Enum.Ten, this.date, 1); //十位
            var lt_One = XscpMysqlBLL.QueryTendency1(Tendency1Enum.One, this.date, 1); //个位

            lt_TenThousand[0].Sno = "前定";
            lt_Thousand[0].Sno    = "前定";
            lt_Ten[0].Sno         = "后定";
            lt_One[0].Sno         = "后定";

            ///初始化一星
            lt_Tendency.Add(lt_TenThousand[0]);
            lt_Tendency.Add(lt_Thousand[0]);
            lt_Tendency.Add(lt_Ten[0]);
            lt_Tendency.Add(lt_One[0]);

            ///加载最新开奖号
            initLottery(lt_lotterys[0]);

            //添加6行
            this.dgvFF.Rows.Add(6);

            ///初始化一星
            initDgvTendency1(lt_Tendency);

            ///初始化二星
            initDgvTendency2(lt_tendency2);
        }
Exemplo n.º 14
0
        public void Execute(IJobExecutionContext context)
        {
            DateTime currentDate = DateTime.Now;

            var config = MySteel.Common.Helper.XmlHelper.LoadXmlFile <XsConfig>(xmlCookiesPath);

            if (config == null)
            {
                _logger.ErrorFormat("未读取到【Cookie】文件");
                return;
            }
            else if (config.FFCP.Id <= 0 || config.FFCP.Num <= 0)
            {
                _logger.ErrorFormat("没有选择彩种或更新数目");
                return;
            }
            else if (config.Cookies == null || config.Cookies.Length == 0)
            {
                _logger.ErrorFormat("没有Cookie信息");
                return;
            }

            //获取Cookie
            WebHelperMillion.Cookie = WebHelperMillion.GetCookies(config.Cookies[0]);

            DateTime startTime = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd ") + "07:03:00");
            TimeSpan timeSpan  = startTime - DateTime.Now;

            if (timeSpan.TotalMinutes > 0 && timeSpan.TotalMinutes <= 120)
            {
                ProtocolInfo pinfo = WebHelperMillion.GetProtocolInfo(config, true);

                if (pinfo.Method == ProtocolMethod.Get)
                {
                    //get 通信
                    WebHelperMillion.Get(pinfo.Url);
                }

                _logger.InfoFormat("正在停牌");
                return;
            }

            Action action = () =>
            {
                string        resultData = null;
                List <string> ltData     = new List <string>();
                if (config.Cookies.Length > 0)
                {
                    //获取通信内容
                    ProtocolInfo pinfo = WebHelperMillion.GetProtocolInfo(config);
                    if (pinfo.Method == ProtocolMethod.Get)
                    {
                        resultData = WebHelperMillion.Get(pinfo.Url);

                        MillionJsonModel objs = null;
                        try
                        {
                            objs = Newtonsoft.Json.JsonConvert.DeserializeObject <MillionJsonModel>(resultData);
                            if (objs != null)
                            {
                                ltData.Add(objs.period.Substring(9) + "," + objs.ball);
                                ltData.Add(objs.historyBall.period1.issue.Substring(9) + "," + objs.historyBall.period1.code.Replace(' ', ','));
                                ltData.Add(objs.historyBall.period2.issue.Substring(9) + "," + objs.historyBall.period2.code.Replace(' ', ','));
                                ltData.Add(objs.historyBall.period3.issue.Substring(9) + "," + objs.historyBall.period3.code.Replace(' ', ','));
                                ltData.Add(objs.historyBall.period4.issue.Substring(9) + "," + objs.historyBall.period4.code.Replace(' ', ','));
                                ltData.Add(objs.historyBall.period5.issue.Substring(9) + "," + objs.historyBall.period5.code.Replace(' ', ','));
                            }
                        }
                        catch (Exception er)
                        {
                            Console.WriteLine(er.ToString());
                            _logger.ErrorFormat("解析数据出错");
                            return;
                        }
                    }
                }

                if (ltData != null && ltData.Count > 0)
                {
                    bool bl = XscpMysqlBLL.Update(CompanyType.Million, currentDate, ltData);
                    if (bl)
                    {
                        int    index      = -1;
                        string strLottery = "百万发-";
                        if (ltData[0].Contains("期"))
                        {
                            index       = ltData[0].IndexOf('期');
                            strLottery += "【" + ltData[0].Substring(0, index + 1) + "】-【" + ltData[0].Substring(index + 1) + "】";
                            _logger.InfoFormat(strLottery);
                        }
                        else
                        {
                            index       = ltData[0].IndexOf(',');
                            strLottery += "【" + ltData[0].Substring(0, index) + "期】-【" + ltData[0].Substring(index + 1) + "】";
                            _logger.InfoFormat(strLottery);
                        }
                    }
                }
                else
                {
                    _logger.ErrorFormat("未开奖或者没有登录");
                }
            };

            if (action != null)
            {
                action();
            }
        }
Exemplo n.º 15
0
        public void Execute(IJobExecutionContext context)
        {
            //List<string> ltData1 = new List<string>();
            //ltData1.Add("0530,5,2,5,1,8");
            //ltData1.Add("0529,9,4,8,0,7");
            //ltData1.Add("0528,5,0,8,9,0");
            //ltData1.Add("0527,9,9,9,0,4");
            //ltData1.Add("0526,9,2,7,1,8");
            //ltData1.Add("0525,4,6,1,5,7");
            //ltData1.Add("0524,3,6,5,7,0");
            //ltData1.Add("0523,9,7,9,3,3");
            //ltData1.Add("0522,7,2,9,9,8");
            //ltData1.Add("0521,2,8,8,3,7");

            //XscpMysqlBLL.Update(CompanyType.Xscp, DateTime.Parse("2017-09-01"), ltData1);

            ////MysqlHelper.CreateConnection();
            ////return;

            DateTime currentDate = DateTime.Now;

            if (DateTime.Now.Hour <= 7)
            {
                currentDate = currentDate.AddDays(-1);
            }
            var config = MySteel.Common.Helper.XmlHelper.LoadXmlFile <XsConfig>(xmlCookiesPath);

            if (config == null)
            {
                _logger.ErrorFormat("未读取到【Cookie】文件");
                return;
            }
            else if (config.FFCP.Id <= 0 || config.FFCP.Num <= 0)
            {
                _logger.ErrorFormat("没有选择彩种或更新数目");
                return;
            }
            else if (config.Cookies == null || config.Cookies.Length == 0)
            {
                _logger.ErrorFormat("没有Cookie信息");
                return;
            }

            WebHelper.Cookie = WebHelper.GetCookies(config.Cookies[0]);

            DateTime startTime = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd ") + "08:03:00");
            TimeSpan timeSpan  = startTime - DateTime.Now;

            if (timeSpan.TotalMinutes > 0 && timeSpan.TotalMinutes <= 60)
            {
                ProtocolInfo pinfo = WebHelper.GetProtocolInfo(config, true);
                if (pinfo.Method == ProtocolMethod.Post)
                {
                    ///Post 通信
                    WebHelper.Post(pinfo.Url, pinfo.Data);
                }
                _logger.InfoFormat("正在停牌");
                return;
            }

            Action action = () =>
            {
                string        resultData = null;
                List <string> ltData     = new List <string>();
                if (config.Cookies.Length > 0)
                {
                    //获取通信内容
                    ProtocolInfo pinfo = WebHelper.GetProtocolInfo(config);
                    if (pinfo.Method == ProtocolMethod.Get)
                    {
                        resultData = WebHelper.Get(pinfo.Url);
                        ltData     = resultData.GetHtml();
                    }
                    else
                    {
                        ///Post 通信
                        resultData = WebHelper.Post(pinfo.Url, pinfo.Data);

                        XscpDataJsonModel objs = null;
                        try
                        {
                            objs = Newtonsoft.Json.JsonConvert.DeserializeObject <XscpDataJsonModel>(resultData);
                        }
                        catch (Exception er)
                        {
                            Console.WriteLine(er.ToString());
                            _logger.ErrorFormat("解析数据出错");
                            return;
                        }

                        if (objs != null && objs.reslist != null && objs.reslist.Count > 0)
                        {
                            //string sno = objs.reslist[0].issue.Replace("期", "");
                            //bool bl = CompareNowTime(int.Parse(sno));
                            //if()

                            objs.reslist.ForEach(item =>
                            {
                                ltData.Add(item.issue + item.winnumber);
                            });
                        }
                    }
                }

                if (ltData != null && ltData.Count > 0)
                {
                    bool bl = XscpMysqlBLL.Update(CompanyType.Xscp, currentDate, ltData);
                    if (bl)
                    {
                        int    index      = -1;
                        string strLottery = "新生娱乐-";
                        if (ltData[0].Contains("期"))
                        {
                            index       = ltData[0].IndexOf('期');
                            strLottery += "【" + ltData[0].Substring(0, index + 1) + "】-【" + ltData[0].Substring(index + 1) + "】";
                            _logger.InfoFormat(strLottery);
                        }
                        else
                        {
                            index       = ltData[0].IndexOf(',');
                            strLottery += "【" + ltData[0].Substring(0, index) + "期】-【" + ltData[0].Substring(index + 1) + "】";
                            _logger.InfoFormat(strLottery);
                        }
                    }
                }
                else
                {
                    _logger.ErrorFormat("未开奖或者没有登录");
                }
            };

            if (action != null)
            {
                action();
            }
        }
Exemplo n.º 16
0
        /// <summary>
        /// 获取数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnGet_Click(object sender, EventArgs e)
        {
            List <Tendency2Model> lt = XscpMysqlBLL.QueryTendency2(this.type, this.date, int.Parse(this.textBox3.Text));

            LoadData(lt);
        }