private void AddUpdateButtonClick(object sender, RoutedEventArgs e)
        {
            if (updateText != null)
            {
                DataHandling.UpdateTask(selectedTask);
                DataHandling.AddTaskUpdate(selectedTaskID, addUpdateTextBox.Text);

                DataStructures.NotificationStruct notificationStruct = new DataStructures.NotificationStruct();
                notificationStruct.notificationSender     = Application.Current.Properties["username"].ToString();
                notificationStruct.notificationText       = "[" + selectedTask.taskName + "]: " + addUpdateTextBox.Text;
                notificationStruct.taskID                 = selectedTaskID;
                notificationStruct.notificationTime       = DateTime.Now;
                notificationStruct.notificationRecipients = selectedTask.notifyUsers;

                DataHandling.AddNotification(notificationStruct);

                DataHandling.GetTasksFull();

                int taskIndex = 0;

                foreach (DataStructures.TaskRowStruct task in DataStructures.taskRows)
                {
                    if (task.taskName.Equals(selectedTask.taskName))
                    {
                        taskIndex = DataStructures.taskRows.IndexOf(task);
                    }
                }

                ViewTaskWindow updatedTask = new ViewTaskWindow(DataStructures.taskRows[taskIndex]);
                updatedTask.Show();
                Close();
            }
        }
        //Shows Task List Tab
        private void TaskListButtonClick(object sender, RoutedEventArgs e)
        {
            TaskListBorder.BorderBrush = (SolidColorBrush) new BrushConverter().ConvertFrom("#FFFF4F5A");
            CalendarBorder.BorderBrush = (SolidColorBrush) new BrushConverter().ConvertFrom("#FF51545D");
            HomeBorder.BorderBrush     = (SolidColorBrush) new BrushConverter().ConvertFrom("#FF51545D");
            CalendarGrid.Visibility    = Visibility.Hidden;
            TaskListGrid.Visibility    = Visibility.Visible;
            HomeGrid.Visibility        = Visibility.Hidden;

            DataHandling.GetTasksFull();
        }
        public MainWindow()
        {
            Application.Current.Resources.Add("taskrows", DataStructures.taskRows);

            InitializeComponent();

            //Sets initial GUI state
            HomeBorder.BorderBrush     = (SolidColorBrush) new BrushConverter().ConvertFrom("#FFFF4F5A");
            CalendarBorder.BorderBrush = (SolidColorBrush) new BrushConverter().ConvertFrom("#FF51545D");
            TaskListBorder.BorderBrush = (SolidColorBrush) new BrushConverter().ConvertFrom("#FF51545D");
            HomeGrid.Visibility        = Visibility.Visible;
            CalendarGrid.Visibility    = Visibility.Hidden;
            TaskListGrid.Visibility    = Visibility.Hidden;

            username = null;
            forename = null;
            surname  = null;

            DataHandling.GetUsers();


            System.Windows.Application.Current.Resources["BlurEffectRadius"] = (double)10;

            //Opens new Log In Window
            LogInWindow logIn = new LogInWindow();

            logIn.ShowDialog();

            foreach (String username in Properties.Settings.Default.UsernamesStringCollection)
            {
                Console.WriteLine(username);
            }

            foreach (String name in Properties.Settings.Default.UsersStringCollection)
            {
                Console.WriteLine(name);
            }

            mainWorkflowPlusAll = Properties.Settings.Default.MainWorkflow;
            mainWorkflowPlusAll.Add("All");

            refreshTimer.Interval = new TimeSpan(0, 0, 20);
            refreshTimer.Tick    += new EventHandler(RefreshTimerTick);
            refreshTimer.Start();

            InitialiseCalendar();
            LoadTasksIntoCalendar();
        }
        private void AddUpdateKeyPressed(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                if (Keyboard.Modifiers == ModifierKeys.Shift)
                {
                    int ci = addUpdateTextBox.CaretIndex;
                    addUpdateTextBox.Text      += Environment.NewLine;
                    addUpdateTextBox.CaretIndex = ci + 1;
                }
                else
                {
                    if (updateText != null)
                    {
                        DataHandling.UpdateTask(selectedTask);
                        DataHandling.AddTaskUpdate(selectedTaskID, addUpdateTextBox.Text);

                        DataStructures.NotificationStruct notificationStruct = new DataStructures.NotificationStruct();
                        notificationStruct.notificationSender     = Application.Current.Properties["username"].ToString();
                        notificationStruct.notificationText       = "[" + selectedTask.taskName + "]: " + addUpdateTextBox.Text;
                        notificationStruct.taskID                 = selectedTaskID;
                        notificationStruct.notificationTime       = DateTime.Now;
                        notificationStruct.notificationRecipients = selectedTask.notifyUsers;

                        DataHandling.AddNotification(notificationStruct);

                        DataHandling.GetTasksFull();

                        int taskIndex = 0;

                        foreach (DataStructures.TaskRowStruct task in DataStructures.taskRows)
                        {
                            if (task.taskName.Equals(selectedTask.taskName))
                            {
                                taskIndex = DataStructures.taskRows.IndexOf(task);
                            }
                        }

                        ViewTaskWindow updatedTask = new ViewTaskWindow(DataStructures.taskRows[taskIndex]);
                        updatedTask.Show();
                        Close();
                    }
                }
            }
        }
        private void InitUpdateRows()
        {
            selectedTaskID = DataHandling.GetTaskID(selectedTask.taskName, selectedTask.details);
            noOfUpdates    = DataHandling.GetTaskUpdates(selectedTaskID);

            for (int i = 0; i < noOfUpdates; i++)
            {
                RowDefinition updateRow = new RowDefinition();
                updateRow.Height = new GridLength(100, GridUnitType.Auto);
                TaskDetailsGrid.RowDefinitions.Add(updateRow);

                string updateHeaderString = DataStructures.updateRows[i].updatedBy + " at " + DataStructures.updateRows[i].updateTimeDate.ToString("HH:mm dd/MM/yyyy")
                                            + ": ";
                string updateContentString = DataStructures.updateRows[i].updateDetails;

                TextBlock updateHeaderTextBlock = new TextBlock();
                updateHeaderTextBlock.Text       = updateHeaderString;
                updateHeaderTextBlock.Foreground = (SolidColorBrush) new BrushConverter().ConvertFrom("#FFFF4F5A");
                updateHeaderTextBlock.Margin     = new Thickness(0, 10, 0, 10);
                updateHeaderTextBlock.FontSize   = 12;

                TextBlock updateContentTextBlock = new TextBlock();
                updateContentTextBlock.Text         = updateContentString;
                updateContentTextBlock.Foreground   = (SolidColorBrush) new BrushConverter().ConvertFrom("#FF51545D");
                updateContentTextBlock.Margin       = new Thickness(20, 30, 20, 10);
                updateContentTextBlock.FontSize     = 14;
                updateContentTextBlock.TextWrapping = TextWrapping.Wrap;

                Rectangle divider = new Rectangle();
                divider.Width               = 470;
                divider.Height              = 1;
                divider.Fill                = (SolidColorBrush) new BrushConverter().ConvertFrom("#FF51545D");
                divider.Stroke              = (SolidColorBrush) new BrushConverter().ConvertFrom("#FF51545D");
                divider.Margin              = new Thickness(20, 0, 0, 0);
                divider.VerticalAlignment   = VerticalAlignment.Top;
                divider.HorizontalAlignment = HorizontalAlignment.Left;

                Grid.SetRow(divider, i + 1);
                Grid.SetRow(updateHeaderTextBlock, i + 1);
                Grid.SetRow(updateContentTextBlock, i + 1);
                TaskDetailsGrid.Children.Add(divider);
                TaskDetailsGrid.Children.Add(updateHeaderTextBlock);
                TaskDetailsGrid.Children.Add(updateContentTextBlock);
            }
        }
