Ejemplo n.º 1
0
        public Form3(List <UserStudent> S, UserFaculty F, List <Course> C, int number)
        {
            Me    = F;
            Stud  = S;
            Crs   = C;
            state = number;

            InitializeComponent();

            if (state == 0)
            {
                Text = Me.UserName + " is viewing the Course List.";
                AllSchedule();
            }
            if (state == 1)
            {
                Text         = Me.UserName + " is viewing his/her courses taught.";
                Sbutton.Text = "View the full Course Schedule";
                MeSchedule();
            }

            if (state == 2)
            {
                Text = Me.UserName + " is viewing his/her Advising screen.";
                ADList();
            }
        }
Ejemplo n.º 2
0
        public Form3(List<UserStudent> S, UserFaculty F, List<Course> C ,int number)
        {
            Me = F;
            Stud = S;
            Crs = C;
            state = number;

            InitializeComponent();

            if (state == 0)
            {
                Text = Me.UserName + " is viewing the Course List.";
                AllSchedule();
            }
            if (state == 1)
            {
                Text = Me.UserName + " is viewing his/her courses taught.";
                Sbutton.Text = "View the full Course Schedule";
                MeSchedule();
            }

            if (state == 2)
            {
                Text = Me.UserName + " is viewing his/her Advising screen.";
                ADList();
            }
        }
Ejemplo n.º 3
0
        public Form3(List <UserStudent> S, UserStudent s, UserFaculty F, List <Course> C, int number)
        {
            Me     = F;
            Stud   = S;
            Crs    = C;
            state  = number;
            little = s;

            if (state == 3)
            {
                //dataGridView1.Hide();

                foreach (Course C0 in Crs)
                {
                    if (little.MyCourses.Contains(C0.CourseName))
                    {
                        stdCourses.Add(C0);
                    }
                }

                dataGridView1.DataSource = stdCourses;
                //dataGridView1.Refresh();
                //dataGridView1.Show();
            }
        }
Ejemplo n.º 4
0
        public Form3(List<UserStudent> S, UserStudent s,  UserFaculty F, List<Course> C, int i)
        {
            Me = F;
            Stud = S;
            Crs = C;
            little = s;

            if (i == 0)
                FormState = FacFormState.studentsched;
            if (i == 1)
                FormState = FacFormState.studentcurrent;

            InitializeComponent();
            RareButton.Hide();

                //dataGridView1.Hide();
            if (FormState == FacFormState.studentsched)
            {
                foreach (Course C0 in Crs)
                    if (little.MyCourses.Contains(C0.CourseName))
                        stdCourses.Add(C0);
                Sbutton.Text = "Show Conflicts.";
                AButton.Text = "Back";
                dataGridView1.DataSource = stdCourses;

                if (!little.hasConflicts)
                    Sbutton.Hide();

            }
            if (FormState == FacFormState.studentcurrent)
            {
                Sbutton.Hide();
                List<PastCourse> relevant = new List<PastCourse>();
                foreach (PastCourse P in little.MyPastCourses)
                {
                    if (P.Term == "F12")
                    {
                        relevant.Add(P);
                    }
                }

                dataGridView1.DataSource = relevant;

            }

            //dataGridView1.Refresh();
            //dataGridView1.Show();
        }
Ejemplo n.º 5
0
        public Form3(List<UserStudent> S, UserFaculty F, List<Course> C ,int number)
        {
            InitializeComponent();
            Me = F;
            Stud = S;
            Crs = C;

            switch (number)
            {
                case 1: FormState = FacFormState.mycourses;
                        Text = Me.UserName + " is viewing his/her courses taught.";
                        AButton.Text = "View future Students";
                        Sbutton.Text = "View the full Course Schedule";
                        RareButton.Hide();
                        MeSchedule();
                    break;

                case 2: FormState = FacFormState.myadvisees;
                        Text = Me.UserName + " is viewing his/her Advising screen.";
                        AButton.Text = "Back";
                        RareButton.Text = "Verify Grades";
                        Sbutton.Text = "Verify Schedule";
                        ADList();
                    break;

                case 4: FormState = FacFormState.myfutstudents;
                        Text = Me.UserName + " is viewing his/her Future students.";
                        AButton.Text = "Back";
                        Sbutton.Hide();
                        RareButton.Hide();
                        FutStdList();
                    break;

                default: FormState = FacFormState.allcourses;
                         Text = Me.UserName + " is viewing the Course List.";
                         RareButton.Hide();
                         AllSchedule();

                    break;
            }
        }
