Esempio n. 1
0
    //Method to display Specific ID Lists
    protected void MailIDDropDownList_SelectedIndexChanged(object sender, EventArgs e)
    {
        try
        {
            TodoListBusinessObject obj_TodoGetListsBO = new TodoListBusinessObject();
            obj_TodoGetListsBO.EmailID = MailIDDropDownList.SelectedItem.Text;

            TodoListBusinessLogicFactory obj_TodoListsBLF = new TodoListBusinessLogicFactory();
            DataSet lists = obj_TodoListsBLF.CreateTodoListBLF().GetUserListsBL(obj_TodoGetListsBO);


            if (lists != null)
            {
                UserListsGridView.DataSource = lists.Tables["TodoList_UserLists"];

                UserListsGridView.DataBind();
            }
            else
            {
                DataTable dt = new DataTable();
                UserListsGridView.DataSource = dt;
                UserListsGridView.DataBind();
            }
        }
        catch {
            GridViewErrorLabel.Text = "Unable to get EmailId's";
        }
    }
    //Event to evaluate login credentials and direct to land page
    protected void AdminSignInButton_Click(object sender, EventArgs e)
    {
        try
        {
            TodoListBusinessObject obj_AdminLoginBO = new TodoListBusinessObject();
            obj_AdminLoginBO.EmailID = AdminNameTextBox.Text;
            obj_AdminLoginBO.Pwd     = AdminPwdTextBox.Text;

            TodoListBusinessLogicFactory obj_AdminLoginBLF = new TodoListBusinessLogicFactory();
            bool isValid = obj_AdminLoginBLF.CreateTodoListBLF().ValidateUserBL(obj_AdminLoginBO);

            if (isValid == true)
            {
                //redirect to next page
                Session["EmailID"] = AdminNameTextBox.Text;

                string url = "~/AdminUser/AdminPage.aspx?";
                Response.Redirect(url);
            }
            else
            {
                ErrorLabel.Text = "UserID or Password is Incorrect";
            }
        }
        catch
        {
            ErrorLabel.Text = "Error Occured";
        }
    }
    //Event to Add/Edit Lists
    protected void AddEditButton_Click(object sender, EventArgs e)
    {
        try
        {
            UserMultiView.ActiveViewIndex = 1;

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

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

            if (coll != null)
            {
                EditGridView.DataSource = coll.Tables["TodoList_UserLists"];
                EditGridView.DataBind();
            }
            else
            {
                DataTable dt = new DataTable();
                EditGridView.DataSource = dt;
                EditGridView.DataBind();
            }
            EditTable.Visible = false;
            AddTable.Visible  = false;
        }
        catch
        {
            ErrorLabel.Text = "Unable to Load button";
        }
    }
