protected void btnSubmit_Click(object sender, EventArgs e) { Cms.BLL.wx_msg bll = new Cms.BLL.wx_msg(); Cms.Model.wx_msg bml = new Cms.Model.wx_msg(); string action = this.Request.QueryString["action"] ?? "";//编辑:edit 添加:add int id = Convert.ToInt32(this.Request.QueryString["id"] ?? "0"); bool bl = false; if (action == "add") { bml.orderNumber = tborderNumber.Text.Trim(); bml.info = tbinfo.Value; bml.updatetime = DateTime.Now; bl = bll.Add(bml) > 0 ? true : false; } else { bml = new Cms.BLL.wx_msg().GetModel(id); bml.orderNumber = tborderNumber.Text.Trim(); bml.info = tbinfo.Value; bl = bll.Update(bml); } if (bl) { //ShowConfirm("是否继续添加?", "msgedit.aspx?action=add", "msglist.aspx"); JscriptMsg("提交成功!", "msglist.aspx", "Success"); } else { JscriptMsg("提交失败!", "msgedit.aspx?action=Edit?id=" + id, "Error"); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Cms.Model.wx_msg model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Cms.Model.wx_msg model) { return(dal.Add(model)); }