Ejemplo 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));
            }
        }
Ejemplo 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));
            }
        }
Ejemplo 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));
            }
        }
Ejemplo n.º 4
0
        public async Task <IEnumerable <Leagues> > CreateLeague(Leagues league)
        {
            var sql = "";

            using (var conn = DataConnectionProvider.GetProdConnection())
            {
                return(await conn.QueryAsync <Leagues>(sql));
            }
        }
Ejemplo 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));
            }
        }
Ejemplo 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));
            }
        }
Ejemplo 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));
            }
        }
Ejemplo 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));
            }
        }
Ejemplo 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)
     {
     }
 }
Ejemplo 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));
            }
        }
Ejemplo 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));
            }
        }