private void add_lec1_button_Click(object sender, EventArgs e) { tempCon[4] = selectedcourse.getID().ToString(); tempCon[5] = "0"; tempCon[6] = "Lecture"; tempCon[7] = Class_lec1_comboBox.SelectedItem.ToString(); tempCon[8] = selectedcourse.getName(); tempCon[9] = "None"; tempCon[10] = selectedcourse.getYear().ToString(); tempCon[11] = selectedcourse.getSemester().ToString(); constraints toinit = new constraints(tempCon); allconstraintsobjects.Add(toinit); (this.Owner as Schedule_Board).initialise_new_event(toinit); toinit.addthistodb(); MessageBox.Show("meaniyen"); if (this.selectedcourse.get_amount_of_lecture_sessions() == 2) { Lec2Panel.Show(); Lec2Panel.Enabled = true; } else { prapanel.Enabled = true; } lec1panel.Enabled = false; }
public bool addconstraint(constraints addthis) { SqlConnection con = new SqlConnection(constring); SqlCommand newcommand = new SqlCommand("INSERT INTO dbo.Constraints (StartTime,EndTime,Day,CourseID,LecturerID,Lecture_type,ClassID,CourseName,LecturerName,Year,Semester) VALUES (@StartTime,@EndTime,@Day,@CourseID,@LecturerID,@Lecture_type,@ClassID,@CourseName,@LecturerName,@Year,@Semester)", con); newcommand.Parameters.Add("@StartTime", addthis.getStart()); newcommand.Parameters.Add("@EndTime", addthis.getEnd()); newcommand.Parameters.Add("@Day", addthis.getday()); newcommand.Parameters.Add("@CourseID", addthis.getcourseid()); newcommand.Parameters.Add("@LecturerID", addthis.getlecturerid()); newcommand.Parameters.Add("@Lecture_type", addthis.gettype()); newcommand.Parameters.Add("@ClassID", addthis.getclassroom()); newcommand.Parameters.Add("@CourseName", addthis.getcoursename()); newcommand.Parameters.Add("@LecturerName", addthis.getlecturer()); newcommand.Parameters.Add("@Year", addthis.getyear()); newcommand.Parameters.Add("@Semester", addthis.getsemester()); con.Open(); if (con.State == System.Data.ConnectionState.Open) { newcommand.ExecuteNonQuery(); con.Close(); return(true); } return(false); }
public chosen_event_form(object currconst, object calling_person_ = null) : this() { if (calling_person_ != null) { this.calling_person = calling_person_ as Person; } recived = currconst as constraints; }
public Teacher_movecon_request(object input_constraint) { InitializeComponent(); sending_constraint = input_constraint as constraints; Sender_name_label.Text = "Username: "******"\nID: " + sending_constraint.getlecturerid(); Subject_fixed_text.Text = "ID: " + sending_constraint.get_id() + "\nCourse ID: " + sending_constraint.getcourseid() + "\nCourse Name: " + sending_constraint.getcoursename() + "\nClass: " + sending_constraint.getclassroom(); }
private bool initialise_new_event(constraints initThis) { initThis.textbox.Multiline = true; initThis.textbox.Dock = DockStyle.Fill; initThis.textbox.ReadOnly = true; initThis.textbox.BackColor = Color.LightBlue; tableLayoutPanel1.Controls.Add(initThis.textbox, initThis.getday() - 64, initThis.getStart() - 7); tableLayoutPanel1.SetRowSpan(initThis.textbox, initThis.getEnd() - initThis.getStart()); return(false); }
private void add_pra_Click(object sender, EventArgs e) { tempConPra[4] = selectedcourse.getID().ToString(); tempConPra[5] = "0"; tempConPra[6] = pratype.SelectedItem.ToString(); tempConPra[8] = selectedcourse.getName(); tempConPra[9] = "None"; tempConPra[10] = selectedcourse.getYear().ToString(); tempConPra[11] = selectedcourse.getSemester().ToString(); constraints toinit = new constraints(tempConPra); (this.Owner as Schedule_Board).initialise_new_event(toinit); toinit.addthistodb(); MessageBox.Show("meaniyen"); this.Close(); }
private void lec2_add_Click(object sender, EventArgs e) { tempcon2[4] = selectedcourse.getID().ToString(); tempcon2[5] = "0"; tempcon2[6] = "Lecture"; tempcon2[7] = Class_lec1_comboBox.SelectedItem.ToString(); tempcon2[8] = selectedcourse.getName(); tempcon2[9] = "None"; tempcon2[10] = selectedcourse.getYear().ToString(); tempcon2[11] = selectedcourse.getSemester().ToString(); constraints toinit = new constraints(tempcon2); allconstraintsobjects.Add(toinit); (this.Owner as Schedule_Board).initialise_new_event(toinit); toinit.addthistodb(); MessageBox.Show("meaniyen"); prapanel.Enabled = true; prapanel.Visible = true; Lec2Panel.Enabled = false; }
public chosen_event_form(object currconst) : this() { recived = currconst as constraints; }