Beispiel #1
0
        private void BtnAddClass_Click(object sender, EventArgs e)
        {
            Repository.Entity.Class cls = new Repository.Entity.Class();
            cls.bjmc  = this.txtBjmc.Text;
            cls.bjlb  = this.cbBjlb.Text;
            cls.bzrxm = this.txtBzrxm.Text;

            Repository.Class repoClass = new Class();
            repoClass.Add(cls);

            this.ClearFields();
            this.BindClass();
        }
        private void SelectNewStudentForm_Load(object sender, EventArgs e)
        {
            // 设置信息
            Repository.Class        repoClass = new Class();
            Repository.Entity.Class c         = repoClass.GetList("ID=" + this.NewClassID.ToString())[0];

            this.lblNewClass.Text = c.bjmc + "(" + c.bjlb + ")";

            // 绑定全部学生
            this.BindStudent();

            // 绑定推荐学生
            this.BindRecommendedStudent();
        }
Beispiel #3
0
 //新增資料
 public void InsertClass()
 {
     using (ClassWeb.Repository.Entity.SchoolEntities DBEntity = new Repository.Entity.SchoolEntities())
     {
         ClassWeb.Repository.Entity.Class classData = new Repository.Entity.Class();
         classData.Class_No      = GetNewClassNo();
         classData.Class_Name    = Name;
         classData.Class_Credit  = Credit;
         classData.Class_Place   = Place;
         classData.Class_Teacher = Teacher;
         DBEntity.Class.Add(classData);
         DBEntity.SaveChanges();
     }
 }
Beispiel #4
0
        private void BtnManual_Click(object sender, EventArgs e)
        {
            ManualForm manualForm = new ManualForm();

            // 获得调出学生和班级
            int id = 0;

            int.TryParse(this.dgClassStudent.SelectedRows[0].Cells["s_id"].Value.ToString(), out id);
            Repository.Student        repoStudent = new Student();
            Repository.Entity.Student s           = repoStudent.GetList("ID=" + id)[0];

            manualForm.OldStudent = s;

            int.TryParse(this.dgClass.SelectedRows[0].Cells[0].Value.ToString(), out id);
            Repository.Class        repoClass = new Class();
            Repository.Entity.Class c         = repoClass.GetList("ID=" + id)[0];

            manualForm.OldClass = c;

            manualForm.ShowDialog();
        }
Beispiel #5
0
        private void BtnEditClass_Click(object sender, EventArgs e)
        {
            // get selected id
            int id = 0;

            if (this.dgClass.SelectedRows.Count > 0)
            {
                int.TryParse(this.dgClass.SelectedRows[0].Cells[0].Value.ToString(), out id);
            }

            Repository.Entity.Class cls = new Repository.Entity.Class();
            cls.ID    = id;
            cls.bjmc  = this.txtBjmc.Text;
            cls.bjlb  = this.cbBjlb.Text;
            cls.bzrxm = this.txtBzrxm.Text;

            Repository.Class repoClass = new Class();
            repoClass.Update(cls);

            this.BindClass();
        }