Exemplo n.º 1
0
 private void Export_Load(object sender, EventArgs e)
 {
     LabClassBLL bclass = new LabClassBLL();
     cmbClass.BindClass(ClassType.LabClass);
     txtBaseMark.Text = Setting.BaseMark;
     txtBaseMark.ReadOnly = true;
 }
Exemplo n.º 2
0
 private void btnSearch_Click(object sender, EventArgs e)
 {
     StudentBLL bstudent = new StudentBLL();
     LabClassBLL cls = new LabClassBLL();
     stuinfo = bstudent.GetStudentBySID(txtSID.Text);
     if (stuinfo == null)
     {
         MessageBox.Show("û�����ѧ��");
         return;
     }
     lblSName.Text = stuinfo.SName;
     cmbClass.BindClass(ClassType.LabClass);
     cmbClass.ClassID = stuinfo.LabClassID;
 }
Exemplo n.º 3
0
 public void BindClass(ClassType ct)
 {
     switch (ct)
     {
         case ClassType.LabClass:
             LabClassBLL lcb = new LabClassBLL();
             cmbClass.DataSource = null;
             cmbClass.DataSource = lcb.GetAllLabClass();
             cmbClass.DisplayMember = "LabClassID";
             cmbClass.ValueMember = "LabClassID";
             break;
         case ClassType.TheoryClass:
             TheoryClassBLL tcb = new TheoryClassBLL();
             cmbClass.DataSource = null;
             cmbClass.DataSource = tcb.GetAllTheoryClass();
             cmbClass.DisplayMember = "TheoryClassID";
             cmbClass.ValueMember = "TheoryClassID";
             break;
     }
 }
Exemplo n.º 4
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (rdbLab.Checked)
            {
                 LabClass classinfo = new LabClass()
                {
                    LabClassID = txtClassID.Text,
                    LabClassRoom = txtClassRoom.Text,
                    Date = txtDate.Text,
                    TheoryClassID=cmbTheroyClass.ClassID
                };

                LabClassBLL bclass = new LabClassBLL();
                try
                {
                    if (bclass.AddClass(classinfo))
                        MessageBox.Show("��ӳɹ�");
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
            else if(rdbTheroy.Checked)
            {
                TheoryClass classinfo = new TheoryClass()
                {
                    TheoryClassID = txtClassID.Text,
                    TheoryClassRoom = txtClassRoom.Text,
                    Date = txtDate.Text
                };
                TheoryClassBLL bclass = new TheoryClassBLL();
                try
                {
                    if (bclass.AddClass(classinfo))
                        MessageBox.Show("��ӳɹ�");
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
            else
            {
                LabClass classinfo = new LabClass()
                {
                    LabClassID = txtClassID.Text,
                    LabClassRoom = txtClassRoom.Text,
                    Date = txtDate.Text
                };

                LabClassBLL bclass = new LabClassBLL();
                try
                {
                    if (bclass.AddClass(classinfo))
                        MessageBox.Show("��ӳɹ�");
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }