Example #1
0
    //Method to De Activate User
    public bool DeActivateUserBL(TodoListBusinessObject todoListBO)
    {
        TodoListDataAccessFactory obj_DeActivateDLF = new TodoListDataAccessFactory();

        return(obj_DeActivateDLF.CreateTodoListDAF().DeActivateUserDA(todoListBO));
    }
Example #2
0
    //Method to send completed List to todoList
    public DataSet UnArchiveUserListBL(TodoListBusinessObject todoListBO)
    {
        TodoListDataAccessFactory obj_SendArchiveUserListDAF = new TodoListDataAccessFactory();

        return(obj_SendArchiveUserListDAF.CreateTodoListDAF().UnArchiveUserListDA(todoListBO));
    }
Example #3
0
    //method to register a new user
    public string InsertNewUserBL(TodoListBusinessObject todoListBO)
    {
        TodoListDataAccessFactory obj_TodoListDAF = new TodoListDataAccessFactory();

        return(obj_TodoListDAF.CreateTodoListDAF().InsertNewUserDA(todoListBO));
    }
Example #4
0
    //Method to delete Complete Lists of User
    public DataSet DeleteCompleteListsBL(TodoListBusinessObject todoListBO)
    {
        TodoListDataAccessFactory obj_DeleteCompleteListsDAF = new TodoListDataAccessFactory();

        return(obj_DeleteCompleteListsDAF.CreateTodoListDAF().DeleteCompleteListsDA(todoListBO));
    }
    //Event to Delete Selected TodoList
    protected void DeleteButton_Click(object sender, EventArgs e)
    {
        try
        {
            int count = 0;
            foreach (GridViewRow gridvrow in EditGridView.Rows)
            {
                CheckBox editdetailscheck = (CheckBox)gridvrow.FindControl("SelectCheckBox");
                if (editdetailscheck != null && editdetailscheck.Checked)
                {
                    count++;

                    TodoListBusinessObject obj_DeleteListBO = new TodoListBusinessObject();
                    obj_DeleteListBO.EmailID   = (String)Session["EmailID"];
                    obj_DeleteListBO.IsArchive = true;

                    foreach (GridViewRow gvslkrow in EditGridView.Rows)
                    {
                        CheckBox chk = (CheckBox)gvslkrow.FindControl("SelectCheckBox");
                        if (chk != null && chk.Checked)
                        {
                            obj_DeleteListBO.Title       = gvslkrow.Cells[1].Text;
                            obj_DeleteListBO.Description = gvslkrow.Cells[2].Text;


                            foreach (GridViewRow grid in EditGridView.Rows)
                            {
                                CheckBox uncheck = (CheckBox)grid.FindControl("SelectCheckBox");
                                uncheck.Enabled = false;
                            }
                        }
                    }

                    TodoListBusinessLogicFactory objDeleteBLLFactRow = new TodoListBusinessLogicFactory();
                    objDeleteBLLFactRow.CreateTodoListBLF().DeleteUserListBL(obj_DeleteListBO);


                    TodoListBusinessObject obj_TodoListBO = new TodoListBusinessObject();
                    obj_TodoListBO.EmailID = (string)Session["EmailID"];

                    TodoListBusinessLogicFactory obj_UserTodoListBLF = new TodoListBusinessLogicFactory();
                    DataSet coll = obj_UserTodoListBLF.CreateTodoListBLF().GetUserListsBL(obj_TodoListBO);

                    ErrorSelectionLabel.Visible = false;
                    if (coll != null)
                    {
                        EditGridView.DataSource = coll.Tables["TodoList_UserLists"];
                        EditGridView.DataBind();
                    }
                    else
                    {
                        DataTable dt = new DataTable();
                        EditGridView.DataSource = dt;
                        EditGridView.DataBind();
                    }
                }
                else
                {
                    if (count == 0)
                    {
                        ErrorSelectionLabel.Visible = true;
                        ErrorSelectionLabel.Text    = "Please select a row and then click Delete";
                    }
                }
            }
        }

        catch
        {
            ErrorSelectionLabel.Visible = true;
            ErrorSelectionLabel.Text    = "Unable to load button";
        }
    }
Example #6
0
    //Event to send back completed List Item to Todo Lists
    protected void SendBackButton_Click(object sender, EventArgs e)
    {
        try
        {
            foreach (GridViewRow gridrow in UserArchiveGridView.Rows)
            {
                CheckBox check = (CheckBox)gridrow.FindControl("SelectCheckBox");
                if (check != null && check.Checked)
                {
                    ErrorLabel.Visible = false;

                    TodoListBusinessObject obj_UnArchiveListBO = new TodoListBusinessObject();
                    obj_UnArchiveListBO.EmailID   = (String)Session["EmailID"];
                    obj_UnArchiveListBO.IsArchive = false;

                    foreach (GridViewRow gvslkrow in UserArchiveGridView.Rows)
                    {
                        CheckBox chk = (CheckBox)gvslkrow.FindControl("SelectCheckBox");
                        if (chk != null && chk.Checked)
                        {
                            obj_UnArchiveListBO.Title       = gvslkrow.Cells[1].Text;
                            obj_UnArchiveListBO.Description = gvslkrow.Cells[2].Text;
                            ErrorLabel.Visible = false;
                        }
                        else
                        {
                            ErrorLabel.Text    = "Please Select a Item to send to TodoList";
                            ErrorLabel.Visible = true;
                        }
                    }

                    TodoListBusinessLogicFactory obj_UnArchiveBLF = new TodoListBusinessLogicFactory();
                    obj_UnArchiveBLF.CreateTodoListBLF().UnArchiveUserListBL(obj_UnArchiveListBO);


                    TodoListBusinessObject obj_TodoListBO = new TodoListBusinessObject();
                    obj_TodoListBO.EmailID = (string)Session["EmailID"];

                    TodoListBusinessLogicFactory obj_UserTodoListBLF = new TodoListBusinessLogicFactory();
                    DataSet coll = obj_UserTodoListBLF.CreateTodoListBLF().GetUserArchiveBL(obj_TodoListBO);

                    if (coll != null)
                    {
                        UserArchiveGridView.DataSource = coll.Tables["TodoList_UserLists"];
                        UserArchiveGridView.DataBind();
                        ErrorLabel.Visible = false;
                    }
                    else
                    {
                        DataTable dt = new DataTable();
                        UserArchiveGridView.DataSource = dt;
                        UserArchiveGridView.DataBind();
                    }
                }
                else
                {
                    ErrorLabel.Text = "Please Select a Item to send to TodoList";
                }
            }
        }
        catch
        {
            ErrorLabel.Text = "Error Sending Back Item";
        }
    }