protected void CurrentRowTextBox_OnTextChanged(object sender, EventArgs e)
        {
            TextBox t = (TextBox)sender;

            try
            {
                DataPagertxtValue = Convert.ToInt32(t.Text);
            }
            catch
            {
                LoggedIn master = (LoggedIn)this.Master;
                master.ShowMessage("Value Out of Range", false);
                return;
            }

            if (t.Text == "")
            {
                return;
            }


            if (DataPagertxtValue <= RoleDataPager.TotalRowCount)
            {
                RoleDataPager.SetPageProperties(Convert.ToInt32(t.Text) - 1,
                                                RoleDataPager.PageSize, true);
                bind();
                recalcNoOfPages();
            }
            else
            {
                LoggedIn master = (LoggedIn)this.Master;
                master.ShowMessage("Incorrect Input", false);
            }
        }
        //protected void btnUpdate_Click(object sender, EventArgs e)
        //{
        //    RoleBE role = new RoleBE();
        //    RoleBAL roleBAL = new RoleBAL();


        //    role.RoleId = Convert.ToInt32(hdnRoleUpdateId.Value);
        //    //role.RoleShortDesc = txtRoleShortDesc.Text;
        //    //role.RoleLongDesc = txtRolelongDesc.Text;
        //    role.LastModifiedBy = ((UserBE)Session["LoggedInUser"]).UserId;
        //    if (roleBAL.ModifyRole(role))
        //    {
        //        LvRoleItems.EditIndex = -1;
        //        bind();
        //        recalcNoOfPages();
        //        LoggedIn master = (LoggedIn)this.Master;
        //        master.ShowMessage("Role successfully Updated.", true);
        //    }
        //    else
        //    {
        //        LoggedIn master = (LoggedIn)this.Master;
        //        master.ShowMessage("Unsuccessful", true);
        //    }

        //}

        //protected void btnCancel_Click(object sender, EventArgs e)
        //{
        //    LvRoleItems.EditIndex = -1;
        //    bind();
        //    recalcNoOfPages();
        //}

        protected void btnDeleteYes_Click(object sender, EventArgs e)
        {
            RoleBE  role    = new RoleBE();
            RoleBAL roleBAL = new RoleBAL();
            int     RoleId  = Convert.ToInt32(hdnRoleId.Value);

            role.RoleId = Convert.ToInt32(RoleId);
            if (roleBAL.DeleteRole(role))
            {
                if (LvRoleItems.Items.Count == 1)
                {
                    RoleDataPager.SetPageProperties(RoleDataPager.TotalRowCount - RoleDataPager.PageSize - 1,
                                                    RoleDataPager.PageSize, true);
                    bind();
                    recalcNoOfPages();
                    LoggedIn master = (LoggedIn)this.Master;
                    master.ShowMessage("Role successfully deleted.", true);
                }
                else
                {
                    LvRoleItems.EditIndex = -1;
                    bind();
                    recalcNoOfPages();
                    LoggedIn master = (LoggedIn)this.Master;
                    master.ShowMessage("Role successfully deleted.", true);
                }
            }
            else
            {
                LoggedIn master = (LoggedIn)this.Master;
                master.ShowMessage("Sorry You cannot delete Role because it is already in use", false);
                recalcNoOfPages();
            }
        }
        protected void PageJump_SelectedIndexChanged(object sender, EventArgs e)
        {
            DropDownList PageJumpDDL = (DropDownList)sender;
            int          pageNo      = Convert.ToInt32(PageJumpDDL.SelectedValue);

            int startRowIndex = (pageNo - 1) * RoleDataPager.PageSize;

            RoleDataPager.SetPageProperties(startRowIndex, RoleDataPager.PageSize, true);
            recalcNoOfPages();
        }