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 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;
        }
        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 bool UserExists(User u)
 {
     if (u.Equals(user)) return true;
     return false;
 }
 public Student(User u, short s_ID)
     : base(u)
 {
     ID = s_ID;
     transcript = new Transcript();
 }
 public void SetUser(User u)
 {
     user = u;
     accessLevels = user.GetUserGroups();
     accessRights = user.GetAccessRights();
 }
 public void AddInstructor(User i)
 {
     instructors.Add(i);
 }
 public void setTA(User ta)
 {
     TA = ta;
 }
 public void RemoveInstructor(User i)
 {
     instructors.Remove(i);
 }
 public Employee(User u, short e_id)
     : base(u)
 {
     ID = e_id;
 }