Exemplo n.º 1
0
        private void clearTableMDB()
        {
            bool addOK = LinkMyMDB.clearData("numberGroup");

            if (addOK == false)
            {
                MessageBox.Show("清空失败");
                return;
            }
            this.issueTxt.Text    = "";
            this.numGroupTxt.Text = "";
        }
Exemplo n.º 2
0
        /// <summary>
        /// 设置期号为最新一期
        /// </summary>
        /// <returns></returns>
        private string setIssueNew()
        {
            bool      isTrue = true;
            DataTable dt     = LinkMyMDB.operatingQuery("select * from numberGroup order by id desc", ref isTrue);

            if (isTrue == false || dt == null || dt.Rows.Count == 0)
            {
                return("");
            }

            return(Convert.ToInt64(dt.Rows[0]["issue"].ToString()) + 1 + "");
        }
Exemplo n.º 3
0
        //将号码组插入到mdb数据库
        private void addNumGroupToMDB()
        {
            bool      isTrue   = true;
            DataTable dt       = LinkMyMDB.ReadAllData("numberGroup", ref isTrue);
            string    isscue   = this.issueTxt.Text.Trim();
            string    numGroup = this.numGroupTxt.Text.Trim();
            bool      addOK    = LinkMyMDB.insertData("numberGroup", isscue, numGroup);//是否添加成功

            if (addOK == false)
            {
                MessageBox.Show("添加失败");
                return;
            }
            this.issueTxt.Text    = Convert.ToInt64(this.issueTxt.Text) + 1 + "";
            this.numGroupTxt.Text = "";
        }
Exemplo n.º 4
0
        private string dingWeiZouShi_trs()
        {
            StringBuilder sb     = new StringBuilder();
            bool          isTrue = true;
            DataTable     dt     = LinkMyMDB.ReadAllData("numberGroup", ref isTrue);

            if (isTrue == false || dt == null || dt.Rows.Count == 0)
            {
                return(sb.ToString());
            }

            string[] tdText       = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" };//, "单", "双"
            int[]    countBaiLine = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
            int[]    countShiLine = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
            int[]    countGeLine  = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };

            //画每行
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DataRow dr       = dt.Rows[i];
                string  issue    = dr["issue"].ToString();
                string  numGroup = dr["num_group"].ToString();
                int     a        = Convert.ToInt16(numGroup.Substring(0, 1));
                int     b        = Convert.ToInt16(numGroup.Substring(1, 1));
                int     c        = Convert.ToInt16(numGroup.Substring(2, 1));

                sb.Append("<tr>");
                sb.Append("<TD class='yellow bold' width=35>" + issue + "</TD>");         //期号
                sb.Append("<TD class='white enfont red' width=35>" + numGroup + "</TD>"); //开奖号码

                //绘制百位区 开始
                for (int j = 0; j < tdText.Length; j++)
                {
                    int _tdText = Convert.ToInt16(tdText[j]);
                    if (a == _tdText)
                    {
                        sb.Append("<TD class='yellow ch_background_white' height=26>" + _tdText + "</TD>");
                        countBaiLine[j] = 1;//如果有号了,那么从1开始重新计数
                    }
                    else
                    {
                        sb.Append("<TD class='yellow whiteWord' height=26>" + (countBaiLine[j]++) + "</TD>");
                    }
                }

                //绘制单、双两格
                if (a % 2 == 0)
                {
                    sb.Append("<td class='white whiteWord'></td>");
                    sb.Append("<td class='white whiteWord'><img src='images/2.gif'></td>");
                }
                else
                {
                    sb.Append("<td class='white whiteWord'><img src='images/5.gif'></td>");
                    sb.Append("<td class='white whiteWord'></td>");
                }
                //绘制百位区 结束

                //绘制十位区 开始
                for (int j = 0; j < tdText.Length; j++)
                {
                    int _tdText = Convert.ToInt16(tdText[j]);
                    if (b == _tdText)
                    {
                        sb.Append("<TD class='yellow ch_background_white' height=26>" + _tdText + "</TD>");
                        countShiLine[j] = 1;//如果有号了,那么从1开始重新计数
                    }
                    else
                    {
                        sb.Append("<TD class='yellow whiteWord' height=26>" + (countShiLine[j]++) + "</TD>");
                    }
                }

                //绘制单、双两格
                if (b % 2 == 0)
                {
                    sb.Append("<td class='white whiteWord'></td>");
                    sb.Append("<td class='white whiteWord'><img src='images/2.gif'></td>");
                }
                else
                {
                    sb.Append("<td class='white whiteWord'><img src='images/5.gif'></td>");
                    sb.Append("<td class='white whiteWord'></td>");
                }
                //绘制十位区 结束

                //绘制个位区 开始
                for (int j = 0; j < tdText.Length; j++)
                {
                    int _tdText = Convert.ToInt16(tdText[j]);
                    if (c == _tdText)
                    {
                        sb.Append("<TD class='yellow ch_background_white' height=26>" + _tdText + "</TD>");
                        countGeLine[j] = 1;//如果有号了,那么从1开始重新计数
                    }
                    else
                    {
                        sb.Append("<TD class='yellow whiteWord' height=26>" + (countGeLine[j]++) + "</TD>");
                    }
                }

                //绘制单、双两格
                if (c % 2 == 0)
                {
                    sb.Append("<td class='white whiteWord'></td>");
                    sb.Append("<td class='white whiteWord'><img src='images/2.gif'></td>");
                }
                else
                {
                    sb.Append("<td class='white whiteWord'><img src='images/5.gif'></td>");
                    sb.Append("<td class='white whiteWord'></td>");
                }
                //绘制个位区 结束

                sb.Append("</tr>");
            }

            return(sb.ToString());
        }
