private void comboBoxSelectSemester_SelectedIndexChanged(object sender, EventArgs e) { comboBoxSelectCourse.Items.Clear(); comboBoxSelectCourse.Text = ""; comboBoxSelectStudent.Items.Clear(); comboBoxSelectStudent.Text = ""; buttonUploadQuizMark.Visible = false; buttonUploadTermMark.Visible = false; numericUpDownUploadQuizMark.Visible = false; numericUpDownUploadTermMark.Visible = false; buttonUploadQuiz.Visible = false; buttonUploadTerm.Visible = false; CourseAssignRepository car = new CourseAssignRepository(); List <CourseAssign> cList = new List <CourseAssign>(); cList = car.GetAllSections(uId, this.comboBoxSelectSemester.Text); for (int i = 0; i < cList.Count; i++) { this.comboBoxSelectCourse.Items.Add(cList[i].AssignedCourse + " " + cList[i].Section); } }
private void comboBoxSelectSemester_SelectedIndexChanged(object sender, EventArgs e) { comboBoxSelectCourse.Items.Clear(); comboBoxSelectCourse.Text = ""; buttonUploadNotice.Enabled = false; CourseAssignRepository car = new CourseAssignRepository(); List <CourseAssign> cList = new List <CourseAssign>(); cList = car.GetAllSections(uId, this.comboBoxSelectSemester.Text); for (int i = 0; i < cList.Count; i++) { this.comboBoxSelectCourse.Items.Add(cList[i].AssignedCourse + " " + cList[i].Section); } }
private void comboBoxSelectSemester_SelectedIndexChanged(object sender, EventArgs e) { comboBoxSelectCourse.Items.Clear(); comboBoxSelectCourse.Text = ""; dataGridView1.DataSource = null; dataGridView1.Visible = false; CourseAssignRepository car = new CourseAssignRepository(); List <CourseAssign> cList = new List <CourseAssign>(); cList = car.GetAllSections(uId, this.comboBoxSelectSemester.Text); for (int i = 0; i < cList.Count; i++) { this.comboBoxSelectCourse.Items.Add(cList[i].AssignedCourse + " " + cList[i].Section); } }
private void buttonSelect_Click(object sender, EventArgs e) { CourseAssignRepository car = new CourseAssignRepository(); List <CourseAssign> cList = new List <CourseAssign>(); cList = car.GetAllSections(uId, this.comboBoxSemester.Text); DataTable table = new DataTable(); table.Columns.Add(" Course Name ", typeof(string)); table.Columns.Add(" Section ", typeof(string)); for (int i = 0; i < cList.Count; i++) { table.Rows.Add(cList[i].AssignedCourse, cList[i].Section); } dataGridView1.DataSource = table; }
public FacultyHome(string userId) { InitializeComponent(); uId = userId; AccountRepository ar = new AccountRepository(); Account ac = ar.GetAccount(userId); this.labelName.Text = "Welcome " + ac.Name; dataGridView1.Visible = false; SemesterRepository sr = new SemesterRepository(); List <Semester> sList = new List <Semester>(); sList = sr.GetAllSemesters(); for (int i = 0; i < sList.Count(); i++) { comboBoxSemester.Items.Add(sList[i].Name); } this.comboBoxSemester.Text = "Spring 17-18"; this.Controls.Add(this.comboBoxSemester); CourseAssignRepository car = new CourseAssignRepository(); List <CourseAssign> cList = new List <CourseAssign>(); cList = car.GetAllSections(userId, this.comboBoxSemester.Text); DataTable table = new DataTable(); table.Columns.Add(" Course Name ", typeof(string)); table.Columns.Add(" Section ", typeof(string)); table.Columns.Add("Schedule ", typeof(string)); for (int i = 0; i < cList.Count; i++) { CourseRepository cr = new CourseRepository(); table.Rows.Add(cList[i].AssignedCourse, cList[i].Section, cr.GetOnlySchedule(comboBoxSemester.Text, cList[i].AssignedCourse, cList[i].Section)); } dataGridView1.DataSource = table; dataGridView1.ReadOnly = true; }
public ApproveDrop(string userId) { InitializeComponent(); uId = userId; AccountRepository ar = new AccountRepository(); Account ac = ar.GetAccount(userId); labelUserName.Text = "Welcome " + ac.Name; CourseAssignRepository car = new CourseAssignRepository(); List <CourseAssign> caList = car.GetAllSections(uId, "Spring 17-18"); for (int i = 0; i < caList.Count; i++) { comboBoxSelectCourse.Items.Add(caList[i].AssignedCourse + " " + caList[i].Section); } buttonApproveDrop.Enabled = false; }
public AssignCourseInfo() { InitializeComponent(); AccountRepository aRepo = new AccountRepository(); this.comboBoxAccount.DataSource = aRepo.GetAccountIdAndNames2("Faculty"); //CourseRepository cRepo = new CourseRepository(); //this.comboBoxAssignedCourse.DataSource = cRepo.GetCourseNames2(); //this.comboBoxSection.DataSource = cRepo.GetALLSections2(); SemesterRepository sRepo = new SemesterRepository(); this.comboBoxSemesterName.DataSource = sRepo.GetAllSemesterNames2(); CourseAssignRepository asRepo = new CourseAssignRepository(); this.dataGridViewAssignedCourses.DataSource = asRepo.GetAllAssignedCourses2(); }
private void AssignClicked(object sender, EventArgs e) { CourseAssign s = new CourseAssign(); string[] acc = this.comboBoxAccount.Text.Split(' '); s.AccountId = acc[0]; s.AssignedCourse = this.comboBoxAssignedCourse.Text; s.Section = this.comboBoxSection.Text; s.Semester = this.comboBoxSemesterName.Text; Course c = new Course(); c.Name = this.comboBoxAssignedCourse.Text; c.Section = this.comboBoxSection.Text; c.Semester = this.comboBoxSemesterName.Text; CourseAssignRepository aRepo = new CourseAssignRepository(); CourseRepository cRepo = new CourseRepository(); if (cRepo.CheckCourse2(c)) { if (aRepo.CheckAssignedCourse2(s)) { if (aRepo.Insert2(s)) { MessageBox.Show("One Course Assigned", "Successful"); } else { MessageBox.Show("Operation Failed", "Failed"); } } else { MessageBox.Show("Already Exists", "Failed"); } } else { MessageBox.Show("Invalid Course", "Failed"); } }
private void comboBoxSemester_SelectedIndexChanged(object sender, EventArgs e) { CourseAssignRepository car = new CourseAssignRepository(); List <CourseAssign> cList = new List <CourseAssign>(); cList = car.GetAllSections(uId, this.comboBoxSemester.Text); DataTable table = new DataTable(); table.Columns.Add(" Course Name ", typeof(string)); table.Columns.Add(" Section ", typeof(string)); table.Columns.Add(" Schedule ", typeof(string)); for (int i = 0; i < cList.Count; i++) { CourseRepository cr = new CourseRepository(); table.Rows.Add(cList[i].AssignedCourse, cList[i].Section, cr.GetOnlySchedule(comboBoxSemester.Text, cList[i].AssignedCourse, cList[i].Section)); } dataGridView1.DataSource = table; dataGridView1.Visible = true; }
private void RefreshClicked(object sender, EventArgs e) { CourseAssignRepository aRepo = new CourseAssignRepository(); this.dataGridViewAssignedCourses.DataSource = aRepo.GetAllAssignedCourses2(); }