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