protected void submitButton_Click(object sender, EventArgs e) { //验证分类名称是否有效 if (!ValidateFLMC()) { return; } //验证分类编码是否有效 else if (!ValidateFLBM()) { return; } //验证通过则插入新记录 KJBG_FL kjbgFL = new KJBG_FL(); kjbgFL.flmc = this.flmcTextBox.Text.Trim(); kjbgFL.flbm = this.flbmTextBox.Text.Trim(); kjbgFL.flsm = this.flsmTextBox.Text.Trim(); kjbgDAO.InsertKJBG_FL(kjbgFL); Response.Write("<Script>alert('添加考察报告分类成功')</Script>"); }
/// <summary> /// 更新一条分类信息 /// </summary> /// <param name="kjbg_fl">要更新的分类信息</param> /// <returns></returns> public Boolean UpdateKJBG_FL(KJBG_FL kjbg_fl) { Boolean flag = true; int back = sqlMapper.Update("UpdateKJBG_FL", kjbg_fl); if (back <= 0) { flag = false; } return flag; }
/// <summary> /// 插入一条分类信息 /// </summary> /// <param name="kjbg_fl">分类信息</param> /// <returns></returns> public Boolean InsertKJBG_FL(KJBG_FL kjbg_fl) { Boolean flag = true; try { sqlMapper.Insert("InsertKJBG_FL", kjbg_fl); } catch (Exception) { flag = false; } return flag; }