Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
        private void InitializedBoardsColumns(string email, string boardName, DALBoards dalBoards)
        {
            SQLiteCommand c = new SQLiteCommand(null, connection);

            c.CommandText = "SELECT columnName FROM " + COLUMNSTABLE + " WHERE email= @email AND boardName= @boardName";
            SQLiteParameter email_param     = new SQLiteParameter(@"email", email);
            SQLiteParameter boardName_param = new SQLiteParameter(@"boardName", boardName);

            c.Parameters.Add(email_param);
            c.Parameters.Add(boardName_param);
            SQLiteDataReader reader = c.ExecuteReader();
            string           columnName;

            while (reader.Read())
            {
                columnName = reader["columnName"].ToString();
                dalBoards.GetBoards()[boardName].AddColumn(columnName);
                InitializedColumnsTasks(email, boardName, columnName, dalBoards);
            }
        }
Ejemplo n.º 3
0
        private void InitializedColumnsTasks(string email, string boardName, string columnName, DALBoards dalBoards)
        {
            SQLiteCommand c = new SQLiteCommand(null, connection);

            c.CommandText = "SELECT creationTime,dueDate,title,description FROM " + TASKSTABLE + " WHERE email= @email AND boardName= @boardName AND columnName= @columnName";
            SQLiteParameter email_param      = new SQLiteParameter(@"email", email);
            SQLiteParameter boardName_param  = new SQLiteParameter(@"boardName", boardName);
            SQLiteParameter columnName_param = new SQLiteParameter(@"columnName", columnName);

            c.Parameters.Add(email_param);
            c.Parameters.Add(boardName_param);
            c.Parameters.Add(columnName_param);
            SQLiteDataReader reader = c.ExecuteReader();

            while (reader.Read())
            {
                DALTask dalTask = new DALTask(reader["creationTime"].ToString(), reader["dueDate"].ToString(), reader["title"].ToString(), reader["description"].ToString());
                dalBoards.GetBoards()[boardName].GetColumnByName(columnName).Add(dalTask);
            }
        }