Exemplo n.º 6
0
        private void EditTaskButtonClick(object sender, RoutedEventArgs e)
        {
            int taskID = DataHandling.GetTaskID(selectedTask.taskName, selectedTask.details);
            int assignedToUserIndex = Properties.Settings.Default.UsersStringCollection.IndexOf(AssignToComboBox.SelectedItem.ToString());

            assignedUsername = Properties.Settings.Default.UsernamesStringCollection[assignedToUserIndex];

            if (selectedTask.taskFiles == null)
            {
                selectedTask.taskFiles = new List <string>();
            }

            string[] taskFilesArray  = selectedTask.taskFiles.ToArray();
            string   taskFilesString = string.Join(",", taskFilesArray);

            if (selectedTask.notifyUsers.Contains(assignedUsername) != true)
            {
                selectedTask.notifyUsers.Add(assignedUsername);
            }

            DataHandling.UpdateTask(taskID, TaskNameTextBox.Text, StartDatePicker.SelectedDate.Value, DeadlinePicker.SelectedDate.Value, TaskDetailsTextBox.Text,
                                    selectedTask.taskListFileTableDir, selectedTask.assignedBy, assignedUsername, StatusComboBox.Text, taskFilesString, selectedTask.notifyUsers);

            string updateString = GetUpdatedFields();

            DataHandling.AddTaskUpdate(taskID, updateString);

            DataStructures.NotificationStruct notificationStruct = new DataStructures.NotificationStruct();
            notificationStruct.notificationSender     = Application.Current.Properties["username"].ToString();
            notificationStruct.notificationText       = "[" + selectedTask.taskName + "]: " + updateString;
            notificationStruct.taskID                 = taskID;
            notificationStruct.notificationTime       = DateTime.Now;
            notificationStruct.notificationRecipients = selectedTask.notifyUsers;

            DataHandling.AddNotification(notificationStruct);

            DataHandling.GetTasksFull();

            Close();
        }
