public User(User u)
        {
            ID = u.ID;
            userName = u.userName;
            password = u.password;

            data = u.GetData();
            userGroups = u.GetUserGroups();
        }
        private void LoadMembersAndComponents()
        {
            user = Session.Instance.GetUser();
            this.UserName_textBox.Text = user.GetUserName();
            this.Password_textBox.Text = user.GetPassword();

            data = user.GetData();
            this.FirstName_textBox.Text = data.GetFirstName();
            this.LastName_textBox.Text = data.GetLastName();
            this.SSN_textBox.Text = data.GetSSN();
            this.PhoneNumber_textBox.Text = data.GetPhoneNumber();
            this.EmailAddress_textBox.Text = data.GetPreferredEmailAddress();
            this.HomeAddress_textBox.Text = data.GetCurrentHomeAddress();
            this.City_textBox.Text= data.GetCity();
            this.State_textBox.Text = data.GetState();
            this.Country_textBox.Text = data.GetCountry();
        }
        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 void AddInstructor(User i)
 {
     instructors.Add(i);
 }
 public void setTA(User ta)
 {
     TA = ta;
 }
 public void RemoveInstructor(User i)
 {
     instructors.Remove(i);
 }
        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;
        }
 public Employee(User u, short e_id)
     : base(u)
 {
     ID = e_id;
 }
 public bool UserExists(User u)
 {
     if (u.Equals(user)) return true;
     return false;
 }
 public void SetUser(User u)
 {
     user = u;
     accessLevels = user.GetUserGroups();
     accessRights = user.GetAccessRights();
 }
 public Student(User u, short s_ID)
     : base(u)
 {
     ID = s_ID;
     transcript = new Transcript();
 }