Ejemplo n.º 1
0
 public Consola(StudentServices ctrlS1, TemeServices ctrlT1, NoteServices ctrlN1)
 {
     ctrlN = ctrlN1;
     ctrlS = ctrlS1;
     ctrlT = ctrlT1;
 }
Ejemplo n.º 2
0
        private void ViewScore_Click(object sender, EventArgs e)
        {
            NotiLabel.Text     = "";
            EditButton.Enabled = true;
            Classes.Enabled    = true;
            Subjects.Enabled   = true;
            listViewInfo       = ListViewInfo.Scoreboard;

            _Id.Text     = "Student ID";
            _Id.Width    = 110;
            _Name.Text   = "Student name";
            _Name.Width  = 190;
            _Info1.Text  = "Class";
            _Info1.Width = 90;
            _Info2.Text  = "Subject ID";
            _Info2.Width = 110;
            _Info3.Text  = "Mid-term";
            _Info3.Width = 80;
            _Info4.Text  = "Final-term";
            _Info4.Width = 80;
            _Info5.Text  = "Other score";
            _Info5.Width = 80;
            _Info6.Text  = "Final score";
            _Info6.Width = 80;
            _Info7.Text  = "Pass";
            _Info7.Width = 60;

            listView.Items.Clear();
            listView.Columns.Clear();
            listView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[]
                                      { _No, _Id, _Name, _Info1, _Info2, _Info3, _Info4, _Info5, _Info6, _Info7 });

            try
            {
                StudentServices service = new StudentServices();
                var             Data    = service.GetScoreboardFromDB(Classes.SelectedItem.ToString(), Subjects.SelectedItem.ToString());
                int             pass    = 0;
                foreach (var data in Data)
                {
                    if (data.Info[6] == "Yes")
                    {
                        pass++;
                    }
                }
                BindDataToListView(Data);
                if (Classes.SelectedItem.ToString() != "All" && Subjects.SelectedItem.ToString() != "All")
                {
                    NotiLabel.Text = $"There are {pass} student(s) ({((float) pass / (float) Data.Count).ToString("p")}) " +
                                     $"of class {Classes.SelectedItem.ToString()} passed this subject.";
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            if (listView.Items.Count == 0)
            {
                NotiLabel.Text = "Nothing is found...";
            }
            listView.View = View.Details;
        }
Ejemplo n.º 3
0
 public StudentController(StudentServices studentServices)
 {
     _studentServices = studentServices;
 }
Ejemplo n.º 4
0
 public static bool IsExistSNO(string txt)
 {
     return(StudentServices.IsExistSNO(txt));
 }
Ejemplo n.º 5
0
 public StudentController(StudentServices service)
 {
     _service = service;
 }
Ejemplo n.º 6
0
 public static List <Student> GetStudentByEmail(string email)
 {
     return(StudentServices.GetStudentByEmail(email));
 }
Ejemplo n.º 7
0
 public static int DeleteStudent(string ID)
 {
     return(StudentServices.DeleteStudent(ID));
 }
Ejemplo n.º 8
0
 public StudentController()
 {
     studentService = new StudentServices();
     vm             = new IndexViewModel();
 }
Ejemplo n.º 9
0
 public StudentController(StudentServices student, CourseServices courses)
 {
     _student = student;
     _courses = courses;
 }
Ejemplo n.º 10
0
 public StudentController()
 {
     _service = new StudentServices();
 }
Ejemplo n.º 11
0
        private void Form1_Load(object sender, EventArgs e)
        {
            List <Student> list = StudentServices.GetList();

            this.dgvList.DataSource = new BindingList <Student>(list);
        }
Ejemplo n.º 12
0
        public ResourceModal(string type, object resource)
        {
            InitializeComponent();

            // Check each type
            if (type == "abroad")
            {
                // Set title
                StudyAbroad s = resource as StudyAbroad;
                lbl_name.Text = s.title;
                this.Text     = s.title;

                // Set desc
                lbl_desc.Text = s.description;

                // Add each place to flowlayoutpanel
                foreach (Place p in s.places)
                {
                    // Create title label
                    Label title = new Label();
                    title.Font      = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                    title.ForeColor = System.Drawing.Color.OrangeRed;
                    title.Size      = new Size(250, 20);
                    title.Text      = p.nameOfPlace;

                    // Create desc label
                    Label desc = new Label();
                    desc.Size = new Size(650, 100);
                    desc.Text = p.description;

                    // Add to flowlayoutpanel
                    fp_resources.Controls.Add(title);
                    fp_resources.Controls.Add(desc);
                }
            }

            if (type == "services")
            {
                // Get services
                StudentServices s = resource as StudentServices;

                // Get all 'sub' services
                AcademicAdvisors    a = s.academicAdvisors;
                ProfessonalAdvisors p = s.professonalAdvisors;
                FacultyAdvisors     f = s.facultyAdvisors;
                IstMinorAdvising    i = s.istMinorAdvising;

                /**
                 * Academic Advisors
                 */
                // Set the title
                lbl_name.Text = a.title;
                this.Text     = "Advising Services";

                // Set the description
                lbl_desc.Text = a.description;

                // Set faq
                LinkLabel faq = new LinkLabel();
                faq.TextAlign    = System.Drawing.ContentAlignment.MiddleCenter;
                faq.Size         = new Size(650, 50);
                faq.Text         = a.faq.contentHref;
                faq.LinkClicked += new LinkLabelLinkClickedEventHandler((o, e) => { System.Diagnostics.Process.Start(a.faq.contentHref); faq.LinkVisited = true; });
                fp_resources.Controls.Add(faq);

                /**
                 * Professonal Advisors
                 */
                // Create title label
                Label pTitle = new Label();
                pTitle.Font      = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                pTitle.ForeColor = System.Drawing.Color.OrangeRed;
                pTitle.Size      = new Size(250, 20);
                pTitle.Text      = p.title;

                // Create a label that stores the names of the advisors
                Label names = new Label();
                names.Size = new Size(650, 50);
                foreach (AdvisorInformation info in p.advisorInformation)
                {
                    names.Text += info.name + ", ";
                }

                // Remove the trailing comma
                string allNames = names.Text;
                allNames   = allNames.Remove(allNames.Length - 2, 2);
                names.Text = allNames;

                // Add to flowlayoutpanel
                fp_resources.Controls.Add(pTitle);
                fp_resources.Controls.Add(names);

                /**
                 * IST Minor Advising
                 */
                // Create title label
                Label iTitle = new Label();
                iTitle.Font      = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                iTitle.ForeColor = System.Drawing.Color.OrangeRed;
                iTitle.Size      = new Size(250, 20);
                iTitle.Text      = i.title;

                // Create a label that stores the names of the advisors
                Label names2 = new Label();
                names2.Size = new Size(650, 50);
                foreach (MinorAdvisorInformation info in i.minorAdvisorInformation)
                {
                    names2.Text += info.advisor + ", ";
                }

                // Remove the trailing comma
                string allNames2 = names2.Text;
                allNames2   = allNames2.Remove(allNames2.Length - 2, 2);
                names2.Text = allNames2;

                // Add to flowlayoutpanel
                fp_resources.Controls.Add(iTitle);
                fp_resources.Controls.Add(names2);

                /**
                 * Faculty Advisors
                 */
                // Create title label
                Label fTitle = new Label();
                fTitle.AutoSize  = false;
                fTitle.Font      = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                fTitle.ForeColor = System.Drawing.Color.OrangeRed;
                fTitle.Size      = new Size(250, 20);
                fTitle.Text      = f.title;

                // Create desc label
                Label fDesc = new Label();
                fDesc.Size = new Size(650, 130);
                fDesc.Text = f.description;

                // Add to flowlayoutpanel
                fp_resources.Controls.Add(fTitle);
                fp_resources.Controls.Add(fDesc);
            }

            if (type == "tutors")
            {
                // Set title
                TutorsAndLabInformation t = resource as TutorsAndLabInformation;
                lbl_name.Text = t.title;
                this.Text     = t.title;

                // Set desc
                lbl_desc.Text = t.description;

                // Create linklabel for tutoring link
                LinkLabel hours = new LinkLabel();
                hours.TextAlign    = System.Drawing.ContentAlignment.MiddleCenter;
                hours.Size         = new Size(650, 50);
                hours.Text         = t.tutoringLabHoursLink;
                hours.LinkClicked += new LinkLabelLinkClickedEventHandler((o, e) => { System.Diagnostics.Process.Start(t.tutoringLabHoursLink); hours.LinkVisited = true; });
                fp_resources.Controls.Add(hours);
            }

            if (type == "ambassadors")
            {
                // Set title
                StudentAmbassadors a = resource as StudentAmbassadors;
                lbl_name.Text = a.title;
                this.Text     = a.title;

                // Set desc mission statement
                lbl_desc.Text = a.subSectionContent[0].description;

                // For each subsection, create its own labels
                foreach (SubSectionContent s in a.subSectionContent)
                {
                    if (s.title == "Mission Statement")
                    {
                        continue;
                    }

                    // Create title
                    Label title = new Label();
                    title.Font      = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                    title.ForeColor = System.Drawing.Color.OrangeRed;
                    title.Size      = new Size(250, 20);
                    title.Text      = s.title;

                    // Create for desc
                    Label desc = new Label();
                    desc.Text = s.description;

                    if (s.title == "Expectations")
                    {
                        desc.Size = new Size(650, 70);
                    }

                    if (s.title == "Duties")
                    {
                        desc.Size = new Size(650, 120);
                    }

                    if (s.title == "Overview")
                    {
                        desc.Size = new Size(650, 40);
                    }

                    if (s.title == "Criteria")
                    {
                        desc.Size = new Size(650, 30);
                    }

                    if (s.title == "Perks")
                    {
                        desc.Size = new Size(650, 40);
                    }

                    if (s.title == "apply")
                    {
                        desc.AutoSize = true;
                    }

                    // Add to flowlayoutpanel
                    fp_resources.Controls.Add(title);
                    fp_resources.Controls.Add(desc);
                }

                // Create LinkLabel for application link
                LinkLabel ll = new LinkLabel();
                ll.TextAlign    = System.Drawing.ContentAlignment.MiddleCenter;
                ll.Size         = new Size(650, 50);
                ll.Text         = a.applicationFormLink;
                ll.LinkClicked += new LinkLabelLinkClickedEventHandler((o, e) => { System.Diagnostics.Process.Start(a.applicationFormLink); ll.LinkVisited = true; });
                fp_resources.Controls.Add(ll);
            }

            if (type == "forms")
            {
                // Set title and description
                Forms f = resource as Forms;
                lbl_name.Text = "Forms";
                lbl_desc.Text = "Below are the forms for Graduate and Undergraduate Students";
                this.Text     = "Forms";

                // Gradute form
                Label grad = new Label();
                grad.Font      = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                grad.ForeColor = System.Drawing.Color.OrangeRed;
                grad.Text      = "Graduate Forms";
                grad.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
                grad.Size      = new Size(650, 20);
                fp_resources.Controls.Add(grad);

                foreach (GraduateForm gf in f.graduateForms)
                {
                    // Create linklabel for tutoring link
                    LinkLabel form = new LinkLabel();
                    form.TextAlign    = System.Drawing.ContentAlignment.MiddleCenter;
                    form.Size         = new Size(650, 20);
                    form.Text         = gf.formName;
                    form.LinkClicked += new LinkLabelLinkClickedEventHandler((o, e) => { System.Diagnostics.Process.Start(gf.href); form.LinkVisited = true; });
                    fp_resources.Controls.Add(form);
                }

                // Add a space
                Label space = new Label();
                space.Size = new Size(500, 50);
                fp_resources.Controls.Add(space);

                // Undergradute form
                Label uGrad = new Label();
                uGrad.Font      = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                uGrad.ForeColor = System.Drawing.Color.OrangeRed;
                uGrad.Text      = "Undergraduate Forms";
                uGrad.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
                uGrad.Size      = new Size(650, 20);
                fp_resources.Controls.Add(uGrad);

                foreach (UndergraduateForm ufg in f.undergraduateForms)
                {
                    // Create linklabel for tutoring link
                    LinkLabel form = new LinkLabel();
                    form.TextAlign    = System.Drawing.ContentAlignment.MiddleCenter;
                    form.Size         = new Size(650, 20);
                    form.Text         = ufg.formName;
                    form.LinkClicked += new LinkLabelLinkClickedEventHandler((o, e) => { System.Diagnostics.Process.Start(ufg.href); form.LinkVisited = true; });
                    fp_resources.Controls.Add(form);
                }
            }

            if (type == "coop")
            {
                // Set title
                CoopEnrollment c = resource as CoopEnrollment;
                lbl_name.Text = c.title;
                this.Text     = c.title;

                // Set desc
                lbl_desc.Text = c.enrollmentInformationContent[0].description;

                // For each enrollment information, create labels
                foreach (EnrollmentInformationContent e in c.enrollmentInformationContent)
                {
                    if (e.title == "Pre-requisites")
                    {
                        continue;
                    }

                    // Create title
                    Label title = new Label();
                    title.Font      = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                    title.ForeColor = System.Drawing.Color.OrangeRed;
                    title.Size      = new Size(250, 20);
                    title.Text      = e.title;

                    // Create for desc
                    Label desc = new Label();
                    desc.Text = e.description;

                    if (e.title == "Approval Process")
                    {
                        desc.Size = new Size(650, 40);
                    }

                    if (e.title == "How to enroll in a co-op you found on JobZone")
                    {
                        desc.Size = new Size(650, 50);
                    }

                    if (e.title == "How to enroll in a co-op you found outside of JobZone")
                    {
                        desc.Size = new Size(650, 100);
                    }

                    // Add to flowlayoutpanel
                    fp_resources.Controls.Add(title);
                    fp_resources.Controls.Add(desc);
                }

                // Add link for RITJobZoneGuideLink
                LinkLabel link = new LinkLabel();
                link.TextAlign    = System.Drawing.ContentAlignment.MiddleCenter;
                link.Size         = new Size(650, 20);
                link.Text         = c.RITJobZoneGuidelink;
                link.LinkClicked += new LinkLabelLinkClickedEventHandler((o, e) => { System.Diagnostics.Process.Start(c.RITJobZoneGuidelink); link.LinkVisited = true; });
                fp_resources.Controls.Add(link);
            }
        }
Ejemplo n.º 13
0
 public DataController(StudentServices services)
 {
     this.student_services = services;
 }
 public SidebarViewComponent(StudentServices student, SchoolYearServices sy, UserManager <SchoolUser> userManager)
 {
     _sy          = sy;
     _student     = student;
     _userManager = userManager;
 }
Ejemplo n.º 15
0
 public static List <Student> GetStudentByL_Name(string lastName)
 {
     return(StudentServices.GetStudentByLastName(lastName));
 }
Ejemplo n.º 16
0
        static void Main(string[] args)
        {
            #region tema sesiunea 1
            //get student.FullName
            Console.WriteLine("Please enter you first and last name");
            string studentFullName = Console.ReadLine();

            //using FullName, get First Name and Last Name
            StudentModel student = new StudentModel {
                FullName = studentFullName
            };
            StudentServices studentServices = new StudentServices();

            studentServices.GetStudentFirstName(student);

            //enter course
            Console.WriteLine("Enter course name: ");
            string courseName = Console.ReadLine();

            CourseModel course = new CourseModel {
                Name = courseName
            };

            //enter teacher
            Console.WriteLine("Please enter teacher name:");
            string teacherName = Console.ReadLine();

            //associate course to teacher
            TeacherModel teacher = new TeacherModel
            {
                FullName      = teacherName,
                ListOfCourses = new List <CourseModel> {
                    course
                }
            };
            #endregion

            #region exercitiu sesiunea 2
            //take quiz
            var quiz         = QuizData.GetFirstQuiz();
            int rightAnswers = 0;

            Console.WriteLine();
            Console.WriteLine("Plese take the following quiz");

            for (int i = 0; i < quiz.ListOfQuestions.Count; i++)
            {
                Console.WriteLine(quiz.ListOfQuestions[i].QuestionName);
                Console.WriteLine();

                for (int j = 0; j < quiz.ListOfQuestions[i].QuestionAnswers.Count; j++)
                {
                    Console.WriteLine(quiz.ListOfQuestions[i].QuestionAnswers[j].Order + "." +
                                      quiz.ListOfQuestions[i].QuestionAnswers[j].Text);
                }

                string answer = Console.ReadLine();
                Console.WriteLine();

                var isTheCorrectAnswer = quiz.ListOfQuestions[i].QuestionAnswers.FirstOrDefault(
                    x => x.Order.ToLower() == answer.ToLower()).IsCorrect;

                if (isTheCorrectAnswer)
                {
                    rightAnswers++;
                }
            }
            #endregion

            //get grade
            double score = 0;
            try
            {
                score = Math.Round((double)(rightAnswers * 10) / quiz.ListOfQuestions.Count);
            }
            catch (DivideByZeroException) { }
            student.Grade = score;

            //print out student information
            Console.WriteLine();
            Console.WriteLine(@"Final grade: {0}
Student: {1}
Course: {2}
Teacher: {3}", student.Grade, student.FullName, course.Name, teacher.FullName);
        }
Ejemplo n.º 17
0
 public static List <Student> GetStudentByMobile(string mobile)
 {
     return(StudentServices.GetStudentByMobile(mobile));
 }
 public HomeworkWeek6()
 {
     studentService = new StudentServices();
     student        = new StudentModel();
 }
Ejemplo n.º 19
0
 public static int AddStudent(Student stu)
 {
     return(StudentServices.AddStudent(stu));
 }
Ejemplo n.º 20
0
        public static List <Student> GetallStudent()
        {
            List <Student> listStu = StudentServices.GetAllStudent();

            return(listStu);
        }
Ejemplo n.º 21
0
 public static int UpdateStudent(Student stu)
 {
     return(StudentServices.UpdateStudent(stu));
 }
Ejemplo n.º 22
0
 public static int CountTotal()
 {
     return(StudentServices.GetStudentTotal());
 }
Ejemplo n.º 23
0
 public static void Login(string username)
 {
     StudentServices.Login(username);
 }
Ejemplo n.º 24
0
 public static Student LoadStudent(string ID)
 {
     return(StudentServices.GetCurrentStudent(ID));
 }
 public AuthenticationController(StudentServices studentServices)
 {
     this.studentServices = studentServices;
 }
Ejemplo n.º 26
0
 public static List <Student> GetStudentByID(string ID)
 {
     return(StudentServices.GetStudentByID(ID));
 }
Ejemplo n.º 27
0
        private void ImportButton_Click(object sender, EventArgs e)
        {
            StudentServices service = new StudentServices();
            int             i       = 0;

            if (listViewInfo == ListViewInfo.Students)
            {
                try
                {
                    service.InsertClassToDB(currClass);
                    Classes.Items.Add(currClass);

                    foreach (Information data in FileData)
                    {
                        try
                        {
                            service.InsertStudentToDB(data, currClass);
                            i++;
                        }
                        catch (Exception ex)
                        {
                            MessageBox.Show($"Student with ID '{data.Id}' cannot be imported!!"
                                            + Environment.NewLine + ex.Message);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show($"Class '{currClass}' cannot be imported!!" + Environment.NewLine + ex.Message);
                }
                NotiLabel.Text = $"{i} student(s) have been imported to class '{currClass}' successfully.";
            }
            else if (listViewInfo == ListViewInfo.Schedule)
            {
                try
                {
                    service.InsertClassToDB(currClass);
                    Classes.Items.Add(currClass);
                }
                catch { }

                foreach (Information data in FileData)
                {
                    try
                    {
                        service.InsertScheduleToDB(data, currClass);
                        i++;
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show($"Subject with ID '{data.Id}' cannot be imported!!"
                                        + Environment.NewLine + ex.Message);
                    }
                }

                NotiLabel.Text = $"{i} subject(s) from schedule have been imported for class '{currClass}' successfully.";
            }
            else if (listViewInfo == ListViewInfo.Scoreboard)
            {
                try
                {
                    service.InsertClassToDB(currClass);
                    Classes.Items.Add(currClass);
                }
                catch { }

                foreach (Information data in FileData)
                {
                    try
                    {
                        if (service.InsertScoreToDB(data, currClass, currSubject))
                        {
                            i++;
                        }
                        else
                        {
                            MessageBox.Show($"Score of student with ID '{data.Id}' cannot be imported!!");
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show($"Score of student with ID '{data.Id}' cannot be imported!!"
                                        + Environment.NewLine + ex.Message);
                    }
                }

                NotiLabel.Text = $"{i} student(s)' score have been imported for class '{currClass}' successfully.";
            }
            ImportButton.Enabled = false;
        }
Ejemplo n.º 28
0
 public static List <Student> GetStudentByF_Name(string firstName)
 {
     return(StudentServices.GetStudentByFirstName(firstName));
 }
 public ProfileController(StudentServices student, UserManager <SchoolUser> userManager) : base(userManager)
 {
     _student = student;
 }
Ejemplo n.º 30
0
 public BCS(IConfiguration config)
 {
     _programManager = new ProgramServices(config.GetConnectionString("DATABAIST"));
     _studentManager = new StudentServices(config.GetConnectionString("DATABAIST"));
     _dbUserManager  = new DatabaseUserManager(config.GetConnectionString("DATABAIST"));
 }