Exemplo n.º 7
0
        private void NotificationTextGrid_MouseDown(object sender, MouseButtonEventArgs e)
        {
            int notificationRow = -1;

            foreach (Border border in NotificationsGrid.Children)
            {
                if (((UIElement)e.Source).IsDescendantOf(border))
                {
                    notificationRow = Grid.GetRow(border);
                }
            }


            Console.WriteLine(notificationRow);

            for (int i = DataStructures.notificationRows.Count(); i >= 0; i--)
            {
                if (i == notificationRow)
                {
                    foreach (DataStructures.TaskRowStruct task in DataStructures.taskRows)
                    {
                        if (task.taskID == taskIDArray[i, 0])
                        {
                            ViewTaskWindow viewTask = new ViewTaskWindow(task);

                            DataHandling.UpdateNotificationReadBy(taskIDArray[i, 1]);
                            //taskIDArray = null;
                            NotificationsGrid.Children.Clear();

                            Close();

                            System.Windows.Application.Current.Resources["BlurEffectRadius"] = (double)0;

                            viewTask.Show();
                        }
                    }
                }
            }
        }
        private void AddFilesButtonClick(object sender, RoutedEventArgs e)
        {
            string taskFilesUpdateString = DataHandling.AddTaskFiles(selectedTask);

            if (selectedTask.taskFiles == null)
            {
                selectedTask.taskFiles = new List <string>();
            }

            string[] taskFilesArray = selectedTask.taskFiles.ToArray();
            string   taskFiles      = String.Join(",", taskFilesArray);

            if (taskFilesUpdateString.Equals("Added File(s): ") == false)
            {
                DataHandling.AddTaskUpdate(selectedTaskID, taskFilesUpdateString);

                DataHandling.GetTasksFull();

                ViewTaskWindow updatedTask = new ViewTaskWindow(selectedTask);
                updatedTask.Show();
                Close();
            }
        }
 public void CancelButtonClick(object sender, RoutedEventArgs e)
 {
     DataHandling.GetTasksFull();
     Close();
 }
 //Refresh Task List
 private void UpdateTasksButtonClick(object sender, RoutedEventArgs e)
 {
     DataHandling.GetTasksFull();
 }
        public void RefreshTimerTick(object sender, EventArgs e)
        {
            DataHandling.GetTasksFull();
            DataHandling.GetNotifications();
            int oldNoOfNotifications = noOfNotifications;

            noOfNotifications = 0;
            bool seenByUser = false;

            foreach (DataStructures.NotificationStruct notification in DataStructures.notificationRows)
            {
                bool notificationForUser = false;
                seenByUser = false;

                foreach (string username in notification.notificationRecipients)
                {
                    if (username.Equals(Application.Current.Properties["username"]) == true)
                    {
                        notificationForUser = true;
                    }
                }

                foreach (string username in notification.readByRecipients)
                {
                    if ((username.Equals(Application.Current.Properties["username"]) == true) && (notificationForUser == true))
                    {
                        seenByUser = true;
                    }
                }

                if ((notificationForUser == true) && (seenByUser == false))
                {
                    noOfNotifications++;
                }
            }

            if (noOfNotifications != 0)
            {
                NotificationsButton.Content = "Notifications (" + noOfNotifications + ")";

                if (noOfNotifications > oldNoOfNotifications)
                {
                    /*
                     * XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastImageAndText02);
                     *
                     * XmlNodeList stringElements = toastXml.GetElementsByTagName("text");
                     *
                     * stringElements[0].AppendChild(toastXml.CreateTextNode("New Notification(s)"));
                     * //stringElements[1].AppendChild(toastXml.CreateTextNode("Open Premier Task Management to see what's changed"));
                     *
                     * string imagePath = "/assets/Premier_P_Logo_Red_RGB_Small_Trans.png";
                     * XmlNodeList imageElements = toastXml.GetElementsByTagName("image");
                     * imageElements[0].Attributes.GetNamedItem("src").NodeValue = imagePath;
                     *
                     * ToastNotification toast = new ToastNotification(toastXml);
                     *
                     * ToastNotificationManager.CreateToastNotifier(APP_ID).Show(toast);
                     */
                }
            }
            else
            {
                NotificationsButton.Content = "Notifications";
            }

            for (int i = CalendarGrid.Children.Count - 1; i > 0; i--)
            {
                if (CalendarGrid.Children[i].GetType() == typeof(Grid))
                {
                    Grid grid = (Grid)CalendarGrid.Children[i];
                    CalendarGrid.Children.Remove(grid);
                }
            }

            LoadTasksIntoCalendar();
        }
        //Log in as User
        private void LogInButtonClick(object sender, RoutedEventArgs e)
        {
            Security      security      = new Security();
            SqlConnection sqlConnection = new SqlConnection(Properties.Settings.Default.PDMDatabaseConnectionString);
            SqlCommand    sqlCommand    = new SqlCommand("GetSaltAndHashSP", sqlConnection);

            sqlCommand.CommandType = CommandType.StoredProcedure;

            sqlCommand.Parameters.AddWithValue("@username", (string)UsernameTextBox.Text);

            SqlParameter returnedSalt      = new SqlParameter("@passwordSalt", SqlDbType.NVarChar);
            SqlParameter returnedHash      = new SqlParameter("@passwordHash", SqlDbType.NVarChar);
            SqlParameter returnedUserFound = new SqlParameter("@userFound", SqlDbType.Int);

            returnedSalt.Direction      = ParameterDirection.Output;
            returnedHash.Direction      = ParameterDirection.Output;
            returnedUserFound.Direction = ParameterDirection.Output;
            returnedSalt.Size           = 256;
            returnedHash.Size           = 256;

            sqlCommand.Parameters.Add(returnedSalt);
            sqlCommand.Parameters.Add(returnedHash);
            sqlCommand.Parameters.Add(returnedUserFound);

            try
            {
                sqlConnection.Open();
                int i = sqlCommand.ExecuteNonQuery();


                string databaseSalt = sqlCommand.Parameters["@passwordSalt"].Value.ToString();
                string databaseHash = sqlCommand.Parameters["@passwordHash"].Value.ToString();
                int    userFound    = (int)sqlCommand.Parameters["@userFound"].Value;

                UsernameExistsLabel.Content    = "";
                PasswordIncorrectLabel.Content = "";


                string passwordhash = security.HashPassword(PasswordTextBox.Password, databaseSalt);

                Console.WriteLine(databaseSalt);
                Console.WriteLine(databaseHash);
                Console.WriteLine(passwordhash);

                if (databaseHash.Equals(passwordhash))
                {
                    Console.WriteLine("Log In Success");

                    MainWindow.Username = UsernameTextBox.Text;

                    //Sets welcome string to User
                    SqlCommand getUser = new SqlCommand("GetNamesSP", sqlConnection);
                    getUser.CommandType = CommandType.StoredProcedure;
                    getUser.Parameters.AddWithValue("@username", UsernameTextBox.Text);
                    SqlParameter forename = new SqlParameter("@forename", SqlDbType.NVarChar);
                    SqlParameter surname  = new SqlParameter("@surname", SqlDbType.NVarChar);
                    forename.Direction = ParameterDirection.Output;
                    surname.Direction  = ParameterDirection.Output;
                    forename.Size      = 30;
                    surname.Size       = 40;
                    getUser.Parameters.Add(forename);
                    getUser.Parameters.Add(surname);

                    int    x          = getUser.ExecuteNonQuery();
                    string forenameDB = getUser.Parameters["@forename"].Value.ToString();
                    string surnameDB  = getUser.Parameters["@surname"].Value.ToString();

                    System.Windows.Application.Current.Properties["username"]             = getUser.Parameters["@username"].Value.ToString();
                    System.Windows.Application.Current.Properties["forename"]             = getUser.Parameters["@forename"].Value.ToString();
                    System.Windows.Application.Current.Properties["surname"]              = getUser.Parameters["@surname"].Value.ToString();
                    System.Windows.Application.Current.Resources["WelcomeTextString"]     = "Welcome, " + System.Windows.Application.Current.Properties["forename"];
                    System.Windows.Application.Current.Resources["BlurEffectRadius"]      = (double)0;
                    System.Windows.Application.Current.Resources["LogInButtonVisibility"] = Visibility.Hidden;

                    sqlConnection.Close();

                    DataHandling.GetTasksFull();
                    DataHandling.GetNotifications();

                    foreach (DataStructures.NotificationStruct notification in DataStructures.notificationRows)
                    {
                        if (notification.readByRecipients.Contains(Application.Current.Properties["username"]) != true)
                        {
                            MainWindow.noOfNotifications++;
                        }
                    }

                    foreach (Window window in Application.Current.Windows)
                    {
                        if (window.GetType() == typeof(MainWindow))
                        {
                            if (MainWindow.noOfNotifications != 0)
                            {
                                (window as MainWindow).NotificationsButton.Content = "Notifications (" + MainWindow.noOfNotifications + ")";
                            }
                            else
                            {
                                (window as MainWindow).NotificationsButton.Content = "Notifications";
                            }
                        }
                    }


                    Close();
                }
                else
                {
                    if (userFound == 0)
                    {
                        UsernameExistsLabel.Content = "User not found.";
                        Console.WriteLine("User not found.");
                    }
                    else
                    {
                        PasswordIncorrectLabel.Content = "Incorrect Password";
                        Console.WriteLine("Incorrect password.");
                    }


                    Console.WriteLine("Log In Failed");
                }


                sqlConnection.Close();
            } catch (SqlException sqle)
            {
                MessageBox.Show("Server unavailable.");
            }
        }
