protected void submitButton_Click(object sender, EventArgs e) { //清空Label信息 this.ClearLabel(); //验证分类名称是否有效 if (!ValidateFLMC()) { return; } //验证分类编码是否有效 if (!ValidateFLBM()) { return; } //验证通过则插入新记录 HYBZ_FL hybzFL = new HYBZ_FL(); hybzFL.flmc = this.flmcTextBox.Text.Trim(); hybzFL.flbm = this.flbmTextBox.Text.Trim(); hybzFL.zyfl = this.zyflTextBox.Text.Trim(); hybzFL.ywmc = this.wwmcTextBox.Text.Trim(); hybzFL.wjtz = this.wjtzTextBox.Text.Trim(); hybzFL.fjtz = this.fjtzTextBox.Text.Trim(); hybzFL.zgbm = this.zgbmTextBox.Text.Trim(); hybzDAO.InsertHYBZ_FL(hybzFL); Response.Write("<Script>alert('添加行业标准分类成功')</Script>"); }
/// <summary> /// 更新一条分类信息 /// </summary> /// <param name="hybz_fl">要更新的分类信息</param> /// <returns></returns> public Boolean UpdateHYBZ_FL(HYBZ_FL hybz_fl) { Boolean flag = true; int back = sqlMapper.Update("UpdateHYBZ_FL", hybz_fl); if (back <= 0) { flag = false; } return flag; }
/// <summary> /// 插入一条分类信息 /// </summary> /// <param name="hybz_fl">分类信息</param> /// <returns></returns> public Boolean InsertHYBZ_FL(HYBZ_FL hybz_fl) { Boolean flag = true; try { sqlMapper.Insert("InsertHYBZ_FL", hybz_fl); } catch (Exception) { flag = false; } return flag; }