Exemplo n.º 5
0
        private string heZhiWeiZST_trs()
        {
            StringBuilder sb     = new StringBuilder();
            bool          isTrue = true;
            DataTable     dt     = LinkMyMDB.ReadAllData("numberGroup", ref isTrue);

            if (isTrue == false || dt == null || dt.Rows.Count == 0)
            {
                return(sb.ToString());
            }

            string[] tdText    = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" };//, "单", "双", "上", "中", "下"
            int[]    countLine = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };

            //画每行
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DataRow dr       = dt.Rows[i];
                string  issue    = dr["issue"].ToString();
                string  numGroup = dr["num_group"].ToString();

                sb.Append("<tr>");
                sb.Append("<TD class='yellow bold' width=35>" + issue + "</TD>");         //期号
                sb.Append("<TD class='white enfont red' width=35>" + numGroup + "</TD>"); //开奖号码
                numGroup = Tools.sort3D(numGroup);
                int a         = Convert.ToInt16(numGroup.Substring(0, 1));
                int b         = Convert.ToInt16(numGroup.Substring(1, 1));
                int c         = Convert.ToInt16(numGroup.Substring(2, 1));
                int _heZhiWei = a + b + c;
                if (_heZhiWei > 10)
                {
                    _heZhiWei = Convert.ToInt16((_heZhiWei + "").Substring(1, 1));//大于10取个位
                }

                for (int j = 0; j < tdText.Length; j++)//绘制小号0~9
                {
                    int _tdText = Convert.ToInt16(tdText[j]);
                    if (_heZhiWei == _tdText)
                    {
                        sb.Append("<TD class='yellow ch_background_white' height=26>" + _tdText + "</TD>");
                        countLine[j] = 1;//如果有号了,那么从1开始重新计数
                    }
                    else
                    {
                        sb.Append("<TD class='yellow whiteWord' height=26>" + (countLine[j]++) + "</TD>");
                    }
                }

                //绘制单、双两格
                if (_heZhiWei % 2 == 0)
                {
                    sb.Append("<td class='yellow'></td>");
                    sb.Append("<td class='yellow'><img src='images/2.gif'></td>");
                }
                else
                {
                    sb.Append("<td class='yellow'><img src='images/5.gif'></td>");
                    sb.Append("<td class='yellow'></td>");
                }
                sb.Append("</tr>");
            }

            return(sb.ToString());
        }
