public User(User u) { ID = u.ID; userName = u.userName; password = u.password; data = u.GetData(); userGroups = u.GetUserGroups(); }
public bool ModifyExistingUser(User u) { DataRow[] rows = _studentRecords.Users.Select("ID = '" + u.GetID() + "'"); if (rows.Length == 0) return false; StudentRecordsDataSet.UsersRow r = (StudentRecordsDataSet.UsersRow) rows[0]; r.UserName = u.GetUserName(); r.Password = u.GetPassword(); User.UserDemographicData d = u.GetData(); r.FirstName = d.GetFirstName(); r.LastName = d.GetLastName(); r.SocialSecurityNumber = d.GetSSN(); r.PhoneNumber = d.GetPhoneNumber(); r.PreferredEmailAddress = d.GetPreferredEmailAddress(); r.CurrentHomeAddress = d.GetCurrentHomeAddress(); r.City = d.GetCity(); r.State = d.GetState(); r.Country = d.GetCountry(); UpdateXml(); return true; }
public User GetUserByID(short id) { DataRow[] rows = _studentRecords.Users.Select("ID = '" + id + "'"); StudentRecordsDataSet.UsersRow r = (StudentRecordsDataSet.UsersRow)rows[0]; User user = new User(r.ID, r.UserName, r.Password, r.FirstName, r.LastName); user.SetUserGroups(GetUserGroups(r.ID)); User.UserDemographicData d = user.GetData(); if (rows[0][5] != DBNull.Value) d.SetSSN(r.SocialSecurityNumber); if (rows[0][6] != DBNull.Value) d.SetPhoneNumber(r.PhoneNumber); if (rows[0][7] != DBNull.Value) d.SetPreferredEmailAddress(r.PreferredEmailAddress); if (rows[0][8] != DBNull.Value) d.SetCurrentHomeAddress(r.CurrentHomeAddress); if (rows[0][9] != DBNull.Value) d.SetCity(r.City); if (rows[0][10] != DBNull.Value) d.SetState(r.State); if (rows[0][11] != DBNull.Value) d.SetCountry(r.Country); return user; }
public User GetUser(String uName, String pWord) { String expression = "UserName = '******'"; expression += " AND "; expression += "Password = '******'"; DataRow[] rows = _studentRecords.Users.Select(expression); StudentRecordsDataSet.UsersRow r = (StudentRecordsDataSet.UsersRow)rows[0]; User user = new User(r.ID, r.UserName, r.Password, r.FirstName, r.LastName); user.SetUserGroups(GetUserGroups(r.ID)); User.UserDemographicData d = user.GetData(); if(rows[0][5] != DBNull.Value) d.SetSSN(r.SocialSecurityNumber); if(rows[0][6] != DBNull.Value) d.SetPhoneNumber(r.PhoneNumber); if(rows[0][7] != DBNull.Value) d.SetPreferredEmailAddress(r.PreferredEmailAddress); if(rows[0][8] != DBNull.Value) d.SetCurrentHomeAddress(r.CurrentHomeAddress); if(rows[0][9] != DBNull.Value) d.SetCity(r.City); if(rows[0][10] != DBNull.Value) d.SetState(r.State); if(rows[0][11] != DBNull.Value) d.SetCountry(r.Country); return user; }