private void chkIsCompleted_Click(object sender, RoutedEventArgs e)
        {
            if (chkIsCompleted.IsChecked == true)
            {
                if (MessageBox.Show("Are you sure this task is completed? It cannot be undone! ",
                "Confirm task completion...",
                MessageBoxButton.YesNoCancel, MessageBoxImage.Question) == MessageBoxResult.Yes)
                {

                    TasksHelper client = new TasksHelper();
                    try
                    {
                        var textRange = new TextRange(txtDesc.Document.ContentStart, txtDesc.Document.ContentEnd);
                        Task task = (Task)lstTask.SelectedItem;

                        TaskAssignment assn = client.GetTaskAssignment(task.TaskID, event_.EventID,
                            int.Parse(cboRole.SelectedValue.ToString()));

                        client.SetTaskCompleted(task, assn.AssignedRoleID, textRange.Text.Trim());

                        MessageBox.Show("Operation Succeeded");
                        chkIsCompleted.IsEnabled = false;
                        txtRemark.IsReadOnly = true;
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("An Error have occured: " + ex.Message, "Error",
                            MessageBoxButton.OK, MessageBoxImage.Error);
                    }
                    client.Close();
                }
                else
                {
                    chkIsCompleted.IsChecked = false;
                }
            }
        }
        private void chkIsCompleted_Click(object sender, RoutedEventArgs e)
        {
            int selectedTaskIdx = lstOverviewAllTask.SelectedIndex;
            Task task = (Task)lstOverviewAllTask.SelectedItem;
            TaskAssignmentState tas = (TaskAssignmentState)lvOverViewRoleView.SelectedItem;
            TasksHelper client = new TasksHelper();

            try
            {
                if (MessageBox.Show("Are you sure you want to change the status of completion? ",
               "Confirm Operation...",
               MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
                {
                    chkIsCompleted.IsChecked = tas.TaskAssignment.IsCompleted;
                    return;
                }
                var textRange = new TextRange(txtOverviewRemark.Document.ContentStart, txtOverviewRemark.Document.ContentEnd);

                if (chkIsCompleted.IsChecked == true)
                {
                    client.SetTaskCompleted(task, tas.TaskAssignment.AssignedRoleID, textRange.Text.Trim());
                }
                else
                {
                    client.SetTaskIncomplete(user, task, tas.TaskAssignment.AssignedRoleID, textRange.Text.Trim());
                }

                LoadTasks();
                ClearOverview();
                cboRole.SelectedIndex = -1;
                lstOverviewAllTask.SelectedIndex = selectedTaskIdx;
                MessageBox.Show("Operation Succeeded");

                //lvOverViewRoleView.SelectedIndex = -1;
            }
            catch (Exception ex)
            {
                MessageBox.Show("An Error have occured: " + ex.Message, "Error",
                    MessageBoxButton.OK, MessageBoxImage.Error);
            }
            finally
            {
                client.Close();
            }
        }