Exemplo n.º 6
0
        private string liangMaChaZST_trs()
        {
            StringBuilder sb     = new StringBuilder();
            bool          isTrue = true;
            DataTable     dt     = LinkMyMDB.ReadAllData("numberGroup", ref isTrue);

            if (isTrue == false || dt == null || dt.Rows.Count == 0)
            {
                return(sb.ToString());
            }

            string[] tdText    = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" }; //, "单", "双", "上", "中", "下"
            int[]    countLine = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };                     //用来算小号暗格

            //画每行
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DataRow dr       = dt.Rows[i];
                string  issue    = dr["issue"].ToString();
                string  numGroup = dr["num_group"].ToString();
                int     a        = Convert.ToInt16(numGroup.Substring(0, 1));
                int     b        = Convert.ToInt16(numGroup.Substring(1, 1));
                int     c        = Convert.ToInt16(numGroup.Substring(2, 1));

                //从小到大排序两码差并拿到最小的两码差
                string liangMaCha      = Tools.sort3D(Math.Abs(b - a) + "" + Math.Abs(c - b) + "" + Math.Abs(c - a) + "");
                int    smallLiangMaCha = Convert.ToInt16(liangMaCha.Substring(0, 1));

                int[] upNumber     = { 0, 1, 4, 7 }; //上
                int[] middleNumber = { 2, 5, 8 };    //中
                int[] downNumber   = { 3, 6, 9 };    //下

                sb.Append("<tr>");
                sb.Append("<TD class='yellow bold' width=35>" + issue + "</TD>");           //期号
                sb.Append("<TD class='white enfont red' width=35>" + numGroup + "</TD>");   //开奖号码
                sb.Append("<TD class='white enfont red' width=35>" + liangMaCha + "</TD>"); //两码差

                for (int j = 0; j < tdText.Length; j++)                                     //绘制小号0~9
                {
                    int _tdText = Convert.ToInt16(tdText[j]);
                    if (smallLiangMaCha == _tdText)
                    {
                        sb.Append("<TD class='yellow ch_background_white' height=26>" + _tdText + "</TD>");
                        countLine[j] = 1;//如果有号了,那么从1开始重新计数
                    }
                    else
                    {
                        sb.Append("<TD class='yellow whiteWord' height=26>" + (countLine[j]++) + "</TD>");
                    }
                }

                //绘制单、双两格
                if (smallLiangMaCha % 2 == 0)
                {
                    sb.Append("<td class='yellow'></td>");
                    sb.Append("<td class='yellow'><img src='images/2.gif'></td>");
                }
                else
                {
                    sb.Append("<td class='yellow'><img src='images/5.gif'></td>");
                    sb.Append("<td class='yellow'></td>");
                }

                //绘制上、中、下
                if (upNumber.Contains(smallLiangMaCha))
                {
                    sb.Append("<td class='yellow'><img src='images/4.gif'></td>");
                    sb.Append("<td class='yellow'></td>");
                    sb.Append("<td class='yellow'></td>");
                }
                else if (middleNumber.Contains(smallLiangMaCha))
                {
                    sb.Append("<td class='yellow'></td>");
                    sb.Append("<td class='yellow'><img src='images/4.gif'></td>");
                    sb.Append("<td class='yellow'></td>");
                }
                else
                {
                    sb.Append("<td class='yellow'></td>");
                    sb.Append("<td class='yellow'></td>");
                    sb.Append("<td class='yellow'><img src='images/4.gif'></td>");
                }
                sb.Append("</tr>");
            }

            return(sb.ToString());
        }
