protected void submitButton_Click(object sender, EventArgs e) { //验证分类名称是否有效 if (!ValidateZWMC()) { return; } //验证分类编码是否有效 else if (!ValidateFLBM()) { return; } //验证通过则插入新记录 NYBG_FL nybgFL = new NYBG_FL(); nybgFL.zwmc = this.zwmcTextBox.Text.Trim(); nybgFL.flbm = this.flbmTextBox.Text.Trim(); nybgFL.wwmc = this.wwmcTextBox.Text.Trim(); nybgFL.fltx = this.fltxTextBox.Text.Trim(); nybgFL.bz = this.bzTextBox.Text.Trim(); nybgDAO.InsertNYBG_FL(nybgFL); Response.Write("<Script>alert('添加考察报告分类成功')</Script>"); }
/// <summary> /// 更新一条分类信息 /// </summary> /// <param name="nybg_fl">要更新的分类信息</param> /// <returns></returns> public Boolean UpdateNYBG_FL(NYBG_FL nybg_fl) { Boolean flag = true; int back = sqlMapper.Update("UpdateNYBG_FL", nybg_fl); if (back <= 0) { flag = false; } return flag; }
/// <summary> /// 插入一条分类信息 /// </summary> /// <param name="NYBG_pm">分类信息</param> /// <returns></returns> public Boolean InsertNYBG_FL(NYBG_FL NYBG_fl) { Boolean flag = true; try { sqlMapper.Insert("InsertNYBG_FL", NYBG_fl); } catch (Exception) { flag = false; } return flag; }