Beispiel #1
0
 public history(Form input, userstruct inUser, bool readOnlyIn)
 {
     InitializeComponent();
     home        = input;
     currentUser = inUser;
     readOnly    = readOnlyIn;
 }
Beispiel #2
0
 public Home(Login loginPage, userstruct person)
 {
     InitializeComponent();
     login = loginPage;
     User  = person;
     if (User.type == "admin" || User.type == "manager")
     {
         //this.Height -= 45;
         button4.Visible = false;
         button4.Enabled = false;
         button5.Visible = false;
         button5.Enabled = false;
         button7.Show();
     }
     else if (User.type == "faculty")
     {
         button6.Show();
         button4.Visible = false;
         button4.Enabled = false;
     }
     else
     {
         button5.Visible = true;
         button5.Enabled = true;
         button4.Visible = false;
         button4.Enabled = false;
     }
 }
Beispiel #3
0
        public Classes(Form homePage, userstruct status, bool admin)
        {
            prevForm = homePage;
            InitializeComponent();
            User    = status;
            isAdmin = admin;
            comboBox1.Items.Clear();

            linqtoregdbDataContext db = new linqtoregdbDataContext();

            var queryCoursesOffered = from crs in db.courses
                                      where crs.semester == nextTerm
                                      select crs.courseName;

            //string line;
            //System.IO.StreamReader database = new System.IO.StreamReader("courses.in");
            //while (!database.EndOfStream)
            //{
            //line = database.ReadLine();
            foreach (var c in queryCoursesOffered)
            {
                string thing = "";
                for (int i = 0; c[i] != '-'; i++)
                {
                    thing += c[i];
                }
                if (!comboBox1.Items.Contains(thing))
                {
                    comboBox1.Items.Add(thing);
                }
            }
            //database.Close();
        }
Beispiel #4
0
 public FacultyHome(userstruct userIn, Form sendingWindow)
 {
     InitializeComponent();
     currentUser = userIn;
     prevWindow  = sendingWindow;
     isAdmin     = false;
 }
Beispiel #5
0
 public EditUsersForm(BaseForm aW, userstruct inUser)
 {
     InitializeComponent();
     adminWindow  = aW;
     User         = inUser;
     editMode     = false;
     selectedUser = -1;
 }
Beispiel #6
0
        private void button4_Click(object sender, EventArgs e)
        {
            userstruct userViewHistory = new userstruct();

            userViewHistory.username = listBox1.SelectedItem.ToString();

            history historyForm = new history(this, userViewHistory, false);

            historyForm.Show();
            this.Hide();
        }
Beispiel #7
0
        private void button7_Click(object sender, EventArgs e)
        {
            userstruct facultyToView = new userstruct();

            facultyToView.username = listBox1.SelectedItem.ToString();

            FacultyHome facultyWindow = new FacultyHome(facultyToView, this, true);

            facultyWindow.Show();
            this.Hide();
        }
Beispiel #8
0
        private void button6_Click(object sender, EventArgs e)
        {
            userstruct userAddClass = new userstruct();

            userAddClass.username = listBox1.SelectedItem.ToString();

            Classes classWindow = new Classes(this, userAddClass, true);

            classWindow.Show();
            this.Hide();
        }
Beispiel #9
0
 public ChangePassword(userstruct currentUser, Form form, bool administrator)
 {
     InitializeComponent();
     previous = form;
     User     = currentUser;
     admin    = administrator;
     if (admin)
     {
         textBox1.Hide();
         label1.Text = "Changing the password for user " + User.username;
     }
 }
Beispiel #10
0
        public EditTimeBlocksForm(BaseForm prevWindow, userstruct inUser, string courseNameIn)
        {
            InitializeComponent();
            prev       = prevWindow;
            courseName = courseNameIn;

            foreach (var c in TimeCheck.GetTimes(courseNameIn))
            {
                timeblocks.Add(c);
                listBox1.Items.Add(TimeShowFormat(c));
            }
        }
Beispiel #11
0
        public AddClassForm(BaseForm prevWindow, userstruct inUser)
        {
            prev = prevWindow;
            linqtoregdbDataContext db = new linqtoregdbDataContext();

            InitializeComponent();
            var queryAllFaculty = from usr in db.users
                                  where usr.usertype == "faculty"
                                  select usr;

            foreach (var c in queryAllFaculty)
            {
                comboBox1.Items.Add(c.username);
            }
        }
Beispiel #12
0
        private void button3_Click(object sender, EventArgs e)
        {
            if (listBox1.SelectedIndex != -1)
            {
                userstruct userChangePass = new userstruct();
                userChangePass.username = listBox1.SelectedItem.ToString();

                ChangePassword passwordWindow = new ChangePassword(userChangePass, this, true);
                passwordWindow.Show();
                this.Hide();
            }
            else
            {
                MessageBox.Show("Error - No user selected!");
            }
        }
        public EditClassesForm(BaseForm inWindow, userstruct inUser)
        {
            prevWindow  = inWindow;
            currentUser = inUser;
            InitializeComponent();
            editMode      = false;
            selectedIndex = -1;

            linqtoregdbDataContext db = new linqtoregdbDataContext();
            var queryGetInstructors   = from usr in db.users
                                        where usr.usertype == "faculty"
                                        select usr;

            foreach (var c in queryGetInstructors)
            {
                comboBox1.Items.Add(c.username);
            }
        }
Beispiel #14
0
 public AddUserForm(AdminWindow aW, userstruct inUser)
 {
     InitializeComponent();
     prevWindow  = aW;
     currentUser = inUser;
 }
Beispiel #15
0
 public AdminWindow(Form loginPage, userstruct person)
 {
     InitializeComponent();
     login = loginPage;
     User  = person;
 }
Beispiel #16
0
 public AddUserForm(EditUsersForm eUF, userstruct inUser)
 {
     InitializeComponent();
     prevWindow  = eUF;
     currentUser = inUser;
 }
Beispiel #17
0
 public ChangePassword(userstruct currentUser, Form form)
 {
     InitializeComponent();
     previous = form;
     User     = currentUser;
 }
 public FileHandlingForm(BaseForm prev, userstruct inUser)
 {
     InitializeComponent();
     prevWindow = prev;
 }