예제 #1
0
    /// <summary>
    /// 添加
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSave_Click(object sender, EventArgs e)
    {
        string tname = txt_tname.Text;

        SP.Model.newsType model = new SP.Model.newsType();
        model.tname = tname;

        bll.Add(model);

        Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('操作成功,请返回!');location.href='List.aspx';</script>");
    }
예제 #2
0
    /// <summary>
    /// 编辑
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSave_Click(object sender, EventArgs e)
    {
        //更新
        string tname = txt_tname.Text;

        SP.Model.newsType model = new SP.Model.newsType();
        model.tname = tname;
        model.tid   = int.Parse(Request.QueryString["id"]);

        //提交到数据库
        bll.Update(model);

        Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('操作成功,请返回!');location.href='List.aspx';</script>");
    }
예제 #3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(SP.Model.newsType model)
 {
     return(dal.Update(model));
 }
예제 #4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(SP.Model.newsType model)
 {
     return(dal.Add(model));
 }