protected void ViewRoles() { RolesBSO rolesBSO = new RolesBSO(); DataTable table = rolesBSO.GetAllRoles(); DataView dataView = new DataView(table); dataView.RowFilter = "Roles_Name not in ('adminsys32','Administrators')"; DataTable dataTable = dataView.ToTable(); commonBSO commonBSO = new commonBSO(); commonBSO.FillToGridView(grvRoles, dataTable); }
private void ViewRolesAll() { RolesBSO rolesBSO = new RolesBSO(); DataTable table = rolesBSO.GetAllRoles(); DataView dataView = new DataView(table); dataView.RowFilter = "Roles_Name not in ('adminsys32','Administrators')"; DataTable dataTable = dataView.ToTable(); grvRoles.DataSource = dataTable; grvRoles.DataBind(); }
private void ViewRolesAll() { RolesBSO rolesBSO = new RolesBSO(); DataTable table = rolesBSO.GetAllRoles(); DataView dataView = new DataView(table); dataView.RowFilter = "Roles_Name not in ('adminsys32','Administrators')"; DataTable dataTable = dataView.ToTable(); RadGrid1.DataSource = dataTable; RadGrid1.DataBind(); }
public void ViewRoles() { ddlRoles.Items.Clear(); RolesBSO rolesBSO = new RolesBSO(); DataTable table = rolesBSO.GetAllRoles(); DataView dataView = new DataView(table); dataView.RowFilter = "Roles_Name NOT IN ('adminsys32','Administrators')"; DataTable dataTable = dataView.ToTable(); commonBSO commonBSO = new commonBSO(); commonBSO.FillToDropDown(ddlRoles, dataTable, "~~ Trong tất cả các nhóm ~~", "0", "Roles_Name", "Roles_ID", ""); }
public string RolesNameByUserName(string userName) { string strRolesID = new AdminRolesDAO().GetRoles1(userName); DataTable dt = new DataTable(); RolesBSO roleBSO = new RolesBSO(); DataTable dt2 = new DataView(roleBSO.GetAllRoles()) { RowFilter = "Roles_ID IN(" + strRolesID + ")" }.ToTable(); if (dt2.Rows.Count == 0) { return "Administrators"; } if ((dt2.Rows.Count == 1) && (dt2.Rows[0]["Roles_Name"].ToString().ToLower() == "guest")) { return "Guest"; } string strRoles = ""; for (int i = 0; i < dt2.Rows.Count; i++) { strRoles = strRoles + dt2.Rows[i]["Roles_Name"].ToString(); } if (strRoles.ToLower().Contains("admin")) { return "admin"; } return "mod"; }