protected void loginControl_LoggedIn(object sender, EventArgs e) { ProfilesMembershipUser user = (ProfilesMembershipUser)Membership.GetUser(((Login)sender).UserName); // Get an instance of the ProfileCommon object ProfileCommon p = (ProfileCommon)ProfileCommon.Create(user.UserName, true); // Set our parameters from the custom authentication provider p.UserId = user.UserID; p.UserName = user.UserName; p.HasProfile = user.HasProfile; p.ProfileId = user.ProfileID; p.DisplayName = user.DisplayName; // Persist the profile data p.Save(); // Refetch the profile data Profile.Initialize(user.UserName, true); //Profile.GetProfile(user.UserName); if (HttpContext.Current.Request.QueryString["EditMyProfile"] != null) { Response.Redirect("~/ProfileEdit.aspx?From=Self&Person=" + user.ProfileID.ToString()); } }
protected void Page_Load(object sender, EventArgs e) { if (HttpContext.Current.Request.QueryString["ticket"] != null) { string ticket = HttpContext.Current.Request.QueryString["ticket"]; string strCheckAuth = ""; string[] TicketData; char[] splitter = { '|' }; string loginUsername; strCheckAuth = ticketUtil.CheckTicket(ConfigUtil.GetConfigItem("TicketApp"), ticket, ConfigUtil.GetConfigItem("TicketKey"), ConfigUtil.GetConfigItem("TicketPostUrl")); if (strCheckAuth.Length > 8) { TicketData = strCheckAuth.Split(splitter); loginUsername = TicketData[0]; ProfilesMembershipUser user = (ProfilesMembershipUser)Membership.GetUser(loginUsername); Profile.UserId = user.UserID; Profile.UserName = user.UserName; Profile.HasProfile = user.HasProfile; Profile.ProfileId = user.ProfileID; Profile.DisplayName = user.DisplayName; } Response.Redirect("~/"); } else { Response.Redirect(ConfigUtil.GetConfigItem("ConnectsLoginURL")); } }
protected void Page_Load(object sender, EventArgs e) { BindPageSize(); if (!IsPostBack) { if (!string.IsNullOrEmpty(Request.QueryString["ShowUser"])) { int l_UserID; if (int.TryParse(Request.QueryString["ShowUser"], out l_UserID)) { ProfilesMembershipUser l_user = (ProfilesMembershipUser) new ProfilesDBMembershipProviderBL().GetUserByID(l_UserID); if (l_user != null) { int userPosition = new ProfilesDBMembershipProviderBL().GetUserPosition(l_user.UserID); int recordsAtPage = userPosition / gridUsers.PageSize; gridUsers.PageIndex = recordsAtPage; } } } if (Cache.Count == 0) { RefreshCache(); } } }
/// <summary> /// GetUser retrieves information from the users table into the /// profile of the asp.net application. /// </summary> /// <param name="username"></param> /// <param name="updateUserActivity"></param> /// <returns></returns> public override MembershipUser GetUser(string username, bool updateUserActivity) { ProfilesMembershipUser user = null; user = _membershipBL.GetUser(username, updateUserActivity); return(user); }
public ProfilesMembershipUser GetUser(string username, bool updateUserActivity) { DataRow userRow = null; ProfilesMembershipUser memberUser = null; userRow = new ProfilesDBMembershipProviderDA().GetUser(username, updateUserActivity); memberUser = GetUserFromTableRow(userRow); return(memberUser); }
// // MembershipProvider.GetUser(object, bool) // public override MembershipUser GetUser(object providerUserKey, bool userIsOnline) { ProfilesMembershipUser user = null; user = _membershipBL.GetUser(providerUserKey, userIsOnline); if (userIsOnline) { _membershipBL.LogLastUserLogin(user.UserName); } return(user); }
protected void btnGadgetLogin_Click(object sender, EventArgs e) { // first look at password if (!ConfigUtil.GetConfigItem("OpenSocialDevPassword").Equals(txtPassword.Text)) { return; } String userName = null; try { Database db = DatabaseFactory.CreateDatabase(); string sqlCommand = "select username from [user] where UserID = " + Int32.Parse(txtPersonId.Text) + ";"; DbCommand dbCommand = db.GetSqlStringCommand(sqlCommand); userName = (String)db.ExecuteScalar(dbCommand); ProfilesMembershipUser user = (ProfilesMembershipUser)Membership.GetUser(userName); // Get an instance of the ProfileCommon object ProfileCommon p = (ProfileCommon)ProfileCommon.Create(user.UserName, true); // Set our parameters from the custom authentication provider p.UserId = user.UserID; p.UserName = user.UserName; p.HasProfile = user.HasProfile; p.ProfileId = user.ProfileID; p.DisplayName = user.DisplayName; // Persist the profile data p.Save(); // Refetch the profile data Profile.Initialize(user.UserName, true); //Profile.GetProfile(user.UserName); FormsAuthentication.SetAuthCookie(userName, false); // add the gadgets Session[OpenSocialHelper.OPENSOCIAL_GADGETS] = txtGadgetURLS.Text; Session[OpenSocialHelper.OPENSOCIAL_DEBUG] = chkDebug.Checked; Session[OpenSocialHelper.OPENSOCIAL_NOCACHE] = !chkUseCache.Checked; Response.Redirect("~/Search.aspx"); } catch (Exception ex) { // do nothing } }
public ProfilesMembershipUser GetUser(object providerUserKey, bool userIsOnline) { IDataReader userReader; ProfilesMembershipUser memberUser = null; userReader = new ProfilesDBMembershipProviderDA().GetUser(providerUserKey, userIsOnline); if (((System.Data.SqlClient.SqlDataReader)userReader).HasRows) { userReader.Read(); memberUser = this.GetUserFromReader(userReader); } return(memberUser); }
private void LoadData() { if (UserID == null && !IsNewUser) { HideContent("UserID field cannot be null for edited user"); return; } divPassworArea.Visible = IsNewUser; tbFirstName.Focus(); if (UserID != null) { ProfilesMembershipUser l_EditUser = (ProfilesMembershipUser) new ProfilesDBMembershipProviderBL().GetUserByID(UserID.Value); if (l_EditUser == null || string.IsNullOrEmpty(l_EditUser.UserName)) { HideContent("User does not exist"); return; } tbFirstName.Text = l_EditUser.FirstName; tbLastName.Text = l_EditUser.LastName; tbLogin.Text = l_EditUser.UserName; tbEmail.Text = l_EditUser.Email; tbDepartmentFullname.Text = l_EditUser.DepartmentFullname; tbDivisionFullname.Text = l_EditUser.DivisionFullname; tbInstitutionFullname.Text = l_EditUser.InstitutionFullname; tbOfficePhone.Text = l_EditUser.OfficePhone; tbPasswordAnswer.Text = l_EditUser.PasswordAnswer; tbPasswordQuestion.Text = l_EditUser.PasswordQuestion; tbComments.Text = l_EditUser.Comment; hlPasword.Visible = UserInfo.Current.UserID == UserID.Value; BindRoles(Roles.GetAllRoles(), Roles.GetRolesForUser(l_EditUser.UserName)); } else { BindRoles(Roles.GetAllRoles(), null); } }
public static UserInfo LoadUserInfo(string p_Login) { //StoredProcedure sp = new StoredProcedure("p_UserName_s_byLogin"); //sp["@NTUserName"].Value = p_Login.Trim(); //DataTable l_dtRes = sp.ExecuteDataTable(); //if (l_dtRes.Rows.Count == 0) return null; //DataRow l_UserInfo = l_dtRes.Rows[0]; //return new UserInfo((int)l_UserInfo["UserNameID"], l_UserInfo["UserID"] != DBNull.Value ? (int?)(int)l_UserInfo["UserID"] : null, l_UserInfo["NTUserName"].ToString()); ProfilesMembershipUser l_User = (ProfilesMembershipUser)Membership.GetUser(p_Login); if (l_User == null) { return(null); } return(new UserInfo(l_User.UserID, l_User.UserName, l_User.FullName)); }
/// <summary> /// The ValidateUser method is called first during login processing. /// /// Additional Information: Depending on the implementation of your external authentication mechanism /// you may want to consider customizing the login.aspx page to simulate the forms login process, which /// will, in turn, call this method to validate the user. /// /// In an SSO situation, you may have a one-time security token vs. a password, but this token can be /// used in the login process and then verified using the ValidateUser method. /// /// Alternatively, your implementation may choose to call this method directly. /// </summary> /// <param name="username"></param> /// <param name="password"></param> /// <returns></returns> public override bool ValidateUser(string username, string password) { bool isValid = false; string strTicket = ""; //Get the ticket if it exists //strTicket = (string)HttpContext.Current.Request.QueryString["ticket"]; //string ticket = ticketUtil.CreateTicket(ticketApp, "ecom", Profile.UserName.ToString(), ticketKey, ticketPostUrl); strTicket = _ticketUtil.CreateTicket(_ticketApp, "ecom", username, _ticketKey, _secretKey); string strTicket2 = strTicket.Substring(7); if (strTicket != null) { string strCheckAuth = ""; string[] TicketData; char[] splitter = { '|' }; strCheckAuth = _ticketUtil.CheckTicket(_ticketApp, strTicket2, _ticketKey, _secretKey); if (strCheckAuth.Length > 0) { ProfileCommon pc = (ProfileCommon)HttpContext.Current.Profile; TicketData = strCheckAuth.Split(splitter); ProfilesMembershipUser user = GetUser(TicketData[0], true) as ProfilesMembershipUser; pc.UserId = user.UserID; pc.UserName = user.UserName; pc.HasProfile = user.HasProfile; pc.ProfileId = user.ProfileID; isValid = true; } } return(isValid); }
// PRG: Refactor these ordinal references // // GetUserFromReader // A helper function that takes the current row from the OdbcDataReader // and hydrates a MembershiUser from the values. Called by the // MembershipUser.GetUser implementation. // private ProfilesMembershipUser GetUserFromReader(IDataReader reader) { if (reader == null) return null; object providerUserKey = reader.GetValue(0); string username = ""; if (reader.GetValue(14) != DBNull.Value) username = reader.GetString(14); string email = ""; if (reader.GetValue(0) != DBNull.Value) email = reader.GetString(0); string passwordQuestion = ""; if (reader.GetValue(1) != DBNull.Value) passwordQuestion = reader.GetString(1); string comment = ""; if (reader.GetValue(2) != DBNull.Value) comment = reader.GetString(2); bool isApproved = false; if (reader.GetValue(3) != DBNull.Value) isApproved = reader.GetBoolean(3); bool isLockedOut = false; if (reader.GetValue(10) != DBNull.Value) isApproved = reader.GetBoolean(10); DateTime creationDate = new DateTime(); if (reader.GetValue(5) != DBNull.Value) creationDate = reader.GetDateTime(5); DateTime lastLoginDate = new DateTime(); if (reader.GetValue(6) != DBNull.Value) lastLoginDate = reader.GetDateTime(6); DateTime lastActivityDate = new DateTime(); if (reader.GetValue(7) != DBNull.Value) lastLoginDate = reader.GetDateTime(7); DateTime lastPasswordChangedDate = new DateTime(); if (reader.GetValue(8) != DBNull.Value) lastLoginDate = reader.GetDateTime(8); DateTime lastLockedOutDate = new DateTime(); if (reader.GetValue(11) != DBNull.Value) lastLockedOutDate = reader.GetDateTime(11); int userId = 0; if (reader.GetValue(9) != DBNull.Value) userId = reader.GetInt32(9); bool hasProfile = false; if (reader.GetValue(12) != DBNull.Value) hasProfile = reader.GetBoolean(12); int profileId = 0; if (reader.GetValue(13) != DBNull.Value) profileId = reader.GetInt32(13); string displayName = ""; if (reader.GetValue(4) != DBNull.Value) displayName = reader.GetString(4); string firstName = null; string lastName = null; string departmentFullname = null; string divisionFullName = null; string institutionFullname = null; string officePhone = null; string passwordAnswer = null; ProfilesMembershipUser u = new ProfilesMembershipUser("ProfilesDBMembershipProvider", username, providerUserKey, email, passwordQuestion, comment, isApproved, isLockedOut, creationDate, lastLoginDate, lastActivityDate, lastPasswordChangedDate, lastLockedOutDate, hasProfile, userId, profileId, displayName, firstName, lastName, departmentFullname, divisionFullName, institutionFullname, officePhone, passwordAnswer); return u; }
private static ProfilesMembershipUser GetUserFromTableRow(DataRow tableRow) { if (tableRow == null) return null; object providerUserKey = null; if (tableRow.Table.Columns.Contains("providerUserKey")) { providerUserKey = tableRow["providerUserKey"] == DBNull.Value ? null : tableRow["providerUserKey"]; } string username = null; if (tableRow.Table.Columns.Contains("username")) { username = tableRow["username"] == DBNull.Value ? null : (string)tableRow["username"]; } string email = null; if (tableRow.Table.Columns.Contains("EmailAddr")) { email = tableRow["EmailAddr"] == DBNull.Value ? null : (string)tableRow["EmailAddr"]; } string passwordQuestion = ""; if (tableRow.Table.Columns.Contains("PasswordQuestion")) { passwordQuestion = tableRow["PasswordQuestion"] == DBNull.Value ? null : (string)tableRow["PasswordQuestion"]; } string comment = ""; if (tableRow.Table.Columns.Contains("comment")) { comment = tableRow["comment"] == DBNull.Value ? null : (string)tableRow["comment"]; } bool isApproved = false; if (tableRow.Table.Columns.Contains("IsApproved")) { isApproved = tableRow["IsApproved"] == DBNull.Value ? false : (bool)tableRow["IsApproved"]; } bool isLockedOut = false; if (tableRow.Table.Columns.Contains("IsLockedOut")) { isLockedOut = tableRow["IsLockedOut"] == DBNull.Value ? false : (bool)tableRow["IsLockedOut"]; } DateTime creationDate = new DateTime(); if (tableRow.Table.Columns.Contains("CreateDate")) { creationDate = tableRow["CreateDate"] == DBNull.Value ? DateTime.Now : (DateTime)tableRow["CreateDate"]; } DateTime lastLoginDate = new DateTime(); if (tableRow.Table.Columns.Contains("LastLoginDate")) { lastLoginDate = tableRow["LastLoginDate"] == DBNull.Value ? DateTime.Now : (DateTime)tableRow["LastLoginDate"]; } DateTime lastActivityDate = new DateTime(); if (tableRow.Table.Columns.Contains("LastActivityDate")) { lastActivityDate = tableRow["LastActivityDate"] == DBNull.Value ? DateTime.Now : (DateTime)tableRow["LastActivityDate"]; } DateTime lastPasswordChangedDate = new DateTime(); if (tableRow.Table.Columns.Contains("LastPasswordChangedDate")) { lastPasswordChangedDate = tableRow["LastPasswordChangedDate"] == DBNull.Value ? DateTime.Now : (DateTime)tableRow["LastPasswordChangedDate"]; } DateTime lastLockedOutDate = new DateTime(); if (tableRow.Table.Columns.Contains("LastLockoutDate")) { lastLockedOutDate = tableRow["LastLockoutDate"] == DBNull.Value ? DateTime.Now : (DateTime)tableRow["LastLockoutDate"]; } int userId = 0; if (tableRow.Table.Columns.Contains("userId")) { if (tableRow["userId"] != DBNull.Value) { userId = (int)tableRow["userId"]; } } bool hasProfile = false; if (tableRow.Table.Columns.Contains("hasProfile")) { hasProfile = tableRow["hasProfile"] == DBNull.Value ? false : (bool)tableRow["hasProfile"]; } int profileId = 0; if (tableRow.Table.Columns.Contains("profileId")) { if (tableRow["profileId"] != DBNull.Value) { int.TryParse(Convert.ToString(tableRow["profileId"]), out profileId); } } string displayName = ""; if (tableRow.Table.Columns.Contains("displayName")) { displayName = tableRow["displayName"] == DBNull.Value ? null : (string)tableRow["displayName"]; } string firstName = null; if (tableRow.Table.Columns.Contains("firstName")) { firstName = tableRow["firstName"] == DBNull.Value ? null : (string)tableRow["firstName"]; } string lastName = null; if (tableRow.Table.Columns.Contains("lastName")) { lastName = tableRow["lastName"] == DBNull.Value ? null : (string)tableRow["lastName"]; } string departmentFullname = null; if (tableRow.Table.Columns.Contains("departmentFullname")) { departmentFullname = tableRow["departmentFullname"] == DBNull.Value ? null : (string)tableRow["departmentFullname"]; } string divisionFullName = null; if (tableRow.Table.Columns.Contains("divisionFullName")) { divisionFullName = tableRow["divisionFullName"] == DBNull.Value ? null : (string)tableRow["divisionFullName"]; } string institutionFullname = null; if (tableRow.Table.Columns.Contains("institutionFullname")) { institutionFullname = tableRow["institutionFullname"] == DBNull.Value ? null : (string)tableRow["institutionFullname"]; } string officePhone = null; if (tableRow.Table.Columns.Contains("officePhone")) { officePhone = tableRow["officePhone"] == DBNull.Value ? null : (string)tableRow["officePhone"]; } string passwordAnswer = null; if (tableRow.Table.Columns.Contains("passwordAnswer")) { passwordAnswer = tableRow["passwordAnswer"] == DBNull.Value ? null : (string)tableRow["passwordAnswer"]; } ProfilesMembershipUser u = new ProfilesMembershipUser("ProfilesDBMembershipProvider", username, providerUserKey, email, passwordQuestion, comment, isApproved, isLockedOut, creationDate, lastLoginDate, lastActivityDate, lastPasswordChangedDate, lastLockedOutDate, hasProfile, userId, profileId, displayName, firstName, lastName, departmentFullname, divisionFullName, institutionFullname, officePhone, passwordAnswer); return u; }
private static ProfilesMembershipUser GetUserFromTableRow(DataRow tableRow) { if (tableRow == null) { return(null); } object providerUserKey = null; if (tableRow.Table.Columns.Contains("providerUserKey")) { providerUserKey = tableRow["providerUserKey"] == DBNull.Value ? null : tableRow["providerUserKey"]; } string username = null; if (tableRow.Table.Columns.Contains("username")) { username = tableRow["username"] == DBNull.Value ? null : (string)tableRow["username"]; } string email = null; if (tableRow.Table.Columns.Contains("EmailAddr")) { email = tableRow["EmailAddr"] == DBNull.Value ? null : (string)tableRow["EmailAddr"]; } string passwordQuestion = ""; if (tableRow.Table.Columns.Contains("PasswordQuestion")) { passwordQuestion = tableRow["PasswordQuestion"] == DBNull.Value ? null : (string)tableRow["PasswordQuestion"]; } string comment = ""; if (tableRow.Table.Columns.Contains("comment")) { comment = tableRow["comment"] == DBNull.Value ? null : (string)tableRow["comment"]; } bool isApproved = false; if (tableRow.Table.Columns.Contains("IsApproved")) { isApproved = tableRow["IsApproved"] == DBNull.Value ? false : (bool)tableRow["IsApproved"]; } bool isLockedOut = false; if (tableRow.Table.Columns.Contains("IsLockedOut")) { isLockedOut = tableRow["IsLockedOut"] == DBNull.Value ? false : (bool)tableRow["IsLockedOut"]; } DateTime creationDate = new DateTime(); if (tableRow.Table.Columns.Contains("CreateDate")) { creationDate = tableRow["CreateDate"] == DBNull.Value ? DateTime.Now : (DateTime)tableRow["CreateDate"]; } DateTime lastLoginDate = new DateTime(); if (tableRow.Table.Columns.Contains("LastLoginDate")) { lastLoginDate = tableRow["LastLoginDate"] == DBNull.Value ? DateTime.Now : (DateTime)tableRow["LastLoginDate"]; } DateTime lastActivityDate = new DateTime(); if (tableRow.Table.Columns.Contains("LastActivityDate")) { lastActivityDate = tableRow["LastActivityDate"] == DBNull.Value ? DateTime.Now : (DateTime)tableRow["LastActivityDate"]; } DateTime lastPasswordChangedDate = new DateTime(); if (tableRow.Table.Columns.Contains("LastPasswordChangedDate")) { lastPasswordChangedDate = tableRow["LastPasswordChangedDate"] == DBNull.Value ? DateTime.Now : (DateTime)tableRow["LastPasswordChangedDate"]; } DateTime lastLockedOutDate = new DateTime(); if (tableRow.Table.Columns.Contains("LastLockoutDate")) { lastLockedOutDate = tableRow["LastLockoutDate"] == DBNull.Value ? DateTime.Now : (DateTime)tableRow["LastLockoutDate"]; } int userId = 0; if (tableRow.Table.Columns.Contains("userId")) { if (tableRow["userId"] != DBNull.Value) { userId = (int)tableRow["userId"]; } } bool hasProfile = false; if (tableRow.Table.Columns.Contains("hasProfile")) { hasProfile = tableRow["hasProfile"] == DBNull.Value ? false : (bool)tableRow["hasProfile"]; } int profileId = 0; if (tableRow.Table.Columns.Contains("profileId")) { if (tableRow["profileId"] != DBNull.Value) { int.TryParse(Convert.ToString(tableRow["profileId"]), out profileId); } } string displayName = ""; if (tableRow.Table.Columns.Contains("displayName")) { displayName = tableRow["displayName"] == DBNull.Value ? null : (string)tableRow["displayName"]; } string firstName = null; if (tableRow.Table.Columns.Contains("firstName")) { firstName = tableRow["firstName"] == DBNull.Value ? null : (string)tableRow["firstName"]; } string lastName = null; if (tableRow.Table.Columns.Contains("lastName")) { lastName = tableRow["lastName"] == DBNull.Value ? null : (string)tableRow["lastName"]; } string departmentFullname = null; if (tableRow.Table.Columns.Contains("departmentFullname")) { departmentFullname = tableRow["departmentFullname"] == DBNull.Value ? null : (string)tableRow["departmentFullname"]; } string divisionFullName = null; if (tableRow.Table.Columns.Contains("divisionFullName")) { divisionFullName = tableRow["divisionFullName"] == DBNull.Value ? null : (string)tableRow["divisionFullName"]; } string institutionFullname = null; if (tableRow.Table.Columns.Contains("institutionFullname")) { institutionFullname = tableRow["institutionFullname"] == DBNull.Value ? null : (string)tableRow["institutionFullname"]; } string officePhone = null; if (tableRow.Table.Columns.Contains("officePhone")) { officePhone = tableRow["officePhone"] == DBNull.Value ? null : (string)tableRow["officePhone"]; } string passwordAnswer = null; if (tableRow.Table.Columns.Contains("passwordAnswer")) { passwordAnswer = tableRow["passwordAnswer"] == DBNull.Value ? null : (string)tableRow["passwordAnswer"]; } ProfilesMembershipUser u = new ProfilesMembershipUser("ProfilesDBMembershipProvider", username, providerUserKey, email, passwordQuestion, comment, isApproved, isLockedOut, creationDate, lastLoginDate, lastActivityDate, lastPasswordChangedDate, lastLockedOutDate, hasProfile, userId, profileId, displayName, firstName, lastName, departmentFullname, divisionFullName, institutionFullname, officePhone, passwordAnswer); return(u); }
// PRG: Refactor these ordinal references // // GetUserFromReader // A helper function that takes the current row from the OdbcDataReader // and hydrates a MembershiUser from the values. Called by the // MembershipUser.GetUser implementation. // private ProfilesMembershipUser GetUserFromReader(IDataReader reader) { if (reader == null) { return(null); } object providerUserKey = reader.GetValue(0); string username = ""; if (reader.GetValue(14) != DBNull.Value) { username = reader.GetString(14); } string email = ""; if (reader.GetValue(0) != DBNull.Value) { email = reader.GetString(0); } string passwordQuestion = ""; if (reader.GetValue(1) != DBNull.Value) { passwordQuestion = reader.GetString(1); } string comment = ""; if (reader.GetValue(2) != DBNull.Value) { comment = reader.GetString(2); } bool isApproved = false; if (reader.GetValue(3) != DBNull.Value) { isApproved = reader.GetBoolean(3); } bool isLockedOut = false; if (reader.GetValue(10) != DBNull.Value) { isApproved = reader.GetBoolean(10); } DateTime creationDate = new DateTime(); if (reader.GetValue(5) != DBNull.Value) { creationDate = reader.GetDateTime(5); } DateTime lastLoginDate = new DateTime(); if (reader.GetValue(6) != DBNull.Value) { lastLoginDate = reader.GetDateTime(6); } DateTime lastActivityDate = new DateTime(); if (reader.GetValue(7) != DBNull.Value) { lastLoginDate = reader.GetDateTime(7); } DateTime lastPasswordChangedDate = new DateTime(); if (reader.GetValue(8) != DBNull.Value) { lastLoginDate = reader.GetDateTime(8); } DateTime lastLockedOutDate = new DateTime(); if (reader.GetValue(11) != DBNull.Value) { lastLockedOutDate = reader.GetDateTime(11); } int userId = 0; if (reader.GetValue(9) != DBNull.Value) { userId = reader.GetInt32(9); } bool hasProfile = false; if (reader.GetValue(12) != DBNull.Value) { hasProfile = reader.GetBoolean(12); } int profileId = 0; if (reader.GetValue(13) != DBNull.Value) { profileId = reader.GetInt32(13); } string displayName = ""; if (reader.GetValue(4) != DBNull.Value) { displayName = reader.GetString(4); } string firstName = null; string lastName = null; string departmentFullname = null; string divisionFullName = null; string institutionFullname = null; string officePhone = null; string passwordAnswer = null; ProfilesMembershipUser u = new ProfilesMembershipUser("ProfilesDBMembershipProvider", username, providerUserKey, email, passwordQuestion, comment, isApproved, isLockedOut, creationDate, lastLoginDate, lastActivityDate, lastPasswordChangedDate, lastLockedOutDate, hasProfile, userId, profileId, displayName, firstName, lastName, departmentFullname, divisionFullName, institutionFullname, officePhone, passwordAnswer); return(u); }