Exemplo n.º 1
0
 public string GetPassword(string email)
 {
     return(Sql.ExecuteScalar <string>("User_GetPassword",
                                       new Dictionary <string, object>()
     {
         { "email", email }
     }
                                       ));
 }
Exemplo n.º 2
0
 public string GetEmail(int userId)
 {
     return(Sql.ExecuteScalar <string>("User_GetEmail",
                                       new Dictionary <string, object>()
     {
         { "userId", userId }
     }
                                       ));
 }
Exemplo n.º 3
0
 public string CreateAuthToken(int userId, int expireDays = 30)
 {
     return(Sql.ExecuteScalar <string>("User_CreateAuthToken",
                                       new Dictionary <string, object>()
     {
         { "userId", userId },
         { "expireDays", expireDays }
     }
                                       ));
 }
Exemplo n.º 4
0
 public bool MemberExists(int userId, int boardId)
 {
     return(Sql.ExecuteScalar <int>(
                "Board_MemberExists",
                new Dictionary <string, object>()
     {
         { "userId", userId },
         { "boardId", boardId }
     }
                ) == 1);
 }
Exemplo n.º 5
0
 public int CreateList(Models.List list)
 {
     return(Sql.ExecuteScalar <int>(
                "List_Create",
                new Dictionary <string, object>()
     {
         { "boardId", list.boardId },
         { "name", list.name },
         { "sort", list.sort }
     }
                ));
 }
Exemplo n.º 6
0
 public int Import(Models.List list, bool merge = false)
 {
     return(Sql.ExecuteScalar <int>(
                "List_Import",
                new Dictionary <string, object>()
     {
         { "boardId", list.boardId },
         { "name", list.name },
         { "sort", list.sort },
         { "merge", merge }
     }
                ));
 }
Exemplo n.º 7
0
 public int CreateUser(Models.User user)
 {
     return(Sql.ExecuteScalar <int>(
                "User_Create",
                new Dictionary <string, object>()
     {
         { "name", user.name },
         { "email", user.email },
         { "password", user.password },
         { "photo", user.photo }
     }
                ));
 }
Exemplo n.º 8
0
 public int CreateTeam(Models.Team team)
 {
     return(Sql.ExecuteScalar <int>(
                "Team_Create",
                new Dictionary <string, object>()
     {
         { "ownerId", team.ownerId },
         { "security", team.security },
         { "name", team.name },
         { "website", team.website },
         { "description", team.description }
     }
                ));
 }
Exemplo n.º 9
0
 public int CreateBoard(Models.Board board, int userId)
 {
     return(Sql.ExecuteScalar <int>(
                "Board_Create",
                new Dictionary <string, object>()
     {
         { "userId", userId },
         { "teamId", board.teamId },
         { "favorite", board.favorite },
         { "name", board.name },
         { "security", board.security },
         { "color", board.color }
     }
                ));
 }
Exemplo n.º 10
0
 public int Create(Models.Card card)
 {
     return(Sql.ExecuteScalar <int>(
                "Card_Create",
                new Dictionary <string, object>()
     {
         { "listId", card.listId },
         { "boardId", card.boardId },
         { "colors", card.colors },
         { "name", card.name },
         { "datedue", card.datedue == null ? DateTime.Now.AddYears(-100) : card.datedue },
         { "description", card.description }
     }
                ));
 }
Exemplo n.º 11
0
 public int Import(Models.Board board, int userId, bool merge = false)
 {
     return(Sql.ExecuteScalar <int>(
                "Board_Import",
                new Dictionary <string, object>()
     {
         { "userId", userId },
         { "teamId", board.teamId },
         { "favorite", board.favorite },
         { "name", board.name },
         { "security", board.security },
         { "color", board.color },
         { "merge", merge }
     }
                ));
 }
Exemplo n.º 12
0
 public int Import(Models.Card card, bool merge = false)
 {
     return(Sql.ExecuteScalar <int>(
                "Card_Import",
                new Dictionary <string, object>()
     {
         { "listId", card.listId },
         { "boardId", card.boardId },
         { "colors", card.colors },
         { "name", card.name },
         { "datedue", card.datedue == null ? DateTime.Now.AddYears(-100) : card.datedue },
         { "description", card.description },
         { "merge", merge }
     }
                ));
 }
Exemplo n.º 13
0
 public bool HasAdmin()
 {
     return(Sql.ExecuteScalar <int>("Users_HasAdmin") == 1);
 }
Exemplo n.º 14
0
 public bool HasPasswords()
 {
     return(Sql.ExecuteScalar <int>("Users_HasPasswords") == 1);
 }