protected void bt_OK_Click(object sender, EventArgs e) { BBS_BoardBLL _bll = null; if (bt_OK.Text == "添加") { _bll = new BBS_BoardBLL(); } else { _bll = new BBS_BoardBLL((int)ViewState["ID"]); } UC_Board.GetData(_bll.Model); if (bt_OK.Text == "添加") { _bll.Model.Catalog = (int)ViewState["CatalogID"]; ViewState["ID"] = _bll.Add(); } else { _bll.Update(); } MessageBox.ShowAndRedirect(this, "保存成功", "index.aspx"); }
private void BindData() { BBS_BoardBLL bll = new BBS_BoardBLL((int)ViewState["ID"]); UC_Board.BindData(bll.Model); bt_OK.Text = "修改"; bt_OK.ForeColor = System.Drawing.Color.Red; }