Example #1
0
File: OrgSetForm.cs Project: Gqqq/-
        void Getyuan()
        {
            CollegesBLL college = new CollegesBLL();

            this.cmbyuan.DisplayMember = "学院名称";
            this.cmbyuan.ValueMember   = "学院编号";
            this.cmbyuan.DataSource    = college.GetAllColleges();
        }
Example #2
0
File: OrgSetForm.cs Project: Gqqq/-
        void GetAllCollege()
        {
            SpeYearsBLL year    = new SpeYearsBLL();
            CollegesBLL college = new CollegesBLL();
            DataTable   dt      = college.GetAllColleges();

            cmdyuanName.DisplayMember = "学院名称";
            cmdyuanName.ValueMember   = "学院编号";
            cmdyuanName.DataSource    = dt;
            DataTable ydt = year.GetAllSpeYears();

            cmdxuezhi.DisplayMember = "学制名称";
            cmdxuezhi.ValueMember   = "学制编号";
            cmdxuezhi.DataSource    = ydt;
        }
Example #3
0
File: OrgSetForm.cs Project: Gqqq/-
        private void btnyuanUpdate_Click(object sender, EventArgs e)
        {
            CollegesBLL   college = new CollegesBLL();
            CollegesModel model   = new CollegesModel();

            if (this.datayuan.SelectedRows.Count > 0)
            {
                string ID   = this.datayuan.SelectedRows[0].Cells["学院编号"].Value.ToString();
                string name = this.datayuan.SelectedRows[0].Cells["学院名称"].Value.ToString();
                model.College_ID   = ID;
                model.College_Name = name;
                college.UPColleges(model);
                GetAllColleges();
            }
        }
Example #4
0
File: OrgSetForm.cs Project: Gqqq/-
        private void btnseleyuan_Click(object sender, EventArgs e)
        {
            CollegesBLL   college = new CollegesBLL();
            CollegesModel model   = new CollegesModel();

            if (this.cmdName.SelectedItem.ToString() == "按照编号")
            {
                model.College_ID = "%" + this.txtchaname.Text + "%";
                DataTable dt = college.GetIDColleges(model);
                datayuan.DataSource = dt;
            }
            else if (this.cmdName.SelectedItem.ToString() == "按照名称")
            {
                model.College_Name = "%" + this.txtchaname.Text + "%";
                DataTable dt = college.GetNameColleges(model);
                datayuan.DataSource = dt;
            }
        }
Example #5
0
File: OrgSetForm.cs Project: Gqqq/-
        private void btnAddyuan_Click(object sender, EventArgs e)
        {
            CollegesBLL   college = new CollegesBLL();
            CollegesModel model   = new CollegesModel();

            if (this.txtyuanbian.TextLength != 2)
            {
                MessageBox.Show("学院编号只能为两位");
                this.txtyuanbian.Text = "";
                return;
            }
            model.College_ID = this.txtyuanbian.Text;
            bool b = college.SeleColleges(model);

            if (b == true)
            {
                MessageBox.Show("编号已存在,请重新输入");
                this.txtyuanbian.Text = "";
                return;
            }
            if (string.IsNullOrEmpty(this.txtyuanbian.Text))
            {
                MessageBox.Show("学院编号不能为空");
                return;
            }
            if (string.IsNullOrEmpty(this.txtyuanName.Text))
            {
                MessageBox.Show("学院名称不能为空");
                return;
            }
            try
            {
                model.College_ID = this.txtyuanbian.Text;
            }
            catch
            {
                MessageBox.Show("学院编号重复");
                this.txtyuanbian.Text = "";
            }
            model.College_Name = this.txtyuanName.Text;
            college.AddColleges(model);
            GetAllColleges();
        }
Example #6
0
File: OrgSetForm.cs Project: Gqqq/-
        private void btnyuandele_Click(object sender, EventArgs e)
        {
            CollegesBLL   college = new CollegesBLL();
            CollegesModel model   = new CollegesModel();

            if (this.datayuan.SelectedRows.Count > 0)
            {
                string ID = this.datayuan.SelectedRows[0].Cells["学院编号"].Value.ToString();
                model.College_ID = ID;
                try
                {
                    college.DeleColleges(model);
                    GetAllColleges();
                }
                catch
                {
                    MessageBox.Show("删除失败");
                }
            }
        }
Example #7
0
File: OrgSetForm.cs Project: Gqqq/-
        private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            CollegesBLL   college = new CollegesBLL();
            CollegesModel model   = new CollegesModel();

            if (this.txtyuanbian.TextLength != 2)
            {
                MessageBox.Show("学院编号只能为两位");
                this.txtyuanbian.Text = "";
                return;
            }
            model.College_ID = this.txtyuanbian.Text;
            bool b = college.SeleColleges(model);

            if (b == true)
            {
                MessageBox.Show("编号已存在,请重新输入");
                this.txtyuanbian.Text = "";
                return;
            }
        }
Example #8
0
File: OrgSetForm.cs Project: Gqqq/-
        void GetAllColleges()
        {
            CollegesBLL college = new CollegesBLL();

            datayuan.DataSource = college.GetAllColleges();
        }