예제 #1
0
파일: DataBase.cs 프로젝트: adipaz/KanBan
 public DALBoards GetUserDALBoards(string email)
 {
     try
     {
         connection.Open();
         command             = new SQLiteCommand(null, connection);
         command.CommandText = "SELECT boardName FROM " + BOARDSTABLE + " WHERE email= @email";
         SQLiteParameter email_param = new SQLiteParameter(@"email", email);
         command.Parameters.Add(email_param);
         SQLiteDataReader reader = command.ExecuteReader();
         DALBoards        output = new DALBoards(email);
         string           boardName;
         while (reader.Read())
         {
             boardName = reader["boardName"].ToString();
             output.AddBoard(boardName);
             InitializedBoardsColumns(email, boardName, output);
         }
         return(output);
     }
     catch (Exception ex)
     {
         Console.WriteLine("Error");
         Console.WriteLine(ex.ToString());
     }
     finally
     {
         connection.Close();
     }
     return(null);
 }