コード例 #1
0
ファイル: DrawNumber.cs プロジェクト: war-man/WpfAppLot
 public void UpdateSkip(DrawNumber _Result)
 {
     _Skipped.Add((byte)(_Skipped[_Skipped.Count() - 1] + 1));
     foreach (byte b in _Result.ListMainNum)
     {
         if (b == _NumberLetter)
         {
             _Skipped[_Skipped.Count() - 1] = 0;
         }
     }
     _CurrentSkip = _Skipped[_Skipped.Count() - 1];
 }
コード例 #2
0
ファイル: DrawNumber.cs プロジェクト: war-man/WpfAppLot
        public static IEnumerable <DrawNumber> GetALLDrawNumbers(DB_Service DBconnect)
        {
            string _Query = "SELECT * FROM DrawResult";

            DBconnect.Query = _Query;
            foreach (DataRow row in DBconnect.OutTable.Rows)
            {
                DrawNumber DrawResult;
                try
                {
                    DrawResult = new DrawNumber(Convert.ToInt16(row["ID"].ToString()), Convert.ToDateTime(row["DrawDate"].ToString()), Convert.ToByte(row["Num1"].ToString()), Convert.ToByte(row["Num2"].ToString()), Convert.ToByte(row["Num3"].ToString()), Convert.ToByte(row["Num4"].ToString()), Convert.ToByte(row["Num5"].ToString()), Convert.ToByte(row["EURnum1"].ToString()), Convert.ToByte(row["EURnum2"].ToString()));
                }
                catch
                {
                    DrawResult = new DrawNumber(Convert.ToInt16(row["ID"].ToString()), Convert.ToDateTime(row["DrawDate"].ToString()));
                }
                yield return(DrawResult);
            }
        }
コード例 #3
0
ファイル: DrawNumber.cs プロジェクト: war-man/WpfAppLot
        // Pick a Set and return a Pick
        private static DrawNumber PickaSet(List <int> _Mainnumbers, List <int> _Sidenumbers, DateTime _DrawDate)
        {
            DrawNumber _output;

            int[] _MainRandom;
            int[] _SideRandom;
            _MainRandom = RandomNums(_Mainnumbers, GlobalVar.NumberOfMain);
            _SideRandom = RandomNums(_Sidenumbers, GlobalVar.NumberOfSide);
            _output     = new DrawNumber(_DrawDate,
                                         (byte)_MainRandom[0],
                                         (byte)_MainRandom[1],
                                         (byte)_MainRandom[2],
                                         (byte)_MainRandom[3],
                                         (byte)_MainRandom[4],
                                         (byte)_SideRandom[0],
                                         (byte)_SideRandom[1]
                                         );
            _output.SortNum();
            return(_output);
        }
コード例 #4
0
ファイル: DrawNumber.cs プロジェクト: war-man/WpfAppLot
        // Check if is the draw number is winning or not
        public bool CheckResult(DrawNumber _Checker)
        {
            int count = 0;

            foreach (var WinNum in this.ListMainNum)
            {
                foreach (var CounterNum in _Checker.ListMainNum)
                {
                    count = (WinNum == CounterNum) ? count + 1 : count;
                }
            }
            foreach (var WinNum in this.ListSideNum)
            {
                foreach (var CounterNum in _Checker.ListSideNum)
                {
                    count = (WinNum == CounterNum) ? count + 1 : count;
                }
            }
            return(count >= 3);
        }
コード例 #5
0
ファイル: DrawNumber.cs プロジェクト: war-man/WpfAppLot
        public int[] ResultDetail(DrawNumber _Checker)
        {
            int[] _output = new int[] { 0, 0 };

            foreach (var WinNum in this.ListMainNum)
            {
                foreach (var CounterNum in _Checker.ListMainNum)
                {
                    _output[0] = (WinNum == CounterNum) ? _output[0] + 1 : _output[0];
                }
            }
            foreach (var WinNum in this.ListSideNum)
            {
                foreach (var CounterNum in _Checker.ListSideNum)
                {
                    _output[1] = (WinNum == CounterNum) ? _output[1] + 1 : _output[1];
                }
            }

            return(_output);
        }
コード例 #6
0
ファイル: DrawNumber.cs プロジェクト: war-man/WpfAppLot
        public static void UpdateDrawNumber(DrawNumber InputNumbers, DB_Service DBconnect)
        {
            string Table = "DrawResult";

            string[] Column         = new string[] { "Num1", "Num2", "Num3", "Num4", "Num5", "EURnum1", "EURnum2" };
            string[] ValueParaName  = Column;
            string[] ValueParaValue = new string[]
            {
                InputNumbers.Num1.ToString(),
                     InputNumbers.Num2.ToString(),
                     InputNumbers.Num3.ToString(),
                     InputNumbers.Num4.ToString(),
                     InputNumbers.Num5.ToString(),
                     InputNumbers.EUNum1.ToString(),
                     InputNumbers.EUNum2.ToString()
            };
            string[] WhereRow   = new string[] { "DrawDate" };
            string[] WherePara  = new string[] { "DrawDate" };
            string[] WhereValue = new string[] { InputNumbers.DrawDate.ToString("yyyy-MM-dd") };
            DBconnect.UpdateCommandWithoutkey(Table, Column, ValueParaName, ValueParaValue, WhereRow, WherePara, WhereValue);
            DBconnect.nonQueryCmd();
        }
コード例 #7
0
ファイル: DrawNumber.cs プロジェクト: war-man/WpfAppLot
 //check if the draw number is in the high range or not
 private static bool CheckRange(DrawNumber _NeedCheck)
 {
     return((_NeedCheck.MainSum >= 96 && _NeedCheck.MainSum <= 159) && (_NeedCheck.SideSum >= 5 && _NeedCheck.SideSum <= 15));
 }
コード例 #8
0
ファイル: DrawNumber.cs プロジェクト: war-man/WpfAppLot
 public static bool compareDraw(DrawNumber _First, DrawNumber _Second)
 {
     return(_First.ListMainNum.Equals(_Second.ListMainNum));
 }