private void InitAction() { if (Request.QueryString["type"] != null) { string type = Request.QueryString["type"].ToString(); // 判断动作 switch (type) { case "add": break; case "modify": if (Request.QueryString["id"] != null) { int id = int.Parse(Request.QueryString["id"].ToString()); InitData(id); } else { ArtDilog.AlertAndRefresh("参数错误!", 1, "addArt", "error"); } break; } this.hdfAction.Value = type; } else { ArtDilog.AlertAndRefresh("参数错误!", 1, "addArt", "error"); } }
private void Add(Ads model) { int rows = bll.Add(model); if (rows > 0) { ArtDilog.AlertAndRefresh("添加信息成功!", 1); } else { ArtDilog.Alert("添加信息失败!", "error", 2); } }
private void Modify(Ads model) { bll.Update(model); ArtDilog.AlertAndRefresh("修改信息成功!", 1); }