Exemplo n.º 13
0
        public static string AddTaskFiles(DataStructures.TaskRowStruct selectedTask, OpenFileDialog selectFiles)
        {
            string taskFilesUpdateString = "Added File(s): ";
            int    noOfFiles             = 0;

            foreach (string filename in selectFiles.FileNames)
            {
                FileInfo fileInfo = new FileInfo(filename);


                try
                {
                    if (selectedTask.taskFiles == null)
                    {
                        selectedTask.taskFiles = new List <string>();

                        selectedTask.taskFiles.Add(fileInfo.Name);
                        File.Copy(filename, Properties.Settings.Default.FileDirectory + selectedTask.taskListFileTableDir + @"\" + fileInfo.Name);

                        if (noOfFiles < selectFiles.FileNames.Length)
                        {
                            taskFilesUpdateString += fileInfo.Name + ", ";
                        }
                        else
                        {
                            taskFilesUpdateString += fileInfo.Name;
                        }
                    }
                    else
                    {
                        if (selectedTask.taskFiles.Contains(fileInfo.Name) == false)
                        {
                            selectedTask.taskFiles.Add(fileInfo.Name);
                        }

                        File.Copy(filename, Properties.Settings.Default.FileDirectory + selectedTask.taskListFileTableDir + @"\" + fileInfo.Name);

                        if (noOfFiles < selectFiles.FileNames.Length)
                        {
                            taskFilesUpdateString += fileInfo.Name + ", ";
                        }
                        else
                        {
                            taskFilesUpdateString += fileInfo.Name;
                        }
                    }
                }
                catch (IOException ioe)
                {
                    File.Delete(Properties.Settings.Default.FileDirectory + selectedTask.taskListFileTableDir + @"\" + fileInfo.Name);
                    File.Copy(filename, Properties.Settings.Default.FileDirectory + selectedTask.taskListFileTableDir + @"\" + fileInfo.Name);

                    if (noOfFiles < selectFiles.FileNames.Length)
                    {
                        taskFilesUpdateString += fileInfo.Name + " (replaced existing), ";
                    }
                    else
                    {
                        taskFilesUpdateString += fileInfo.Name + " (replaced existing)";
                    }
                }

                noOfFiles++;
            }

            string[] taskFilesArray = selectedTask.taskFiles.ToArray();
            string   taskFiles      = String.Join(",", taskFilesArray);

            DataHandling.UpdateTask(selectedTask);

            return(taskFilesUpdateString);
        }
        private void CreateTaskButtonClick(object sender, RoutedEventArgs e)
        {
            int    assignedToUserIndex = Properties.Settings.Default.UsersStringCollection.IndexOf(AssignToComboBox.Text);
            string assignedUsername    = Properties.Settings.Default.UsernamesStringCollection[assignedToUserIndex];

            newTask.taskName             = TaskNameTextBox.Text;
            newTask.startDate            = StartDatePicker.SelectedDate.Value;
            newTask.deadline             = DeadlinePicker.SelectedDate.Value;
            newTask.details              = TaskDetailsTextBox.Text;
            newTask.taskListFileTableDir = TaskNameTextBox.Text;
            newTask.assignedBy           = System.Windows.Application.Current.Properties["username"].ToString();
            newTask.assignedTo           = assignedUsername;
            newTask.taskStatus           = StatusComboBox.SelectedValue.ToString();
            newTask.lastEdited           = DateTime.Now;
            newTask.taskFiles            = new List <string>();
            newTask.notifyUsers          = new List <string>();
            string[] taskFilesArray  = newTask.taskFiles.ToArray();
            string   taskFilesString = string.Join(",", taskFilesArray);

            string[] notifyUsersArray = new string[0];
            notifyUsersArray.Append(newTask.assignedBy);
            notifyUsersArray.Append(newTask.assignedTo);
            string notifyUsersString = string.Join(",", notifyUsersArray);

            using (SqlConnection sqlConn = new SqlConnection(Properties.Settings.Default.PDMDatabaseConnectionString))
            {
                SqlCommand createTask = new SqlCommand("CreateTaskSP", sqlConn);
                createTask.CommandType = CommandType.StoredProcedure;
                createTask.Parameters.AddWithValue("@taskname", newTask.taskName);
                createTask.Parameters.AddWithValue("@startdate", newTask.startDate);
                createTask.Parameters.AddWithValue("@deadline", newTask.deadline);
                createTask.Parameters.AddWithValue("@details", newTask.details);
                createTask.Parameters.AddWithValue("@tasklistfiletabledir", newTask.taskListFileTableDir);
                createTask.Parameters.AddWithValue("@assignedby", newTask.assignedBy);
                createTask.Parameters.AddWithValue("@assignedto", newTask.assignedTo);
                createTask.Parameters.AddWithValue("@taskstatus", newTask.taskStatus);
                createTask.Parameters.AddWithValue("@lastedited", newTask.lastEdited);
                createTask.Parameters.AddWithValue("@taskFiles", taskFilesString);
                createTask.Parameters.AddWithValue("@notifyUsers", notifyUsersString);

                sqlConn.Open();
                int i = createTask.ExecuteNonQuery();

                string     sqlQuery = "INSERT INTO dbo.TaskListFiles (name,is_directory,is_archive) VALUES ('" + TaskNameTextBox.Text + "', 1, 0);";
                SqlCommand createFileTableDirComm = new SqlCommand(sqlQuery, sqlConn);
                createFileTableDirComm.CommandType = CommandType.Text;
                createFileTableDirComm.ExecuteNonQuery();

                Directory.SetCurrentDirectory(Properties.Settings.Default.FileDirectory);
                Directory.CreateDirectory(TaskNameTextBox.Text);
            }

            DataHandling.GetTasksFull();

            int newTaskID = DataHandling.GetTaskID(newTask.taskName, newTask.details);

            DataStructures.NotificationStruct notificationStruct = new DataStructures.NotificationStruct();
            notificationStruct.notificationSender     = Application.Current.Properties["username"].ToString();
            notificationStruct.notificationText       = "Created Task: " + newTask.taskName;
            notificationStruct.taskID                 = newTaskID;
            notificationStruct.notificationTime       = DateTime.Now;
            notificationStruct.notificationRecipients = new List <string>();
            notificationStruct.notificationRecipients.Add(newTask.assignedTo);
            notificationStruct.notificationRecipients.Add(newTask.assignedBy);

            DataHandling.AddNotification(notificationStruct);

            string taskFilesUpdateString = DataHandling.AddTaskFiles(newTask, selectFiles);

            if (taskFilesUpdateString.Equals("Added File(s): ") == false)
            {
                DataHandling.AddTaskUpdate(newTaskID, taskFilesUpdateString);

                DataHandling.GetTasksFull();
            }


            Close();
        }