protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtF_Title.Text.Trim().Length == 0) { strErr += "标题不能为空!\\n"; } if (this.txtF_Note.Text.Trim().Length == 0) { strErr += "内容不能为空!\\n"; } if (this.txtF_DateTime.Text.Trim().Length == 0) { strErr += "时间不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string F_Title = this.txtF_Title.Text; string F_Note = this.txtF_Note.Text; string F_DateTime = this.txtF_DateTime.Text; WSS.Model.PubNotice model = new WSS.Model.PubNotice(); model.F_Title = F_Title; model.F_Note = F_Note; model.F_DateTime = F_DateTime; WSS.BLL.PubNotice bll = new WSS.BLL.PubNotice(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }
private void ShowInfo(int F_ID) { WSS.BLL.PubNotice bll = new WSS.BLL.PubNotice(); WSS.Model.PubNotice model = bll.GetModel(F_ID); this.lblF_ID.Text = model.F_ID.ToString(); this.txtF_Title.Text = model.F_Title; this.txtF_Note.Text = model.F_Note; this.txtF_DateTime.Text = model.F_DateTime; }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { WSS.BLL.PubNotice bll = new WSS.BLL.PubNotice(); if (Request.Params["id"] != null && Request.Params["id"].Trim() != "") { int F_ID = (Convert.ToInt32(Request.Params["id"])); bll.Delete(F_ID); Response.Redirect("list.aspx"); } } }