Esempio n. 1
0
File: SetSubject.cs Progetto: Gqqq/-
        void GetAllSubject()
        {
            SubjectsBLL Subject = new SubjectsBLL();

            this.comboBox1.DisplayMember = "科目名称";
            this.comboBox1.ValueMember   = "科目编号";
            this.comboBox1.DataSource    = Subject.GetAllSubjects();
        }
Esempio n. 2
0
File: OrgSetForm.cs Progetto: Gqqq/-
        private void btnAddke_Click(object sender, EventArgs e)
        {
            SubjectsBLL   subject = new SubjectsBLL();
            SubjectsModel model   = new SubjectsModel();

            if (string.IsNullOrEmpty(this.txtkeName.Text))
            {
                MessageBox.Show("学科名称不能为空");
                return;
            }
            model.Subjects_Name = this.txtkeName.Text;
            subject.AddSubjects(model);
            GetAllSubject();
        }
Esempio n. 3
0
File: OrgSetForm.cs Progetto: Gqqq/-
        private void benDeleke_Click(object sender, EventArgs e)
        {
            SubjectsBLL   subject = new SubjectsBLL();
            SubjectsModel model   = new SubjectsModel();

            if (this.dataxueke.SelectedRows.Count > 0)
            {
                int ID = Convert.ToInt32(this.dataxueke.SelectedRows[0].Cells["科目编号"].Value);
                model.Subjects_ID = ID;
                try
                {
                    subject.DeleSubjects(model);
                    GetAllSubject();
                }
                catch
                {
                    MessageBox.Show("删除失败");
                }
            }
        }
Esempio n. 4
0
File: OrgSetForm.cs Progetto: Gqqq/-
        /// <summary>
        /// 创建查询所有学科的方法
        /// </summary>
        void GetAllSubject()
        {
            SubjectsBLL subject = new SubjectsBLL();

            dataxueke.DataSource = subject.GetAllSubjects();
        }