コード例 #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     TeacherMethods.AddTeacher(TName.Text, TLast.Text, Phone);
     TName.Text     = "";
     TLast.Text     = "";
     TPhone.Text    = "";
     comboBox1.Text = "";
     MessageBox.Show("Teacher Added!");
 }
コード例 #2
0
        public Form2()
        {
            InitializeComponent();
            this.monthCalendar1.MinDate = monthCalendar1.TodayDate;
            foreach (DataRow dr in TeacherMethods.GetAllTeachers().Rows)
            {
                twoitem ti = new twoitem((dr["TeacherName"].ToString()), int.Parse(dr["TeacherId"].ToString()));
                comboBox1.Items.Add(ti);
            }


            foreach (DataRow dr in StudentMethods.GetAllStudents().Rows)
            {
                twoitem ti = new twoitem((dr["StudentName"].ToString()), int.Parse(dr["StudentId"].ToString()));
                comboBox2.Items.Add(ti);
            }
        }