Esempio n. 4
0
    //Method to display Details of Specific ID
    protected void UserMailIDDropDownList_SelectedIndexChanged(object sender, EventArgs e)
    {
        try
        {
            TodoListBusinessObject obj_TodoGetUserDetailsBO = new TodoListBusinessObject();
            string EmailID = UserMailIDDropDownList.SelectedItem.Text;
            obj_TodoGetUserDetailsBO.EmailID = UserMailIDDropDownList.SelectedItem.Text;

            TodoListBusinessLogicFactory obj_TodoListsBLF = new TodoListBusinessLogicFactory();
            DataSet lists = obj_TodoListsBLF.CreateTodoListBLF().GetUserDetailsBL(obj_TodoGetUserDetailsBO);

            DeleteButton.Visible = true;

            if (lists != null)
            {
                UserDetailsGridView.DataSource = lists.Tables["TodoList_UserDetails"];
                UserDetailsGridView.DataBind();
            }
            else
            {
                DataTable dt = new DataTable();
                UserDetailsGridView.DataSource = dt;
                UserDetailsGridView.DataBind();
            }
        }
        catch {
            ErrorLabel.Text = "Details Loading Error";
        }
    }
    //Method to fill todoList Details into GridVieew
    protected void FillGridView()
    {
        try
        {
            TodoListBusinessObject obj_TodoListBO = new TodoListBusinessObject();
            obj_TodoListBO.EmailID = (string)Session["EmailID"];

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

            if (coll != null)
            {
                UserListsGridView.DataSource = coll.Tables["TodoList_UserLists"];


                UserListsGridView.DataBind();
            }
            else
            {
                DataTable dt = new DataTable();
                UserListsGridView.DataSource = dt;
                UserListsGridView.DataBind();
            }
        }
        catch
        {
            ErrorLabel.Text = "Error Filling GridView";
        }
    }
    //Event to open forgot password textboxes to provide inputs
    protected void ForgotPasswordButton_Click(object sender, EventArgs e)
    {
        if (AdminNameTextBox.Text == string.Empty || AdminNameTextBox.Text == null)
        {
            ErrorLabel.Text = "Please Enter User EmailId";
        }
        else
        {
            TodoListBusinessObject obj_TodoListBO = new TodoListBusinessObject();
            obj_TodoListBO.EmailID = AdminNameTextBox.Text;


            TodoListBusinessLogicFactory obj_ValidateBLF = new TodoListBusinessLogicFactory();
            bool isValid = obj_ValidateBLF.CreateTodoListBLF().ValidateUserForgotPwdBL(obj_TodoListBO);
            if (isValid == true)
            {
                TodoListBusinessLogicFactory obj_TodoListBL = new TodoListBusinessLogicFactory();
                DataSet question = obj_TodoListBL.CreateTodoListBLF().GetSecurityQnBL(obj_TodoListBO);
                SecurityQuestionLabel.Text = question.Tables[0].Rows[0]["SecurityQuestion"].ToString();

                SecurityQnLabel.Visible       = true;
                SecurityQuestionLabel.Visible = true;
                SecurityAnswerLabel.Visible   = true;
                SecurityAnsLabel.Visible      = true;
                SecurityAnsTextBox.Visible    = true;
                SecuritySubmitButton.Visible  = true;
            }
            else
            {
                ErrorLabel.Visible = true;
                ErrorLabel.Text    = "Invalid EmailId";
            }
        }
    }
