Beispiel #1
0
        private void cmbyuan_SelectedIndexChanged(object sender, EventArgs e)
        {
            SpecialityBLL   Speciality = new SpecialityBLL();
            SpecialityModel model      = new SpecialityModel();

            model.Speciality_ID    = "%" + this.cmbyuan.SelectedValue.ToString() + "%";
            cmbzhuan.DisplayMember = "专业名称";
            cmbzhuan.ValueMember   = "专业编号";
            cmbzhuan.DataSource    = Speciality.GetIdSpeciality(model);
        }
Beispiel #2
0
        private void btnUPzhuan_Click(object sender, EventArgs e)
        {
            SpecialityBLL   Speciality = new SpecialityBLL();
            SpecialityModel model      = new SpecialityModel();

            model.Speciality_Name  = txtzhuanName.Text;
            model.Speciality_Years = Convert.ToInt32(cmdxuezhi.SelectedValue);
            model.Speciality_ID    = datazhuan.SelectedRows[0].Cells["专业编号"].Value.ToString();
            Speciality.UPSpeciality(model);
            GetAllSpeciality();
        }
        private void LoadAllSpecialityByDelFlag()
        {
            SpecialityBLL bll = new SpecialityBLL();

            cbClassInfoSpeciality.DataSource    = bll.GetAllspecialityIdAndNameByDelFlag(0).ToList();
            cbClassInfoSpeciality.DisplayMember = "Value";
            cbClassInfoSpeciality.ValueMember   = "Key";

            //  cbClassInfoSpeciality.DataSource = bll.GetAllSpecialityByDelFlag(0);
            //cbClassInfoSpeciality.DisplayMember = "Name";
            //cbClassInfoSpeciality.ValueMember = "Id";
        }
Beispiel #4
0
        private string path = "";  //照片路径

        private void frmAddStudent_Load(object sender, EventArgs e)
        {
            //班级、专业下拉框赋值
            SpecialityBLL bll_speciality = new SpecialityBLL();
            ClassInfoBLL  bll_classinfo  = new ClassInfoBLL();

            cbClassInfo.Tag  = bll_classinfo.GetClassInfoByClassInfoId(student.Class_id);
            cbClassInfo.Text = ((ClassInfo)cbClassInfo.Tag).Name;

            cbSpeciality.Tag  = bll_speciality.GetSpecialityBySpecialityId(student.Speciality_id);
            cbSpeciality.Text = ((Speciality)cbSpeciality.Tag).Name;
        }
Beispiel #5
0
        private void button5_Click(object sender, EventArgs e)
        {
            SpecialityBLL   Speciality = new SpecialityBLL();
            SpecialityModel model      = new SpecialityModel();

            model.Speciality_ID   = "%" + txtzhuanchaname.Text + "%";
            model.Speciality_Name = "%" + txtzhuanchaname.Text + "%";
            if (this.cmbchalei.SelectedIndex == 0)
            {
                datazhuan.DataSource = Speciality.GetIdSpeciality(model);
            }
            else
            {
                datazhuan.DataSource = Speciality.GetNameSpeciality(model);
            }
        }
Beispiel #6
0
        private void btnDelezhuan_Click(object sender, EventArgs e)
        {
            SpecialityBLL   Speciality = new SpecialityBLL();
            SpecialityModel model      = new SpecialityModel();

            model.Speciality_ID = this.datazhuan.SelectedRows[0].Cells["专业编号"].Value.ToString();
            try
            {
                Speciality.DeleSpeciality(model);
                GetAllSpeciality();
            }
            catch
            {
                MessageBox.Show("删除失败");
            }
        }
Beispiel #7
0
        private void frmAddCourse_Load(object sender, EventArgs e)
        {
            //160, 30
            txtCourseName.AutoSize = false;
            txtRoomName.AutoSize   = false;
            txtSemester.AutoSize   = false;
            txtCourseName.Size     = new Size(160, 30);
            txtRoomName.Size       = new Size(160, 30);
            txtSemester.Size       = new Size(160, 30);

            //加载专业
            SpecialityBLL            bll        = new SpecialityBLL();
            Dictionary <int, string> dictionary = bll.GetAllspecialityIdAndNameByDelFlag(0);

            cbSpeciality.DataSource    = dictionary.ToList();
            cbSpeciality.DisplayMember = "Value";
            cbSpeciality.ValueMember   = "Key";
        }
Beispiel #8
0
        private void btnAddzhuan_Click(object sender, EventArgs e)
        {
            SpecialityBLL   Speciality = new SpecialityBLL();
            SpecialityModel model      = new SpecialityModel();

            model.Speciality_ID = lblCollegeId.Text + this.txtzhuanbian.Text;
            bool b = Speciality.SeleSpeciality(model);

            if (b == true)
            {
                MessageBox.Show("编号已存在,请重新输入");
                this.txtzhuanbian.Text = "";
                return;
            }
            if (string.IsNullOrEmpty(this.txtzhuanbian.Text))
            {
                MessageBox.Show("专业编号不能为空");
                return;
            }
            if (this.txtzhuanbian.Text.Length != 2)
            {
                MessageBox.Show("专业编号必须两位");
                this.txtzhuanbian.Text = "";
                return;
            }
            if (string.IsNullOrEmpty(this.txtzhuanName.Text))
            {
                MessageBox.Show("专业名称不能为空");
                return;
            }

            model.Speciality_Name    = this.txtzhuanName.Text;
            model.Speciality_College = this.cmdyuanName.SelectedValue.ToString();
            model.Speciality_Years   = Convert.ToInt32(this.cmdxuezhi.SelectedValue);
            Speciality.AddSpeciality(model);
            GetAllSpeciality();
        }
Beispiel #9
0
        void GetAllSpeciality()
        {
            SpecialityBLL Speciality = new SpecialityBLL();

            datazhuan.DataSource = Speciality.GetAllSpeciality();
        }