protected void btnupdael_Click(object sender, EventArgs e) { Maticsoft.BLL.ComPanyInfo combll = new Maticsoft.BLL.ComPanyInfo(); Maticsoft.Model.ComPanyInfo commodel = combll.GetgonggaoModel(2); commodel.Gonggao = txtwenhua.Text.Trim(); combll.Update(commodel); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('信息提交成功')</script>"); bind(); }
public void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtGonggao.Text.Trim().Length == 0) { strErr += "Gonggao不能为空!\\n"; } if (!PageValidate.IsDateTime(txtGongTime.Text)) { strErr += "GongTime格式错误!\\n"; } if (this.txtImageURL.Text.Trim().Length == 0) { strErr += "ImageURL不能为空!\\n"; } if (!PageValidate.IsNumber(txtFenleiID.Text)) { strErr += "FenleiID格式错误!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int XianshiID = int.Parse(this.lblXianshiID.Text); string Gonggao = this.txtGonggao.Text; DateTime GongTime = DateTime.Parse(this.txtGongTime.Text); string ImageURL = this.txtImageURL.Text; int FenleiID = int.Parse(this.txtFenleiID.Text); Maticsoft.Model.ComPanyInfo model = new Maticsoft.Model.ComPanyInfo(); model.XianshiID = XianshiID; model.Gonggao = Gonggao; model.GongTime = GongTime; model.ImageURL = ImageURL; model.FenleiID = FenleiID; Maticsoft.BLL.ComPanyInfo bll = new Maticsoft.BLL.ComPanyInfo(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx"); }