protected void btnok_Click(object sender, EventArgs e) { Maticsoft.BLL.ComPanyInfo combll = new Maticsoft.BLL.ComPanyInfo(); Maticsoft.Model.ComPanyInfo commodel = new Maticsoft.Model.ComPanyInfo(); commodel.Gonggao = txtwenhua.Text.Trim(); combll.Add(commodel); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('信息添加成功')</script>"); bind(); }
protected void btnok_Click(object sender, EventArgs e) { Maticsoft.BLL.ComPanyInfo combll = new Maticsoft.BLL.ComPanyInfo(); Maticsoft.Model.ComPanyInfo commodel = new Maticsoft.Model.ComPanyInfo(); commodel.Gonggao = txtgong.Text.Trim(); commodel.GongTime = Convert.ToDateTime(DateTime.Now.ToString()); commodel.FenleiID = 1; combll.Add(commodel); Page.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('信息提交成功!')</script>"); bind(); }
protected 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; } 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.Gonggao = Gonggao; model.GongTime = GongTime; model.ImageURL = ImageURL; model.FenleiID = FenleiID; Maticsoft.BLL.ComPanyInfo bll = new Maticsoft.BLL.ComPanyInfo(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }