コード例 #1
0
        public GetBallCall(DateTime?PlayTime, string B4_Games, int AccountNumber, int BallCallCount, int GameNumber)
        {
            BallCall = string.Empty;
            SqlConnection sc = GetSQLConnection.get();

            try
            {
                sc.Open();
                using (SqlCommand cmd = new SqlCommand(@"exec usp_management_DisputeResolution_GetBallCall 
                                                        @spPlayTime = @PlayTime
                                                        ,@spB4Games = @B4_Games
                                                        ,@spAcctNumber = @AccountNumber 
                                                        ,@spBallCallCount = @BallCallCount
                                                      ,@spGameNumber = @GameNumber
                                                        ", sc))

                {
                    cmd.Parameters.AddWithValue("PlayTime", PlayTime);
                    cmd.Parameters.AddWithValue("B4_Games", B4_Games);
                    cmd.Parameters.AddWithValue("AccountNumber", AccountNumber);
                    cmd.Parameters.AddWithValue("BallCallCount", BallCallCount);
                    cmd.Parameters.AddWithValue("GameNumber", GameNumber);

                    SqlDataReader reader = cmd.ExecuteReader();
                    while (reader.Read())
                    {
                        BallCall = reader.GetString(0);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                sc.Close();
            }
        }
コード例 #2
0
        public static bool IsPasswordCorrect_(string password)
        {
            SqlConnection sc = GetSQLConnection.get();

            sc.Open();
            bool IsPasswordCorrect = false;

            using (SqlCommand cmd = new SqlCommand(@"select count(*) 
                    from dbo.B3_Login 
                    where UserName = @UserName and 
                    [UserPassword] COLLATE SQL_Latin1_General_CP1_CS_AS = @UserPassword", sc))//Password is case sensitive
            {
                cmd.Parameters.AddWithValue("UserName", CurrentUserLogged.LoggedUser);
                cmd.Parameters.AddWithValue("UserPassword", password);
                IsPasswordCorrect = (int)cmd.ExecuteScalar() == 1;
                //Having issue with case sensitivity
            }



            sc.Close();
            return(IsPasswordCorrect);
        }
コード例 #3
0
        public string Get()
        {
            SqlConnection sc = GetSQLConnection.get();

            sc.Open();
            try
            {
                using (SqlCommand cmd = new SqlCommand(@"select UserPassword from dbo.B3_Login where UserName = @UserName", sc))
                {
                    cmd.Parameters.AddWithValue("UserName", CurrentUserLogged.LoggedUser);
                    UserPassword = cmd.ExecuteScalar().ToString();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                sc.Close();
            }

            return(UserPassword);
        }
コード例 #4
0
        //public static bool NDSettingsPermission(int LoginID)
        //{
        //    SqlConnection sc2 = GetSQLConnection.get();
        //    string sqlResult = "F";
        //    try
        //    {
        //        sc2.Open();//a select command that will return char or string
        //        using (SqlCommand cmd = new SqlCommand("select [ND Settings] from [dbo].[B3_Login] where LoginID =  @LoginID", sc2))
        //        {
        //            cmd.Parameters.AddWithValue("@LoginID", LoginID);
        //            sqlResult = cmd.ExecuteScalar().ToString();
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        MessageBox.Show(ex.Message);
        //    }
        //    finally
        //    {
        //        sc2.Close();
        //    }

        //    bool result = false;
        //    if (sqlResult == "T")
        //    {
        //        result = true;
        //    }
        //    else
        //    {
        //        result = false;
        //    }

        //    return result;
        //}

        public static bool UserAccessPermission(int LoginID)
        {
            SqlConnection sc2       = GetSQLConnection.get();
            string        sqlResult = "F";

            try
            {
                sc2.Open();//a select command that will return char or string
                using (SqlCommand cmd = new SqlCommand("select PermitClientAccessControl from [dbo].[B3_Login] where LoginID =  @LoginID", sc2))
                {
                    cmd.Parameters.AddWithValue("@LoginID", LoginID);
                    sqlResult = cmd.ExecuteScalar().ToString();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                sc2.Close();
            }

            bool result = false;

            if (sqlResult == "T")
            {
                result = true;
            }
            else
            {
                result = false;
            }

            return(result);
        }
コード例 #5
0
        public static bool getDualAccountSettings()
        {
            SqlConnection sc = GetSQLConnection.get();

            sc.Open();
            string result = "";

            try
            {
                using (SqlCommand cmd = new SqlCommand(@"select doubleaccount from [dbo].[B3_SystemConfig]", sc))
                {
                    result = (string)cmd.ExecuteScalar();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                sc.Close();
            }

            bool returnValue;

            if (result == "T")
            {
                returnValue = true;
            }
            else
            {
                returnValue = false;
            }
            DualAccountSettings = returnValue;
            return(returnValue);
        }
コード例 #6
0
        public SetGameSettings()
        {
            SqlConnection sc = GetSQLConnection.get();

            try
            {
                sc.Open();
                using (SqlCommand cmd = new SqlCommand(@"exec usp_SystemSetting_b3_Game_Set
                                                        @spMinPlayer ,
                                                        @spConsolationPrize ,
                                                        @spCountdownTimer
                                                        ,@spGamePasswordRecall
                                                        ,@spWaitCountdownTimerForOtherPlayers
                                                        ,@handpayByPattern
                                                        ,@rfRequiredForPlay"
                                                       , sc))
                {
                    cmd.Parameters.AddWithValue("spMinPlayer", GetGameSettings.MinNumberOfPlayers);
                    cmd.Parameters.AddWithValue("spConsolationPrize", GetGameSettings.ConsolationPrize); //GetSecuritySettings.PrevPasswordReuseN);
                    cmd.Parameters.AddWithValue("spCountdownTimer", GetGameSettings.CountDownTimer);     //GetSecuritySettings.PrevPasswordLockoutAttempts);
                    cmd.Parameters.AddWithValue("spGamePasswordRecall", GetGameSettings.GameRecalPasswords);
                    cmd.Parameters.AddWithValue("spWaitCountdownTimerForOtherPlayers", GetGameSettings.WaitCountDownForOtherPLayers);
                    cmd.Parameters.AddWithValue("handpayByPattern", GetGameSettings.HandpayByPattern);
                    cmd.Parameters.AddWithValue("rfRequiredForPlay", GetGameSettings.RfRequiredForPlay);
                    cmd.ExecuteNonQuery(); //or you could try this if did not work
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                sc.Close();
            }
        }
コード例 #7
0
        public static bool IWC_(string NDubbed)
        {
            SqlConnection sc = GetSQLConnection.get();

            sc.Open();
            bool result = false;
            bool _result;


            if (result == false)
            {
                foreach (string patterns in TinyPyramid)
                {
                    _result = false;
                    using (SqlCommand cmd = new SqlCommand(@"select dbo.b3_fnCheckCardIfWin(@DubbedN, @Pattern)", sc))
                    {
                        cmd.Parameters.AddWithValue("DubbedN", NDubbed);
                        cmd.Parameters.AddWithValue("Pattern", patterns);
                        _result = Convert.ToBoolean(cmd.ExecuteScalar());
                    }

                    if (_result == true)
                    {
                        if (WinPattern.Length > 1)
                        {
                            WinPattern = WinPattern + " ,Tiny Pyramid";
                        }
                        else
                        {
                            WinPattern = WinPattern + "Tiny Pyramid";
                        }
                        result = _result;
                        // break;
                    }
                }
            }


            if (result == false)
            {
                foreach (string patterns in AnyLines)
                {
                    _result = false;
                    using (SqlCommand cmd = new SqlCommand(@"select dbo.b3_fnCheckCardIfWin(@DubbedN, @Pattern)", sc))
                    {
                        cmd.Parameters.AddWithValue("DubbedN", NDubbed);
                        cmd.Parameters.AddWithValue("Pattern", patterns);
                        _result = Convert.ToBoolean(cmd.ExecuteScalar());
                    }
                    if (_result == true)
                    {
                        if (WinPattern.Length > 1)
                        {
                            WinPattern = WinPattern + " ,Any Line";
                        }
                        else
                        {
                            WinPattern = WinPattern + "Any Line";
                        }
                        result = _result;
                        //  break;
                    }
                }
            }

            if (result == false)
            {
                foreach (string patterns in CrazyStamps)
                {
                    _result = false;
                    using (SqlCommand cmd = new SqlCommand(@"select dbo.b3_fnCheckCardIfWin(@DubbedN, @Pattern)", sc))
                    {
                        cmd.Parameters.AddWithValue("DubbedN", NDubbed);
                        cmd.Parameters.AddWithValue("Pattern", patterns);
                        _result = Convert.ToBoolean(cmd.ExecuteScalar());
                    }

                    if (_result == true)
                    {
                        if (WinPattern.Length > 1)
                        {
                            WinPattern = WinPattern + " ,Crazy Stamp";
                        }
                        else
                        {
                            WinPattern = WinPattern + "Crazy Stamp";
                        }
                        result = _result;
                        //   break;
                    }
                }
            }

            if (result == false)
            {
                ASP asp = new ASP();
                foreach (string patterns in AnySixPack)
                {
                    _result = false;
                    using (SqlCommand cmd = new SqlCommand(@"select dbo.b3_fnCheckCardIfWin(@DubbedN, @Pattern)", sc))
                    {
                        cmd.Parameters.AddWithValue("DubbedN", NDubbed);
                        cmd.Parameters.AddWithValue("Pattern", patterns);
                        _result = Convert.ToBoolean(cmd.ExecuteScalar());
                    }

                    if (_result == true)
                    {
                        if (WinPattern.Length > 1)
                        {
                            WinPattern = WinPattern + " ,Any Six Pack";
                        }
                        else
                        {
                            WinPattern = WinPattern + "Any Sick Pack";
                        }
                        result = _result;
                        // break;
                    }
                }
            }


            if (result == false)
            {
                foreach (string patterns in FourCorners)
                {
                    _result = false;
                    using (SqlCommand cmd = new SqlCommand(@"select dbo.b3_fnCheckCardIfWin(@DubbedN, @Pattern)", sc))
                    {
                        cmd.Parameters.AddWithValue("DubbedN", NDubbed);
                        cmd.Parameters.AddWithValue("Pattern", patterns);
                        _result = Convert.ToBoolean(cmd.ExecuteScalar());
                    }

                    if (_result == true)
                    {
                        if (WinPattern.Length > 1)
                        {
                            WinPattern = WinPattern + " ,Four Corners";
                        }
                        else
                        {
                            WinPattern = WinPattern + "Four Corners";
                        }
                        result = _result;
                        //   break;
                    }
                }
            }

            if (result == false)
            {
                foreach (string patterns in SmallX)
                {
                    _result = false;
                    using (SqlCommand cmd = new SqlCommand(@"select dbo.b3_fnCheckCardIfWin(@DubbedN, @Pattern)", sc))
                    {
                        cmd.Parameters.AddWithValue("DubbedN", NDubbed);
                        cmd.Parameters.AddWithValue("Pattern", patterns);
                        _result = Convert.ToBoolean(cmd.ExecuteScalar());
                    }

                    if (_result == true)
                    {
                        if (WinPattern.Length > 1)
                        {
                            WinPattern = WinPattern + " ,Small X";
                        }
                        else
                        {
                            WinPattern = WinPattern + "Small X";
                        }
                        result = _result;
                        //  break;
                    }
                }
            }

            if (result == false)
            {
                foreach (string patterns in Flower)
                {
                    _result = false;
                    using (SqlCommand cmd = new SqlCommand(@"select dbo.b3_fnCheckCardIfWin(@DubbedN, @Pattern)", sc))
                    {
                        cmd.Parameters.AddWithValue("DubbedN", NDubbed);
                        cmd.Parameters.AddWithValue("Pattern", patterns);
                        _result = Convert.ToBoolean(cmd.ExecuteScalar());
                    }

                    if (_result == true)
                    {
                        if (WinPattern.Length > 1)
                        {
                            WinPattern = WinPattern + " ,Flower";
                        }
                        else
                        {
                            WinPattern = WinPattern + "Flower";
                        }
                        result = _result;
                        //     break;
                    }
                }
            }

            if (result == false)
            {
                foreach (string patterns in Star)
                {
                    _result = false;
                    using (SqlCommand cmd = new SqlCommand(@"select dbo.b3_fnCheckCardIfWin(@DubbedN, @Pattern)", sc))
                    {
                        cmd.Parameters.AddWithValue("DubbedN", NDubbed);
                        cmd.Parameters.AddWithValue("Pattern", patterns);
                        _result = Convert.ToBoolean(cmd.ExecuteScalar());
                    }

                    if (_result == true)
                    {
                        if (WinPattern.Length > 1)
                        {
                            WinPattern = WinPattern + " ,Star";
                        }
                        else
                        {
                            WinPattern = WinPattern + "Star";
                        }
                        result = _result;
                        //  break;
                    }
                }
            }

            if (result == false)
            {
                Pyramid_ p = new Pyramid_();
                foreach (string patterns in Pyramid)
                {
                    _result = false;
                    using (SqlCommand cmd = new SqlCommand(@"select dbo.b3_fnCheckCardIfWin(@DubbedN, @Pattern)", sc))
                    {
                        cmd.Parameters.AddWithValue("DubbedN", NDubbed);
                        cmd.Parameters.AddWithValue("Pattern", patterns);
                        _result = Convert.ToBoolean(cmd.ExecuteScalar());
                    }

                    if (_result == true)
                    {
                        if (WinPattern.Length > 1)
                        {
                            WinPattern = WinPattern + " ,Pyramid";
                        }
                        else
                        {
                            WinPattern = WinPattern + "Pyramid";
                        }
                        result = _result;
                        //   break;
                    }
                }
            }

            if (result == false)
            {
                foreach (string patterns in Steps)
                {
                    _result = false;
                    using (SqlCommand cmd = new SqlCommand(@"select dbo.b3_fnCheckCardIfWin(@DubbedN, @Pattern)", sc))
                    {
                        cmd.Parameters.AddWithValue("DubbedN", NDubbed);
                        cmd.Parameters.AddWithValue("Pattern", patterns);
                        _result = Convert.ToBoolean(cmd.ExecuteScalar());
                    }

                    if (_result == true)
                    {
                        if (WinPattern.Length > 1)
                        {
                            WinPattern = WinPattern + " ,Steps";
                        }
                        else
                        {
                            WinPattern = WinPattern + "Steps";
                        }
                        result = _result;
                        //    break;
                    }
                }
            }

            if (result == false)
            {
                foreach (string patterns in Sun)
                {
                    _result = false;
                    using (SqlCommand cmd = new SqlCommand(@"select dbo.b3_fnCheckCardIfWin(@DubbedN, @Pattern)", sc))
                    {
                        cmd.Parameters.AddWithValue("DubbedN", NDubbed);
                        cmd.Parameters.AddWithValue("Pattern", patterns);
                        _result = Convert.ToBoolean(cmd.ExecuteScalar());
                    }

                    if (_result == true)
                    {
                        if (WinPattern.Length > 1)
                        {
                            WinPattern = WinPattern + " ,Sun";
                        }
                        else
                        {
                            WinPattern = WinPattern + "Sun";
                        }
                        result = _result;
                        // break;
                    }
                }
            }

            if (result == false)
            {
                foreach (string patterns in GreatPyramid)
                {
                    _result = false;
                    using (SqlCommand cmd = new SqlCommand(@"select dbo.b3_fnCheckCardIfWin(@DubbedN, @Pattern)", sc))
                    {
                        cmd.Parameters.AddWithValue("DubbedN", NDubbed);
                        cmd.Parameters.AddWithValue("Pattern", patterns);
                        _result = Convert.ToBoolean(cmd.ExecuteScalar());
                    }

                    if (_result == true)
                    {
                        if (WinPattern.Length > 1)
                        {
                            WinPattern = WinPattern + " ,Great Pyramid";
                        }
                        else
                        {
                            WinPattern = WinPattern + "Great Pyramid";
                        }
                        result = _result;
                        //   break;
                    }
                }
            }


            Result = result;
            return(result);
        }
コード例 #8
0
        public SetGameSettingsCrazyBout()
        {
            SqlConnection sc = GetSQLConnection.get();

            try
            {
                sc.Open();
                using (SqlCommand cmd = new SqlCommand(@"Exec usp_GameSettings_CrazyBout_Set
                                                         @spmaxcards 
                                                        ,@spmaxbetlevel 
                                                        ,@spmaxpatterns 
                                                        ,@spmaxcalls 
                                                        ,@spmaxpatterns_bonus 
                                                        ,@spmaxcalls_bonus 
                                                        ,@spcallspeed_min 
                                                        ,@spcallspeed_max 
                                                        ,@spautocall 
                                                        ,@spautoplay 
                                                        ,@spdenom_1 
                                                        ,@spdenom_5 
                                                        ,@spdenom_10 
                                                        ,@spdenom_25 
                                                        ,@spdenom_50 
                                                        ,@spdenom_100 
                                                        ,@spdenom_200 
                                                        ,@spdenom_500 
                                                        ,@spsingleoffer_bonus 
                                                        ,@sphidecardserialnum "
                                                       , sc))
                {
                    cmd.Parameters.AddWithValue("spmaxcards", GetGameSettingsCrazyBout.maxcards);
                    cmd.Parameters.AddWithValue("spmaxbetlevel", GetGameSettingsCrazyBout.maxbetlevel);
                    cmd.Parameters.AddWithValue("spmaxpatterns", GetGameSettingsCrazyBout.maxpatterns);
                    cmd.Parameters.AddWithValue("spmaxcalls", GetGameSettingsCrazyBout.maxcalls);
                    cmd.Parameters.AddWithValue("spmaxpatterns_bonus", GetGameSettingsCrazyBout.maxpatterns_bonus);
                    cmd.Parameters.AddWithValue("spmaxcalls_bonus", GetGameSettingsCrazyBout.maxcalls_bonus);
                    cmd.Parameters.AddWithValue("spcallspeed_min", GetGameSettingsCrazyBout.callspeed_min);
                    cmd.Parameters.AddWithValue("spcallspeed_max", GetGameSettingsCrazyBout.callspeed_max);
                    cmd.Parameters.AddWithValue("spautocall", GetGameSettingsCrazyBout.autocall);
                    cmd.Parameters.AddWithValue("spautoplay ", GetGameSettingsCrazyBout.autoplay);
                    cmd.Parameters.AddWithValue("spdenom_1", GetGameSettingsCrazyBout.denom_1);
                    cmd.Parameters.AddWithValue("spdenom_5", GetGameSettingsCrazyBout.denom_5);
                    cmd.Parameters.AddWithValue("spdenom_10", GetGameSettingsCrazyBout.denom_10);
                    cmd.Parameters.AddWithValue("spdenom_25", GetGameSettingsCrazyBout.denom_25);
                    cmd.Parameters.AddWithValue("spdenom_50", GetGameSettingsCrazyBout.denom_50);
                    cmd.Parameters.AddWithValue("spdenom_100", GetGameSettingsCrazyBout.denom_100);
                    cmd.Parameters.AddWithValue("spdenom_200", GetGameSettingsCrazyBout.denom_200);
                    cmd.Parameters.AddWithValue("spdenom_500", GetGameSettingsCrazyBout.denom_500);
                    cmd.Parameters.AddWithValue("spsingleoffer_bonus", GetGameSettingsCrazyBout.singleofferbonus);
                    cmd.Parameters.AddWithValue("sphidecardserialnum", GetGameSettingsCrazyBout.hidecardserialnum);
                    cmd.ExecuteNonQuery();
                    //cmd.ExecuteNonQuery(); //or you could try this if did not work
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                sc.Close();
            }
        }
コード例 #9
0
        public GetNWinningPattern(int AccountNumber, DateTime?recdatetime, string gameName, int WinAmount)
        {
            SqlConnection sc = GetSQLConnection.get();

            if (gameName != "TimeBomb")
            {
                try
                {
                    sc.Open();

                    using (SqlCommand cmd = new SqlCommand(@"select 
                                                        numofwins_patt_1
                                                        ,numofwins_patt_2 
                                                        ,numofwins_patt_3 
                                                        ,numofwins_patt_4 
                                                        ,numofwins_patt_5 
                                                        ,numofwins_patt_6 
                                                        ,numofwins_patt_7 
                                                        ,numofwins_patt_8 
                                                        ,numofwins_patt_9 
                                                        ,numofwins_patt_10 
                                                        ,numofwins_patt_11 
                                                        ,numofwins_patt_12 
                                                        from dbo." + gameName + @"_GameJournal where creditacctnum = @creditacctnum and recdatetime = @recdatetime", sc))
                    {
                        cmd.Parameters.AddWithValue("creditacctnum", AccountNumber);
                        cmd.Parameters.AddWithValue("recdatetime", recdatetime);

                        SqlDataReader reader = cmd.ExecuteReader();
                        while (reader.Read())
                        {
                            Pattern_Num_1  = reader.GetInt32(11);
                            Pattern_Num_2  = reader.GetInt32(10);
                            Pattern_Num_3  = reader.GetInt32(9);
                            Pattern_Num_4  = reader.GetInt32(8);
                            Pattern_Num_5  = reader.GetInt32(7);
                            Pattern_Num_6  = reader.GetInt32(6);
                            Pattern_Num_7  = reader.GetInt32(5);
                            Pattern_Num_8  = reader.GetInt32(4);
                            Pattern_Num_9  = reader.GetInt32(3);
                            Pattern_Num_10 = reader.GetInt32(2);
                            Pattern_Num_11 = reader.GetInt32(1);
                            Pattern_Num_12 = reader.GetInt32(0);
                            if (GetGameSettings.MinNumberOfPlayers > 1)
                            {
                                Pattern_Num_13 = WinAmount / GetGameSettings.ConsolationPrize;
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
                finally
                {
                    sc.Close();
                }
            }
            else
            {
                try
                {
                    sc.Open();

                    using (SqlCommand cmd = new SqlCommand(@"select 
                                                        numofwins_patt_1
                                                        ,numofwins_patt_2 
                                                        ,numofwins_patt_3 
                                                        ,numofwins_patt_4 
                                                        ,numofwins_patt_5 
                                                        ,numofwins_patt_6 
                                                        from dbo." + gameName + @"_GameJournal where creditacctnum = @creditacctnum and recdatetime = @recdatetime", sc))
                    {
                        cmd.Parameters.AddWithValue("creditacctnum", AccountNumber);
                        cmd.Parameters.AddWithValue("recdatetime", recdatetime);

                        SqlDataReader reader = cmd.ExecuteReader();
                        while (reader.Read())
                        {
                            Pattern_Num_1 = reader.GetInt32(5);
                            Pattern_Num_2 = reader.GetInt32(4);
                            Pattern_Num_3 = reader.GetInt32(3);
                            Pattern_Num_4 = reader.GetInt32(2);
                            Pattern_Num_5 = reader.GetInt32(1);
                            Pattern_Num_6 = reader.GetInt32(0);
                            if (GetGameSettings.MinNumberOfPlayers > 1)
                            {
                                Pattern_Num_13 = WinAmount / GetGameSettings.ConsolationPrize;
                            }
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
                finally
                {
                    sc.Close();
                }
            }
        }
コード例 #10
0
        public static void GetNBonusWinningPattern(int AccountNumber, DateTime?recdatetime, string gameName)
        {
            SqlConnection sc = GetSQLConnection.get();

            try
            {
                sc.Open();
                using (SqlCommand cmd = new SqlCommand(@"select 
                                                        numofwins_bonuspatt_1
                                                        ,numofwins_bonuspatt_2 
                                                        ,numofwins_bonuspatt_3 
                                                        ,numofwins_bonuspatt_4 
                                                        ,numofwins_bonuspatt_5 
                                                        ,numofwins_bonuspatt_6 
                                                        ,numofwins_bonuspatt_7 
                                                        ,numofwins_bonuspatt_8 
                                                        ,numofwins_bonuspatt_9 
                                                        ,numofwins_bonuspatt_10 
                                                        ,numofwins_bonuspatt_11 
                                                        ,numofwins_bonuspatt_12 
                                                        from dbo." + gameName + @"_GameJournal where creditacctnum = @creditacctnum and recdatetime = @recdatetime", sc))
                {
                    cmd.Parameters.AddWithValue("creditacctnum", AccountNumber);
                    cmd.Parameters.AddWithValue("recdatetime", recdatetime);

                    SqlDataReader reader = cmd.ExecuteReader();
                    while (reader.Read())
                    {
                        //Pattern_Num_1 = reader.GetInt32(0);
                        //Pattern_Num_2 = reader.GetInt32(1);
                        //Pattern_Num_3 = reader.GetInt32(2);
                        //Pattern_Num_4 = reader.GetInt32(3);
                        //Pattern_Num_5 = reader.GetInt32(4);
                        //Pattern_Num_6 = reader.GetInt32(5);
                        //Pattern_Num_7 = reader.GetInt32(6);
                        //Pattern_Num_8 = reader.GetInt32(7);
                        //Pattern_Num_9 = reader.GetInt32(8);
                        //Pattern_Num_10 = reader.GetInt32(9);
                        //Pattern_Num_11 = reader.GetInt32(10);
                        //Pattern_Num_12 = reader.GetInt32(11);

                        Pattern_Num_1  = reader.GetInt32(11);
                        Pattern_Num_2  = reader.GetInt32(10);
                        Pattern_Num_3  = reader.GetInt32(9);
                        Pattern_Num_4  = reader.GetInt32(8);
                        Pattern_Num_5  = reader.GetInt32(7);
                        Pattern_Num_6  = reader.GetInt32(6);
                        Pattern_Num_7  = reader.GetInt32(5);
                        Pattern_Num_8  = reader.GetInt32(4);
                        Pattern_Num_9  = reader.GetInt32(3);
                        Pattern_Num_10 = reader.GetInt32(2);
                        Pattern_Num_11 = reader.GetInt32(1);
                        Pattern_Num_12 = reader.GetInt32(0);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                sc.Close();
            }
        }
コード例 #11
0
        public GetInfo
            (int AccountNumber
            , DateTime?PlayTime
            , int Status
            , string B4_Games
            , int GameStartNum
            , int GameEndNum
            , string IsGameNumber)
        {
            SqlConnection sc = GetSQLConnection.get();

            try
            {
                sc.Open();
                using (SqlCommand cmd = new SqlCommand(@"exec usp_management_DisputeResolution_GetInfo 
                                                        @spAcctNumber = @AccountNumber
                                                        ,@spPlayTime = @PlayTime 
                                                        ,@spStatus = @Status 
                                                        ,@spB4Games = @B4Games  
                                                        ,@spGameStartNum =  @GameStartNum        
                                                        ,@spGameEndNum = @GameEndNum
                                                        ,@spIsGameNumber = @IsGameNumber
                                                        ", sc))
                {
                    cmd.Parameters.AddWithValue("AccountNumber", AccountNumber);
                    if (PlayTime == null)
                    {
                        SqlDateTime PlayTime2 = SqlDateTime.Null;
                        cmd.Parameters.AddWithValue("Playtime", PlayTime2);
                    }
                    else
                    {
                        cmd.Parameters.AddWithValue("Playtime", PlayTime);
                    }
                    cmd.Parameters.AddWithValue("Status", Status);
                    if (B4_Games == string.Empty)
                    {
                        SqlString B4Games2 = SqlString.Null;
                        cmd.Parameters.AddWithValue("B4Games", B4Games2);
                    }
                    else
                    {
                        cmd.Parameters.AddWithValue("B4Games", B4_Games);
                    }
                    cmd.Parameters.AddWithValue("GameStartNum", GameStartNum);
                    cmd.Parameters.AddWithValue("GameEndNum", GameEndNum);
                    cmd.Parameters.AddWithValue("IsGameNumber", IsGameNumber);

                    SqlDataReader reader = cmd.ExecuteReader();
                    while (reader.Read())
                    {
                        mDateTimePlay         = reader.GetDateTime(0);
                        mB4Games              = reader.GetString(1);
                        mStartingCrdAmnt      = reader.GetInt32(2);
                        mEndingCrdAmnt        = reader.GetInt32(3);
                        mWinAmount            = reader.GetInt32(4);
                        mBonusWinAmount       = reader.GetInt32(5);
                        mBetAmount            = reader.GetInt32(6);
                        mBetLevel             = reader.GetInt32(7);
                        mBetDenom             = reader.GetInt32(8);
                        mBallCount            = reader.GetInt32(9);
                        mGameNumber           = reader.GetInt32(10);
                        mFirstCardNumber      = reader.GetInt32(11);
                        mLastCardNumber       = reader.GetInt32(12);
                        mFirstBonusCardNumber = reader.GetInt32(13);
                        mLastBonusCardNumber  = reader.GetInt32(14);
                        mBonusBallCount       = reader.GetInt32(15);
                        mBonusOfferAccepted   = reader.GetInt32(16);
                        if (!reader.IsDBNull(17))
                        {
                            mServerGameNumber = reader.GetInt32(17);
                        }
                        mIsBonusGameInProgress = reader.GetInt32(18);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                sc.Close();
            }
        }