Ejemplo n.º 6
0
        public Form3(List<UserStudent> S, UserStudent s,  UserFaculty F, List<Course> C, int number)
        {
            Me = F;
            Stud = S;
            Crs = C;
            state = number;
            little = s;

            if (state == 3)
            {
                //dataGridView1.Hide();

                foreach (Course C0 in Crs)
                    if (little.MyCourses.Contains(C0.CourseName))
                        stdCourses.Add(C0);

                dataGridView1.DataSource = stdCourses;
                //dataGridView1.Refresh();
                //dataGridView1.Show();

            }
        }
Ejemplo n.º 7
0
        static void Main()
        {
            StreamReader filereader;

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //UserAdmin u1 = new UserAdmin();
            //UserFaculty u2 = new UserFaculty();
            //UserStudent u3 = new UserStudent();

            List <UserAdmin> ads = new List <UserAdmin>();
            //ads.Add(u1);
            List <UserFaculty> fcs = new List <UserFaculty>();
            //fcs.Add(u2);
            List <UserStudent> std = new List <UserStudent>();
            //std.Add(u3);
            List <String>     timeblocks = new List <string>();
            List <Course>     Courses    = new List <Course>();
            List <PastCourse> past       = new List <PastCourse>();

            //crs.Add(new Course());

            try
            {
                filereader = new StreamReader("UserInput.txt");
                string line = "Yes";
                string username;
                string password;
                string firstn;
                string middlen;
                string lastn;
                string status;

                while (line != null)
                {
                    line = filereader.ReadLine();
                    if (line != null)
                    {
                        username = line.Substring(0, 10).Trim();
                        password = line.Substring(10, 10).Trim();
                        firstn   = line.Substring(20, 15).Trim();
                        middlen  = line.Substring(35, 15).Trim();
                        lastn    = line.Substring(50, 15).Trim();
                        status   = line.Substring(65).Trim();

                        if (status.Contains("admin"))
                        {
                            UserAdmin A = new UserAdmin(username, password, firstn, middlen, lastn);
                            ads.Add(A);
                        }
                        else if (status.Contains("faculty"))
                        {
                            UserFaculty F = new UserFaculty(username, password, firstn, middlen, lastn);
                            fcs.Add(F);
                        }
                        else
                        {
                            UserStudent S = new UserStudent(username, password, firstn, middlen, lastn, status);
                            std.Add(S);
                        }
                    }
                    else
                    {
                        filereader.Close();
                        //button1.Visible = false;
                        //MessageBox.Show("File");
                    }
                }
            }
            catch (EndOfStreamException)
            { }



            //try
            //{
            //    StreamReader freader;
            //    freader = new StreamReader("ClassInput.txt");
            //    string line = "Yes";
            //    string cName;
            //    string itle;
            //    string cInst;
            //    string cSeat;
            //    string cCred;
            //    string cNumTimes;
            //    line = freader.ReadLine();

            //    while (line != null)
            //    {
            //        if (line != null)
            //        {
            //            cName = line.Substring(0, 11).Trim();
            //            itle = line.Substring(11, 16).Trim();
            //            cInst = line.Substring(27, 11).Trim();
            //            cCred = line.Substring(38, 5).Trim();
            //            cSeat = line.Substring(43, 4).Trim();
            //            cNumTimes = line.Substring(47, 2).Trim();
            //            string timeline = line.Substring(49).Trim();
            //            int numTimes = Convert.ToInt16(cNumTimes);

            //            for (int i = 0; i < numTimes; i++)
            //            {
            //                int begin = (0 + (i * 5));
            //                timeblocks.Add(timeline.Substring(begin, 5));
            //            }

            //            Course myCourse = new Course(cName, itle, cInst,
            //                Convert.ToDouble(cCred), Convert.ToInt16(cSeat), timeblocks);
            //            Courses.Add(myCourse);

            //            //MessageBox.Show("There are " + Courses.Count + " Courses.");

            //        }

            //        line = freader.ReadLine();
            //    }
            //    freader.Close();
            //    MessageBox.Show("File is now complete.");

            //}
            //catch
            //{
            //    MessageBox.Show("There was an Error");
            //}

            //Application.Run(new Form4(ads, std,fcs));
            Application.Run(new CourseParseForm(Courses, ads, fcs, std));
            //Application.Run(new Sloppyform(ads, std, fcs));
            //Application.Run(new LoginForm(ads,fcs,std,crs));
        }
