Exemplo n.º 1
0
        public oSeasons getSeasons(int leagueID)
        {
            oSeasons   collection = new oSeasons();
            StoredProc SP         = new StoredProc();

            SP.Name = "Seasons_select";
            SP.DataConnectionString = ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString;
            SP.ParameterSet         = new System.Data.SqlClient.SqlCommand();

            SP.ParameterSet.Parameters.AddWithValue("@leagueId", leagueID);

            DataSet ds = StoredProc.ShowMeTheData(SP);

            if (ds.Tables.Count == 0)
            {
                return(collection);
            }

            foreach (DataRow item in ds.Tables[0].Rows)
            {
                oSeason s = new oSeason
                {
                    ID   = item.Field <int>("seasonIndex"),
                    Year = item.Field <int>("seasonIndex")
                };
                collection.Add(s.ID, s);
            }


            return(collection);
        }
Exemplo n.º 2
0
        public PlayerAbilityRepository GetPlayerAbilities(int playerId)
        {
            var collection = new PlayerAbilityRepository();
            var sp         = new StoredProc
            {
                Name = "[GetPlayerAbilities]", DataConnectionString = ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString, ParameterSet = new SqlCommand()
            };

            sp.ParameterSet.Parameters.AddWithValue("@playerId", playerId);

            var ds = StoredProc.ShowMeTheData(sp);

            if (ds.Tables.Count == 0)
            {
                return(collection);
            }

            foreach (DataRow item in ds.Tables[0].Rows)
            {
                var a = new PlayerAbility
                {
                    Id                      = Helper.IntegerNull(item["signatureLogoId"]),
                    OvrThreshold            = Helper.IntegerNull(item["OvrThreshold"]),
                    IsEmpty                 = Helper.BooleanNull(item["isEmpty"]),
                    IsLocked                = Helper.BooleanNull(item["isLocked"]),
                    Title                   = Helper.StringNull(item["SignatureTitle"]),
                    Description             = Helper.StringNull(item["SignatureDescription"]),
                    ActivationDescription   = Helper.StringNull(item["SignatureActivationDescription"]),
                    DeactivationDescription = Helper.StringNull(item["SignatureDeactivationDescription"])
                };

                collection.Add(a.Id, a);
            }

            return(collection);
        }