/// <summary> /// 增加一条数据 /// </summary> public bool Add(JobVsCommentModel model) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into JobVsComment("); strSql.Append("JobId,CommentId,VsType"); strSql.Append(") values ("); strSql.Append("@JobId,@CommentId,@VsType"); strSql.Append(") "); SqlParameter[] parameters = { new SqlParameter("@JobId", SqlDbType.VarChar, 50), new SqlParameter("@CommentId", SqlDbType.Decimal, 9), new SqlParameter("@VsType", SqlDbType.VarChar, 10) }; parameters[0].Value = model.JobId; parameters[1].Value = model.CommentId; parameters[2].Value = model.VsType; bool result = false; try { helper.ExecSqlReInt(strSql.ToString(), parameters); result = true; } catch (Exception ex) { this.helper.Close(); throw ex; } finally { } return(result); }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(JobVsCommentModel model) { bool reValue = true; int reCount = 0; StringBuilder strSql = new StringBuilder(); strSql.Append("update JobVsComment set "); strSql.Append(" JobId = @JobId , "); strSql.Append(" CommentId = @CommentId , "); strSql.Append(" VsType = @VsType "); strSql.Append(" where JobId=@JobId and CommentId=@CommentId "); SqlParameter[] parameters = { new SqlParameter("@JobId", SqlDbType.VarChar, 50), new SqlParameter("@CommentId", SqlDbType.Decimal, 9), new SqlParameter("@VsType", SqlDbType.VarChar, 10) }; parameters[0].Value = model.JobId; parameters[1].Value = model.CommentId; parameters[2].Value = model.VsType; try {//异常处理 reCount = this.helper.ExecSqlReInt(strSql.ToString(), parameters); } catch (Exception ex) { this.helper.Close(); throw ex; } if (reCount <= 0) { reValue = false; } return(reValue); }
/// <summary> /// 添加一个职位点评 /// </summary> /// <param name="model"></param> public void SaveNewJobVsDal(JobVsCommentModel model) { JvCDal.Add(model); }