Ejemplo n.º 8
0
 public UserFaculty(UserFaculty F)
 {
     UserName = F.UserName;
     password = F.password;
 }
Ejemplo n.º 9
0
        private void killButton_Click(object sender, EventArgs e)
        {
            if (state == adminstate.student)
            {
                studstate = studentstate.skill;
                button1.Enabled = false;
                AdvisorButton.Enabled = false;
                int studentindex = dataGridView1.SelectedRows[0].Index;
                YesButton.Text = "Yes";
                NoButton.Text = "No";
                showDetail();
                DetailBox.Text = "Delete " + StudentList[studentindex].UserName + "?";
            }
            if (state == adminstate.faculty)
            {
                button1.Enabled = false;
                AdvisorButton.Enabled = false;
                asthisfaculty = FacultyList[dataGridView1.SelectedRows[0].Index];
                DetailBox.Text = "Delete " + asthisfaculty.UserName + "?";
                YesButton.Text = "Yes";
                NoButton.Text = "No";
                showDetail();

            }

            if (state == adminstate.crs)
            {
                button1.Enabled = false;
                AdvisorButton.Enabled = false;
                thisCourse = Courses[dataGridView1.SelectedRows[0].Index];
                DetailBox.Text = "Delete " + thisCourse.CourseTitle + "?";
                YesButton.Text = "Yes";
                NoButton.Text = "No";
                showDetail();
            }
        }
Ejemplo n.º 10
0
        private void button1_Click(object sender, EventArgs e)
        {
            switch (state)
            {

                case adminstate.dflt: { } break; //Do nothing.
                case adminstate.student:
                    if (studstate == studentstate.sviewall)
                    {
                        asthisstudent = StudentList[dataGridView1.SelectedRows[0].Index];
                        //MessageBox.Show("Student : " + asthisstudent.FirstName + " " + asthisstudent.LastName);
                        studstate = studentstate.ssched;
                        this.Text = "View/Change " + asthisstudent.UserName + "'s course schedule.";
                        List<Course> StdCrs = new List<Course>();
                        foreach (Course C in Courses)
                        {
                            if (asthisstudent.MyCourses.Contains(C.CourseName))
                            {
                                StdCrs.Add(C);
                            }
                        }
                        dataGridView1.DataSource = StdCrs;
                        AdvisorButton.Hide();
                        button1.Text = "Student List";
                        FastRegButton.Text = "View all courses";
                        FastRegButton.Show();
                    }
                    else
                    {
                        //state = adminstate.dflt;
                        //AdvisorButton.Show();
                        //MessageBox.Show("State 2b");
                        IVS();

                    }
                    break;
                case adminstate.faculty:
                    {
                        asthisfaculty = FacultyList[dataGridView1.SelectedRows[0].Index];
                        List<String> myCrsStringList = asthisfaculty.MyClasses;

                        foreach (Course c in Courses)
                        {
                            if (c.Instructor == asthisfaculty.UserName)
                            {
                                facCourse.Add(c);
                            }
                        }
                        dataGridView2.DataSource = facCourse;
                        dataGridView2.Show();
                    }
                    break;
                case adminstate.crs:
                    {
                        newNames = new List<String>(); //This prevents a hilarious error.
                        cadst = courseadminstate.name;
                        thisCourse = Courses[dataGridView1.SelectedRows[0].Index];
                        DetailBox.Text = "Course Name = " + thisCourse.CourseName + ".";
                        YesButton.Text = "Change?";
                        NoButton.Text = "Cancel Changes";
                        TrueNo.Show();
                        showDetail();
                    }
                    break;
                default: //MessageBox.Show("CASE 3");
                    break;
            }
        }
