protected void submitButton_Click(object sender, EventArgs e) { //验证分类名称是否有效 if (!ValidateFLMC()) { return; } //验证分类编码是否有效 else if (!ValidateFLBM()) { return; } //验证通过则插入新记录 BDBK_FL bdbkFL = new BDBK_FL(); bdbkFL.flmc = this.flmcTextBox.Text.Trim(); bdbkFL.flbm = this.flbmTextBox.Text.Trim(); bdbkFL.zyfl = this.zyflTextBox.Text.Trim(); if (bdbkDAO.InsertBDBK_FL(bdbkFL)) { Response.Write("<Script>alert('添加经济报刊分类成功')</Script>"); } else { Response.Write("<Script>alert('添加经济报刊分类失败')</Script>"); } }
/// <summary> /// 更新一条分类信息 /// </summary> /// <param name="bdbk_fl">要更新的分类信息</param> /// <returns></returns> public Boolean UpdateBDBK_FL(BDBK_FL bdbk_fl) { Boolean flag = true; int back = sqlMapper.Update("UpdateBDBK_FL", bdbk_fl); if (back <= 0) { flag = false; } return flag; }
/// <summary> /// 插入一条分类信息 /// </summary> /// <param name="bdbk_fl">分类信息</param> /// <returns></returns> public Boolean InsertBDBK_FL(BDBK_FL bdbk_fl) { Boolean flag = true; try { sqlMapper.Insert("InsertBDBK_FL", bdbk_fl); } catch (Exception) { flag = false; } return flag; }