Esempio n. 1
0
        public async Task <IEnumerable <Potato> > GetPotato(Potato currentUser)
        {
            var sql = "Select * from PotatoUsers where UserName = '******' and Password = '******'";

            using (var conn = DataConnectionProvider.GetProdConnection())
            {
                return(await conn.QueryAsync <Potato>(sql));
            }
        }
Esempio n. 2
0
        public async Task <IEnumerable <Leagues> > GetLeagues(Leagues league)
        {
            var sql = "SELECT * FROM [Leagues] WHERE (',' + RTRIM(MyColumn) + ',') LIKE '%,' + " + league.Id + " + ',%'";

            using (var conn = DataConnectionProvider.GetProdConnection())
            {
                return(await conn.QueryAsync <Leagues>(sql));
            }
        }
Esempio n. 3
0
        public async Task <IEnumerable <Scores> > GetScores(string id)
        {
            var sql = "SELECT * FROM [Scores] where Id in ('" + id + ")'";

            using (var conn = DataConnectionProvider.GetProdConnection())
            {
                return(await conn.QueryAsync <Scores>(sql));
            }
        }
Esempio n. 4
0
        public async Task <IEnumerable <Leagues> > CreateLeague(Leagues league)
        {
            var sql = "";

            using (var conn = DataConnectionProvider.GetProdConnection())
            {
                return(await conn.QueryAsync <Leagues>(sql));
            }
        }
Esempio n. 5
0
        public async Task <IEnumerable <Potato> > GetPotatos(string id)
        {
            var sql = "Select * from PotatoUsers where Id in ('" + id + "')";

            using (var conn = DataConnectionProvider.GetProdConnection())
            {
                return(await conn.QueryAsync <Potato>(sql));
            }
        }
Esempio n. 6
0
        public async Task <IEnumerable <Course> > GetCourseList(string state, string gender)
        {
            var sql = "select distinct  *  from [dbo].[UsaCourseList] where state = '" + state + "' and Gender = '" + gender + "' order by name asc";

            using (var conn = DataConnectionProvider.GetProdConnection())
            {
                return(await conn.QueryAsync <Course>(sql));
            }
        }
Esempio n. 7
0
        public async Task <IEnumerable <string> > GetStates()
        {
            var sql = "select distinct [State] from  [dbo].[UsaCourseList] where [state] is not null and LEN([state]) < 4 order by [state] asc ";

            using (var conn = DataConnectionProvider.GetProdConnection())
            {
                return(await conn.QueryAsync <string>(sql));
            }
        }
Esempio n. 8
0
        public async Task <IEnumerable <Potato> > GetLeaguePotato()
        {
            var sql = "select Id, Username, Email, FirstName, LastName from [dbo].[PotatoUsers]";

            using (var conn = DataConnectionProvider.GetProdConnection())
            {
                return(await conn.QueryAsync <Potato>(sql));
            }
        }
Esempio n. 9
0
 public MongoRepository()
 {
     try
     {
         var client = DataConnectionProvider.GetMongoClient();
         var db     = client.GetDatabase("TeamSix");
         _collection = db.GetCollection <T>(typeof(T).Name);
     }
     catch (Exception ex)
     {
     }
 }
Esempio n. 10
0
        public async Task <IEnumerable <Scores> > AddScore(Scores scores)
        {
            var sql = "INSERT INTO [dbo].[Scores]  ([UserId] ,[Score] ,[Course] ,[RoundDate])" +
                      "VALUES (" +
                      "'" + scores.UserId.Id + "'," +
                      "'" + scores.Score + "'," +
                      "'" + scores.Course.Name + "'," +
                      "'" + scores.RoundDate + "')";

            using (var conn = DataConnectionProvider.GetProdConnection())
            {
                return(await conn.QueryAsync <Scores>(sql));
            }
        }
Esempio n. 11
0
        public async Task <IEnumerable <Potato> > CreatePotato(Potato currentUser)
        {
            var sql = "INSERT INTO [dbo].[PotatoUsers]  ([UserName] ,[Password] ,[Email] ,[FirstName] ,[LastName])" +
                      "VALUES (" +
                      "'" + currentUser.UserName + "'," +
                      "'" + currentUser.Password + "'," +
                      "'" + currentUser.Email + "'," +
                      "'" + currentUser.FirstName + "'," +
                      "'" + currentUser.LastName + "')";

            using (var conn = DataConnectionProvider.GetProdConnection())
            {
                return(await conn.QueryAsync <Potato>(sql));
            }
        }