public void PopulateGrid() { objclsBALUsers = new clsBALUsers(); DataSet ds = objclsBALUsers.GetUserDetails(); gvRole.DataSource = ds; gvRole.DataBind(); Session[clsEALSession.UserDetails] = ds; if (ViewState["SortExpression"] != null && ViewState["sortDirection"] != null) { SortGridView(ViewState["SortExpression"].ToString(), ViewState["sortDirection"].ToString()); } }
public void deleteUserNotExisting() { objclsBALUsers = new clsBALUsers(); DataSet ds = objclsBALUsers.GetUserDetails(); if (ds != null) { if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { string strUSERADID = ds.Tables[0].Rows[i][4].ToString(); clsEALUser objclsEALUser = new clsEALUser(); clsBALCommon objclsBALCommon = new clsBALCommon(); objclsEALUser = objclsBALCommon.FetchUserDetailsFromAD(strUSERADID); if (objclsEALUser == null) { objclsBALUsers.DeleteUserFromDb(strUSERADID); } } } } }