Ejemplo n.º 11
0
 public Form3(List<UserStudent> S, UserFaculty F, List<Course> C)
     : this(S,F,C,0)
 {
 }
Ejemplo n.º 12
0
        static void Main()
        {
            StreamReader filereader;
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //UserAdmin u1 = new UserAdmin();
            //UserFaculty u2 = new UserFaculty();
            //UserStudent u3 = new UserStudent();

            List<UserAdmin> ads = new List<UserAdmin>();
            //ads.Add(u1);
            List<UserFaculty> fcs = new List<UserFaculty>();
            //fcs.Add(u2);
            List<UserStudent> std = new List<UserStudent>();
            //std.Add(u3);
            List<String> timeblocks = new List<string>();
            List<Course> Courses = new List<Course>();
            List<PastCourse> past = new List<PastCourse>();

            //crs.Add(new Course());

            try
            {
                filereader = new StreamReader("UserInput.txt");
                string line = "Yes";
                string username;
                string password;
                string firstn;
                string middlen;
                string lastn;
                string status;

                while (line != null)
                {
                    line = filereader.ReadLine();
                    if (line != null)
                    {
                        username = line.Substring(0, 10).Trim();
                        password = line.Substring(10, 10).Trim();
                        firstn = line.Substring(20, 15).Trim();
                        middlen = line.Substring(35, 15).Trim();
                        lastn = line.Substring(50, 15).Trim();
                        status = line.Substring(65).Trim();

                        if (status.Contains("admin"))
                        {
                            UserAdmin A = new UserAdmin(username, password, firstn, middlen, lastn);
                            ads.Add(A);
                        }
                        else if (status.Contains("faculty"))
                        {
                            UserFaculty F = new UserFaculty(username, password, firstn, middlen, lastn);
                            fcs.Add(F);
                        }
                        else
                        {
                            UserStudent S = new UserStudent(username, password, firstn, middlen, lastn, status);
                            std.Add(S);
                        }
                    }
                    else
                    {
                        filereader.Close();
                        //button1.Visible = false;
                        //MessageBox.Show("File");
                    }

                }
            }
            catch (EndOfStreamException)
            { }

            //try
            //{
            //    StreamReader freader;
            //    freader = new StreamReader("ClassInput.txt");
            //    string line = "Yes";
            //    string cName;
            //    string itle;
            //    string cInst;
            //    string cSeat;
            //    string cCred;
            //    string cNumTimes;
            //    line = freader.ReadLine();

            //    while (line != null)
            //    {
            //        if (line != null)
            //        {
            //            cName = line.Substring(0, 11).Trim();
            //            itle = line.Substring(11, 16).Trim();
            //            cInst = line.Substring(27, 11).Trim();
            //            cCred = line.Substring(38, 5).Trim();
            //            cSeat = line.Substring(43, 4).Trim();
            //            cNumTimes = line.Substring(47, 2).Trim();
            //            string timeline = line.Substring(49).Trim();
            //            int numTimes = Convert.ToInt16(cNumTimes);

            //            for (int i = 0; i < numTimes; i++)
            //            {
            //                int begin = (0 + (i * 5));
            //                timeblocks.Add(timeline.Substring(begin, 5));
            //            }

            //            Course myCourse = new Course(cName, itle, cInst,
            //                Convert.ToDouble(cCred), Convert.ToInt16(cSeat), timeblocks);
            //            Courses.Add(myCourse);

            //            //MessageBox.Show("There are " + Courses.Count + " Courses.");

            //        }

            //        line = freader.ReadLine();
            //    }
            //    freader.Close();
            //    MessageBox.Show("File is now complete.");

            //}
            //catch
            //{
            //    MessageBox.Show("There was an Error");
            //}

            //Application.Run(new Form4(ads, std,fcs));
            Application.Run(new CourseParseForm(Courses, ads, fcs, std));
            //Application.Run(new Sloppyform(ads, std, fcs));
            //Application.Run(new LoginForm(ads,fcs,std,crs));
        }
Ejemplo n.º 13
0
 public UserFaculty(UserFaculty F)
 {
     UserName = F.UserName;
     password = F.password;
 }