public viewShL(string name1, string id1) { name = name1; id = id1; InitializeComponent(); activeCourse = new ActiveCoursesDB(name); }
public ActiveCoursesDB MakeStudentSchedule(int idActiveCourse) { ActiveCoursesDB list1 = new ActiveCoursesDB(); try { con.OpenCon(); SqlCommand comm = new SqlCommand("SELECT * FROM ActiveCourses WHERE IDActiveCourse ='" + idActiveCourse + "'", con.GetCon()); SqlDataReader reader; reader = comm.ExecuteReader(); while (reader.Read()) { list1.nameCourse = reader["nameCourse"].ToString(); list1.clas = reader["class"].ToString(); list1.day = reader["day"].ToString(); list1.hourStart = int.Parse(reader["hourStart"].ToString()); list1.hourOver = int.Parse(reader["numHours"].ToString()); } con.CloseCon(); return(list1); } catch (Exception ex) { MessageBox.Show(ex.Message); return(list1); } }
private void btn_Cancel_Tuition_Confirmation_Click(object sender, EventArgs e) { string day = ""; string leteralDay = cbo_Cancell_Day.Text; if (leteralDay == "'א") { day = "A"; } else if (leteralDay == "'ב") { day = "B"; } else if (leteralDay == "'ג") { day = "C"; } else if (leteralDay == "'ד") { day = "D"; } else if (leteralDay == "'ה") { day = "E"; } else if (leteralDay == "'ו") { day = "F"; } int hour = Convert.ToInt32(cbo_Cancell_Hour.Text); ActiveCoursesDB actCourseDB = new ActiveCoursesDB(); string classroom = actCourseDB.Get_Course_Classroom(user.Get_First_Name(), user.Get_Last_Name(), cbo_Courses.Text, day, hour); Requests_TutorsDB reqTutDB = new Requests_TutorsDB(); reqTutDB.Add_Request(user.Get_ID(), user.Get_First_Name(), user.Get_Last_Name(), CANCELL, cbo_Courses.Text, day, hour, classroom); Panel_Tutor_Requests_Main.Visible = true; cbo_Cancell_Day.Items.Clear(); cbo_Cancell_Day.ResetText(); cbo_Courses.ResetText(); cbo_Cancell_Hour.Items.Clear(); cbo_Cancell_Hour.ResetText(); }