Exemplo n.º 7
0
        //生成每行的小号开头、大号结尾
        private string xiaoKaiDaJie_trs()
        {
            StringBuilder sb     = new StringBuilder();
            bool          isTrue = true;
            DataTable     dt     = LinkMyMDB.ReadAllData("numberGroup", ref isTrue);

            if (isTrue == false || dt == null || dt.Rows.Count == 0)
            {
                return(sb.ToString());
            }

            string[] tdText         = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" }; //, "单", "双", "上", "中", "下"
            int[]    countSmallLine = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };                     //用来算小号暗格
            int[]    countLargeLine = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };                     //用来算大号暗格
            int[]    upNumber       = { 0, 1, 4, 7 };                                       //上
            int[]    middleNumber   = { 2, 5, 8 };                                          //中
            int[]    downNumber     = { 3, 6, 9 };                                          //下

            //画每行
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DataRow dr       = dt.Rows[i];
                string  issue    = dr["issue"].ToString();
                string  numGroup = dr["num_group"].ToString();

                sb.Append("<tr>");
                sb.Append("<TD class='yellow bold' width=35>" + issue + "</TD>");         //期号
                sb.Append("<TD class='white enfont red' width=35>" + numGroup + "</TD>"); //开奖号码

                numGroup = Tools.sort3D(numGroup);                                        //从小到大排序
                int smallNum = Convert.ToInt16(numGroup.Substring(0, 1));
                int largeNum = Convert.ToInt16(numGroup.Substring(2, 1));

                //小号区域  开始
                for (int j = 0; j < tdText.Length; j++)//绘制小号0~9
                {
                    int _tdText = Convert.ToInt16(tdText[j]);
                    if (smallNum == _tdText)
                    {
                        sb.Append("<TD class='yellow ch_background_white' height=26>" + _tdText + "</TD>");
                        countSmallLine[j] = 1;//如果有号了,那么从1开始重新计数
                    }
                    else
                    {
                        sb.Append("<TD class='yellow whiteWord' height=26>" + (countSmallLine[j]++) + "</TD>");
                    }
                }

                //绘制单、双两格
                if (smallNum % 2 == 0)
                {
                    sb.Append("<td class='yellow'></td>");
                    sb.Append("<td class='yellow'><img src='images/2.gif'></td>");
                }
                else
                {
                    sb.Append("<td class='yellow'><img src='images/5.gif'></td>");
                    sb.Append("<td class='yellow'></td>");
                }

                //绘制上中下
                if (upNumber.Contains(smallNum))
                {
                    sb.Append("<td class='white whiteWord'><img src='images/4.gif'></td>");
                    sb.Append("<td class='white whiteWord'></td>");
                    sb.Append("<td class='white whiteWord'></td>");
                }
                else if (middleNumber.Contains(smallNum))
                {
                    sb.Append("<td class='white whiteWord'></td>");
                    sb.Append("<td class='white whiteWord'><img src='images/4.gif'></td>");
                    sb.Append("<td class='white whiteWord'></td>");
                }
                else
                {
                    sb.Append("<td class='white whiteWord'></td>");
                    sb.Append("<td class='white whiteWord'></td>");
                    sb.Append("<td class='white whiteWord'><img src='images/4.gif'></td>");
                }
                //小号区域  结束

                //大号区域  开始
                for (int j = 0; j < tdText.Length; j++)//绘制大号0~9
                {
                    int _tdText = Convert.ToInt16(tdText[j]);
                    if (largeNum == _tdText)
                    {
                        sb.Append("<TD class='yellow ch_background_white' height=26>" + _tdText + "</TD>");
                        countLargeLine[j] = 1;//如果有号了,那么从1开始重新计数
                    }
                    else
                    {
                        sb.Append("<TD class='yellow whiteWord' height=26>" + (countLargeLine[j]++) + "</TD>");
                    }
                }

                //绘制单、双两格
                if (largeNum % 2 == 0)
                {
                    sb.Append("<td class='yellow'></td>");
                    sb.Append("<td class='yellow'><img src='images/2.gif'></td>");
                }
                else
                {
                    sb.Append("<td class='yellow'><img src='images/5.gif'></td>");
                    sb.Append("<td class='yellow'></td>");
                }

                //绘制上中下
                if (upNumber.Contains(largeNum))
                {
                    sb.Append("<td class='white whiteWord'><img src='images/4.gif'></td>");
                    sb.Append("<td class='white whiteWord'></td>");
                    sb.Append("<td class='white whiteWord'></td>");
                }
                else if (middleNumber.Contains(largeNum))
                {
                    sb.Append("<td class='white whiteWord'></td>");
                    sb.Append("<td class='white whiteWord'><img src='images/4.gif'></td>");
                    sb.Append("<td class='white whiteWord'></td>");
                }
                else
                {
                    sb.Append("<td class='white whiteWord'></td>");
                    sb.Append("<td class='white whiteWord'></td>");
                    sb.Append("<td class='white whiteWord'><img src='images/4.gif'></td>");
                }
                //大号区域  结束


                sb.Append("</tr>");
            }

            return(sb.ToString());
        }