Esempio n. 7
0
    //Event to submit security Answer
    protected void SecurityAnsSubmitButton_Click(object sender, EventArgs e)
    {
        try
        {
            TodoListBusinessObject obj_TodoListBO = new TodoListBusinessObject();
            obj_TodoListBO.EmailID = UserNameTextBox.Text;

            TodoListBusinessLogicFactory obj_TodoListBL = new TodoListBusinessLogicFactory();
            DataSet answer = obj_TodoListBL.CreateTodoListBLF().GetSecurityAnsBL(obj_TodoListBO);

            string ans = answer.Tables[0].Rows[0]["SecurityAnswer"].ToString();

            if (SecurityAnsTextBox.Text.Equals(ans))
            {
                Session["EmailID"] = UserNameTextBox.Text;

                string url = "~/LogedInUser/UserTodoListLand.aspx?";
                Response.Redirect(url);
            }
            else
            {
                ErrorLabel.Text = "Incorrect Answer";
            }
        }
        catch {
            ErrorLabel.Text = "Unable to check Security Answer";
        }
    }
    //Event to submit Edited List
    protected void EditSubmitButton_Click(object sender, EventArgs e)
    {
        if (EditTitleTextBox.Text != null && EditDescriptionTextBox.Text != null)
        {
            TodoListBusinessObject obj_TodolistBO = new TodoListBusinessObject();
            obj_TodolistBO.TitleNew    = EditTitleTextBox.Text;
            obj_TodolistBO.EmailID     = (string)Session["EmailID"];
            obj_TodolistBO.Description = EditDescriptionTextBox.Text;

            foreach (GridViewRow gvslkrow in EditGridView.Rows)
            {
                CheckBox chk = (CheckBox)gvslkrow.FindControl("SelectCheckBox");
                if (chk != null && chk.Checked)
                {
                    obj_TodolistBO.TitleOld = gvslkrow.Cells[1].Text;
                }
            }

            obj_TodolistBO.CreatedDate = (System.DateTime.Now.Date.ToShortDateString());
            TodoListBusinessLogicFactory obj_UserDetailsBLF = new TodoListBusinessLogicFactory();
            ErrorSelectionLabel.Text = obj_UserDetailsBLF.CreateTodoListBLF().UpdateUserListBL(obj_TodolistBO);


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

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

            if (coll != null)
            {
                EditGridView.DataSource = coll.Tables["TodoList_UserLists"];
                EditGridView.DataBind();
                EditTitleTextBox.Text = "";
                AddTitleTextBox.Text  = "";
            }
            else
            {
                DataTable dt = new DataTable();
                EditGridView.DataSource = dt;
                EditGridView.DataBind();
            }
        }
        else
        {
            if (EditTitleTextBox.Text == null || EditTitleTextBox.Text == "")
            {
                TitleErrorLabel.Text = "Please Enter Title";
            }
            else if (EditDescriptionTextBox.Text == null || EditDescriptionTextBox.Text == "")
            {
                DescriptionErrorLabel.Text = "Please Enter Description";
            }
        }
    }
    //Event to send selected list to completed List
    protected void ArchiveButton_Click(object sender, EventArgs e)
    {
        TodoListBusinessObject obj_SendArchiveListBO = new TodoListBusinessObject();

        obj_SendArchiveListBO.EmailID   = (String)Session["EmailID"];
        obj_SendArchiveListBO.IsArchive = false;

        foreach (GridViewRow gvslkrow in EditGridView.Rows)
        {
            CheckBox chk = (CheckBox)gvslkrow.FindControl("SelectCheckBox");
            if (chk != null && chk.Checked)
            {
                obj_SendArchiveListBO.Title       = gvslkrow.Cells[1].Text;
                obj_SendArchiveListBO.Description = gvslkrow.Cells[2].Text;
                ErrorSelectionLabel.Visible       = false;
            }
            else
            {
                ErrorSelectionLabel.Text = "Please Select a List";
            }
        }

        if (ErrorSelectionLabel.Text == null || ErrorSelectionLabel.Text == "")
        {
            ErrorSelectionLabel.Visible = false;
        }

        TodoListBusinessLogicFactory obj_SendArchiveBLF = new TodoListBusinessLogicFactory();

        obj_SendArchiveBLF.CreateTodoListBLF().SendToArchiveUserListBL(obj_SendArchiveListBO);


        TodoListBusinessObject obj_TodoListBO = new TodoListBusinessObject();

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

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

        if (coll != null)
        {
            EditGridView.DataSource = coll.Tables["TodoList_UserLists"];
            EditGridView.DataBind();
        }
        else
        {
            DataTable dt = new DataTable();
            EditGridView.DataSource = dt;
            EditGridView.DataBind();
        }
    }
    //Event to submit the user details
    protected void SubmitButton_Click(object sender, EventArgs e)
    {
        try
        {
            TodoListBusinessObject obj_TodolistBO = new TodoListBusinessObject();

            obj_TodolistBO.name    = NewUserTextBox.Text;
            obj_TodolistBO.EmailID = NewUserEmailTextBox.Text;

            TodoListBusinessLogicFactory obj_TodoBLF = new TodoListBusinessLogicFactory();
            bool isAvailable = obj_TodoBLF.CreateTodoListBLF().IsAvailableEmailBL(obj_TodolistBO);
            if (isAvailable == true)
            {
                ErrorMessageLabel.Visible = true;
                ErrorMessageLabel.Text    = "EmailId Already Registered";
            }
            else
            {
                ErrorMessageLabel.Visible = false;
                if (Page.IsValid)
                {
                    obj_TodolistBO.name             = NewUserTextBox.Text;
                    obj_TodolistBO.EmailID          = NewUserEmailTextBox.Text;
                    obj_TodolistBO.Pwd              = PwdTextBox.Text;
                    obj_TodolistBO.SecurityQuestion = SecurityQTextBox.Text;
                    obj_TodolistBO.SecurityAnswer   = SecurityAnsTextBox.Text;
                    obj_TodolistBO.DateOfBirth      = AgeCalendar.SelectedDate.Date.ToShortDateString();
                    obj_TodolistBO.Phone            = PhoneTextBox.Text;
                    obj_TodolistBO.Country          = CountryTextBox.Text;
                    obj_TodolistBO.ZipCode          = Convert.ToInt32(ZipCodeTextBox.Text);
                    obj_TodolistBO.IsActive         = true;

                    TodoListBusinessLogicFactory obj_TodoListBLF = new TodoListBusinessLogicFactory();
                    string status = obj_TodoListBLF.CreateTodoListBLF().InsertNewUserBL(obj_TodolistBO);

                    SubmissionLabel.Visible = true;
                    SubmissionLabel.Text    = status;

                    LoginButton.Visible = true;
                }
            }
        }
        catch
        {
            if (ErrorMessageLabel.Text == null)
            {
                ErrorMessageLabel.Text = "Input Error";
            }
        }
    }
    //Event to submit and add list
    protected void AddSubmitButton_Click(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(AddTitleTextBox.Text) && (!string.IsNullOrEmpty(AddDescriptionTextBox.Text)))
        {
            TodoListBusinessObject obj_InsertListBO = new TodoListBusinessObject();
            obj_InsertListBO.EmailID     = (string)Session["EmailID"];
            obj_InsertListBO.CreatedDate = (DateTime.Today.Date.ToShortDateString());
            obj_InsertListBO.Title       = AddTitleTextBox.Text;
            obj_InsertListBO.Description = AddDescriptionTextBox.Text;
            obj_InsertListBO.IsActive    = true;
            obj_InsertListBO.IsArchive   = false;
            TodoListBusinessLogicFactory obj_InsertListBLF = new TodoListBusinessLogicFactory();
            DataSet coll = obj_InsertListBLF.CreateTodoListBLF().InsertUserListsBL(obj_InsertListBO);

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

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

            if (coll != null)
            {
                EditGridView.DataSource = coll.Tables["TodoList_UserLists"];
                EditGridView.DataBind();
                EditTitleTextBox.Text = "";
                AddTitleTextBox.Text  = "";
            }
            else
            {
                DataTable dt = new DataTable();
                EditGridView.DataSource = dt;
                EditGridView.DataBind();
            }
        }
        else
        {
            if (AddTitleTextBox.Text == null)
            {
                TitleErrorLabel.Text = "Please Enter Title";
            }
            else
            {
                DescriptionErrorLabel.Text = "Please Enter Description";
            }
        }
    }
