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