Example #1
0
        private void button4_Click(object sender, EventArgs e)
        {
            if (txtSaddr.Text == "" && txtSname.Text == "" && txtSprice.Text == "")
            {
                return;
            }

            treeView1.Nodes.Clear();
            SectionRoom s = new SectionRoom();

            s.Sname  = txtSname.Text;
            s.Saddr  = txtSaddr.Text;
            s.Sprice = int.Parse(txtSprice.Text);
            string result = new SectionRoomBLL().Chuan(s);

            if (result == 1 + "")
            {
                se.Add(s);
            }
            else
            {
                MessageBox.Show(result);
            }
            SectionRoomSon_Load(null, null);
        }
Example #2
0
        //添加科别
        private void BtnSecAdd_Click(object sender, RoutedEventArgs e)
        {
            if (txtSaddr.Text == "" && txtSname.Text == "" && txtSprice.Text == "")
            {
                return;
            }
            SectionRoom s = new SectionRoom();

            s.Sname  = txtSname.Text;
            s.Saddr  = txtSaddr.Text;
            s.Sprice = int.Parse(txtSprice.Text);
            string result = new SectionRoomBLL().Chuan(s);

            if (result == 1 + "")
            {
                se.Add(s);
            }
            else
            {
                MessageBox.Show(result);
            }
            SectionroomManage_Load(null, null);
        }