protected void submitButton_Click(object sender, EventArgs e) { //清空Label信息 this.ClearLabel(); //验证分类名称是否有效 if (!ValidateFLMC()) { return; } //验证分类编码是否有效 else if (!ValidateFLBM()) { return; } //验证通过则插入新记录 ZWQK_FL zwqkFL = new ZWQK_FL(); zwqkFL.flmc = this.flmcTextBox.Text.Trim(); zwqkFL.flbm = this.flbmTextBox.Text.Trim(); zwqkFL.flsm = this.flsmTextBox.Text.Trim(); zwqkDAO.insertZwqkFL(zwqkFL); Response.Write("<Script>alert('添加中文期刊分类成功')</Script>"); //Response.Redirect(GlobalResource.SUCCESS_PAGE + "?message=添加中文期刊分类成功"); }
/// <summary> /// 按分类编码更新分类信息。 /// 分类编码为主键。 /// </summary> /// <param name="fl"></param> /// <returns></returns> public bool updateZwqkFLByFLBM(ZWQK_FL fl) { bool result; try { sqlMapper.BeginTransaction(); sqlMapper.Update("UpdateZWQK_FL", fl); sqlMapper.CommitTransaction(); result = true; } catch { sqlMapper.RollBackTransaction(); result = false; } return result; }
/// <summary> /// 插入中文期刊分类信息。 /// </summary> /// <param name="fl"></param> public void insertZwqkFL(ZWQK_FL fl) { sqlMapper.Insert("InsertZWQK_FL", fl); }