Esempio n. 12
0
    //Event to delete selected User details
    protected void DeleteButton_Click(object sender, EventArgs e)
    {
        try
        {
            string confirmValue = Request.Form["confirmDelete_value"];
            if (confirmValue == "Yes")
            {
                if (UserMailIDDropDownList.SelectedItem.Text != (string)Session["EmailID"])
                {
                    TodoListBusinessObject obj_TodoDeleteUserDetailsBO = new TodoListBusinessObject();
                    if (UserMailIDDropDownList.SelectedItem.Text != null || UserMailIDDropDownList.SelectedItem.Text != "")
                    {
                        obj_TodoDeleteUserDetailsBO.EmailID = UserMailIDDropDownList.SelectedItem.Text;
                        ErrorLabel.Visible = false;
                    }
                    else
                    {
                        ErrorLabel.Text = "Please Select User";
                    }

                    TodoListBusinessLogicFactory obj_TodoListsBLF = new TodoListBusinessLogicFactory();
                    obj_TodoListsBLF.CreateTodoListBLF().DeleteCompleteListsBL(obj_TodoDeleteUserDetailsBO);

                    DataSet user = obj_TodoListsBLF.CreateTodoListBLF().DeleteUserBL(obj_TodoDeleteUserDetailsBO);
                    if (user == null)
                    {
                        DataTable dt = new DataTable();
                        UserDetailsGridView.DataSource = dt;
                        UserDetailsGridView.DataBind();
                    }
                    UserDetailsGridView.DataBind();
                    FillDropDownList();
                    UserMailIDDropDownList.ClearSelection();
                }
                else
                {
                    ErrorLabel.Text = "You can't Delete the Logged in Admin";
                }
            }
        }
        catch {
            ErrorLabel.Text = "Unable to Delete User";
        }
    }
