Example #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            HallInfo model = new HallInfo()
            {
                HTitle = txtTitle.Text
            };

            if (btnSave.Text == "添加")
            {
                if (!bll.Add(model))
                {
                    MessageBox.Show("添加失败");
                    return;
                }
                else
                {
                    result = DialogResult.OK;
                    LoadList();
                }
            }
            else
            {
                model.HId = Convert.ToInt32(txtId.Text);
                if (!bll.Update(model))
                {
                    MessageBox.Show("修改失败");
                    return;
                }
                else
                {
                    result = DialogResult.OK;
                    LoadList();
                }
            }
            Reset();
        }