Example #1
0
        protected void gvDisplayUserInfo_SelectedIndexChanged(object sender, EventArgs e)
        {
            tvMenuRoleManagement.Nodes.Clear();
            GridViewRow row     = gvDisplayUserInfo.SelectedRow;
            int         loginId = string.IsNullOrEmpty(gvDisplayUserInfo.DataKeys[row.RowIndex].Values[0].ToString()) ? 0 : Convert.ToInt32(gvDisplayUserInfo.DataKeys[row.RowIndex].Values[0]);
            int         roleId  = string.IsNullOrEmpty(gvDisplayUserInfo.DataKeys[row.RowIndex].Values[1].ToString()) ? 0 : Convert.ToInt32(gvDisplayUserInfo.DataKeys[row.RowIndex].Values[1]);

            LinkButton lb         = (row.FindControl("lnkBtn") as LinkButton);
            string     actionType = lb.Text;

            hfLoginId.Value = loginId.ToString();

            if (actionType == "Modify Role" || actionType == "Assign Role")
            {
                ModalPopupForAssignRoleAndMenu.Show();

                txtSelectedUserName.Text      = gvDisplayUserInfo.SelectedRow.Cells[0].Text;
                ddlUserRoleList.SelectedValue = roleId.ToString();
                GetTreeViewItems(loginId, roleId);
                pnlAssignRole.Visible        = true;
                tvMenuRoleManagement.Visible = true;
                btnAssignRole.Visible        = false;
            }
            else
            {
                ModalActiveUserStatus.Show();
                pnlActiveUserStatus.Visible = true;

                txtUserNameForUpdateStatus.Text = gvDisplayUserInfo.SelectedRow.Cells[0].Text;
                ddlUserRoleListForUpdateStatus.ClearSelection();
                ddlUserRoleListForUpdateStatus.Items.FindByText(gvDisplayUserInfo.SelectedRow.Cells[3].Text).Selected = true;
            }
        }
Example #2
0
 protected void ddlUserRoleList_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (ddlUserRoleList.SelectedIndex > 0)
     {
         ModalPopupForAssignRoleAndMenu.Show();
         tvMenuRoleManagement.Nodes.Clear();
         GetTreeViewItems(Convert.ToInt32(hfLoginId.Value), Convert.ToInt32(ddlUserRoleList.SelectedValue));
     }
     else
     {
         tvMenuRoleManagement.Nodes.Clear();
     }
 }