Esempio n. 13
0
    //Method to Fill DropDownList
    public void FillDropDownList()
    {
        try
        {
            TodoListBusinessObject obj_TodoListBO = new TodoListBusinessObject();
            obj_TodoListBO.EmailID = (string)Session["EmailID"];

            TodoListBusinessLogicFactory obj_UserTodoListBLF = new TodoListBusinessLogicFactory();
            DataSet coll = obj_UserTodoListBLF.CreateTodoListBLF().GetUserEmailBL();
            if (coll != null)
            {
                MailIDDropDownList.DataSource     = coll;
                MailIDDropDownList.DataValueField = "EmailID";
                MailIDDropDownList.DataTextField  = "EmailID";
                MailIDDropDownList.SelectedIndex  = -1;
                MailIDDropDownList.DataBind();
            }
            else
            {
                DataTable dt = new DataTable();
                MailIDDropDownList.DataSource = dt;
                MailIDDropDownList.DataBind();
            }

            if (MultiView.ActiveViewIndex == 1 && coll != null)
            {
                UserMailIDDropDownList.DataSource     = coll;
                UserMailIDDropDownList.DataValueField = "EmailID";
                UserMailIDDropDownList.DataTextField  = "EmailID";
                UserMailIDDropDownList.SelectedIndex  = -1;
                UserMailIDDropDownList.DataBind();
            }
            else
            {
                DataTable dt = new DataTable();
                UserMailIDDropDownList.DataSource = dt;
                UserMailIDDropDownList.DataBind();
            }
        }
        catch {
            GridViewErrorLabel.Text = "Unable to get details ";
        }
    }
Esempio n. 14
0
    //Event to check credentials and login User
    protected void LoginButton_Click(object sender, EventArgs e)
    {
        try
        {
            if ((UserNameTextBox.Text != "" && PasswordTextBox.Text != "") && ((UserNameTextBox.Text != null && PasswordTextBox.Text != null)))
            {
                TodoListBusinessObject obj_UserLoginBO = new TodoListBusinessObject();
                obj_UserLoginBO.EmailID = UserNameTextBox.Text;
                obj_UserLoginBO.Pwd     = PasswordTextBox.Text;

                TodoListBusinessLogicFactory obj_ValidateBLF = new TodoListBusinessLogicFactory();
                bool isValid = obj_ValidateBLF.CreateTodoListBLF().ValidateUserBL(obj_UserLoginBO);
                if (isValid == true)
                {
                    //redirect to land next page
                    Session["EmailID"] = UserNameTextBox.Text;

                    string url = "~/LogedInUser/UserTodoListLand.aspx?";
                    Response.Redirect(url);
                }
                else
                {
                    ErrorLabel.Text = "UserID or Password is Incorrect";
                }
            }
            else
            {
                if (UserNameTextBox.Text == null || UserNameTextBox.Text == string.Empty)
                {
                    ErrorLabel.Text = "Please Enter the EmailId";
                }
                else
                {
                    ErrorLabel.Text = "Please Enter Password";
                }
            }
        }
        catch
        {
            ErrorLabel.Text = "Error Occured";
        }
    }
Esempio n. 15
0
    //Event to Activate User
    protected void ActivateButton_Click(object sender, EventArgs e)
    {
        try
        {
            string confirmValue = Request.Form["confirm_value"];
            if (confirmValue == "Yes")
            {
                TodoListBusinessObject obj_UserActivateBO = new TodoListBusinessObject();
                obj_UserActivateBO.EmailID = ActivateEmailTextbox.Text;
                obj_UserActivateBO.Pwd     = ActivatePwdTextbox.Text;

                TodoListBusinessLogicFactory obj_ValidateBLF = new TodoListBusinessLogicFactory();
                bool isValid = obj_ValidateBLF.CreateTodoListBLF().UserValidateInActiveBL(obj_UserActivateBO);
                if (isValid == true)
                {
                    //TodoListBusinessObject obj_DeActivateUserBO = new TodoListBusinessObject();
                    obj_UserActivateBO.IsActive = true;

                    TodoListBusinessLogicFactory obj_ActivateBLF = new TodoListBusinessLogicFactory();
                    bool Activate = obj_ActivateBLF.CreateTodoListBLF().ActivateUserBL(obj_UserActivateBO);

                    if (Activate == true)
                    {
                        ActivateErrLabel.Text = " Account is Successfully Activated ";
                    }
                    else
                    {
                        ActivateErrLabel.Text = "Unable to deactivate Account";
                    }
                }
                else
                {
                    ActivateErrLabel.Text = "Invalid Account Details or Account already Active";
                }
            }
        }
        catch
        {
            ErrorLabel.Text = "Error Occured";
            //ErrorLabel.ForeColor;
        }
    }
    //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";
        }
    }
Esempio n. 17
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";
        }
    }