protected void submitButton_Click(object sender, EventArgs e) { //验证分类名称是否有效 if (!ValidateFLMC()) { return; } //验证分类编码是否有效 else if (!ValidateFLBM()) { return; } //验证通过则插入新记录 ZWHY_FL zwhyFL = new ZWHY_FL(); zwhyFL.flmc = this.flmcTextBox.Text.Trim(); zwhyFL.flbm = this.flbmTextBox.Text.Trim(); zwhyFL.flsm = this.flsmTextBox.Text.Trim(); zwhyFL.zwgjc = this.zwgjcTextBox.Text.Trim(); zwhyFL.wwgjc = this.wwgjcTextBox.Text.Trim(); zwhyFL.tsfl = this.tsflTextBox.Text.Trim(); zwhyDAO.insertZwhyFL(zwhyFL); Response.Write("<Script>alert('添加中文会议分类成功')</Script>"); }
/// <summary> /// 按分类编码更新分类信息。 /// 分类编码为主键。 /// </summary> /// <param name="fl"></param> /// <returns></returns> public bool updateZwhyFLByFLBM(ZWHY_FL fl) { bool result; try { sqlMapper.BeginTransaction(); sqlMapper.Update("UpdateZWHY_FL", fl); sqlMapper.CommitTransaction(); result = true; } catch { sqlMapper.RollBackTransaction(); result = false; } return result; }
/// <summary> /// 插入中文会议分类信息。 /// </summary> /// <param name="fl"></param> public void insertZwhyFL(ZWHY_FL fl) { sqlMapper.Insert("InsertZWHY_FL", fl); }