/// <summary> /// 编辑参考文献 /// </summary> /// <param name="contributionReferenceEntity"></param> /// <returns></returns> public bool UpdateContributionReference(ContributionReferenceEntity contributionReferenceEntity) { return ContributionInfoDataAccess.Instance.UpdateContributionReference(contributionReferenceEntity); }
/// <summary> /// 新增参考文献 /// </summary> /// <param name="contributionReferenceEntity"></param> /// <returns></returns> public bool AddContributionReference(ContributionReferenceEntity contributionReferenceEntity,DbTransaction trans=null) { StringBuilder sqlCommandText = new StringBuilder(); sqlCommandText.Append(" @CID"); sqlCommandText.Append(", @JournalID"); sqlCommandText.Append(", @Title"); sqlCommandText.Append(", @RefUrl"); DbCommand cmd = db.GetSqlStringCommand(String.Format("INSERT INTO dbo.ContributionReference ({0},AddDate) VALUES ({1},getdate())", sqlCommandText.ToString().Replace("@", ""), sqlCommandText.ToString())); db.AddInParameter(cmd, "@CID", DbType.Int64, contributionReferenceEntity.CID); db.AddInParameter(cmd, "@JournalID", DbType.Int64, contributionReferenceEntity.JournalID); db.AddInParameter(cmd, "@Title", DbType.AnsiString, contributionReferenceEntity.Title.TextFilter()); db.AddInParameter(cmd, "@RefUrl", DbType.AnsiString, contributionReferenceEntity.RefUrl.TextFilter()); try { bool result = false; if (trans == null) result = db.ExecuteNonQuery(cmd) > 0; else result = db.ExecuteNonQuery(cmd, trans) > 0; if (!result) throw new Exception("新增稿件参考文献失败!"); return result; } catch (Exception ex) { throw ex; } }
/// <summary> /// 新增参考文献 /// </summary> /// <param name="contributionReferenceEntity"></param> /// <returns></returns> public bool AddContributionReference(ContributionReferenceEntity contributionReferenceEntity) { return ContributionInfoBusProvider.AddContributionReference(contributionReferenceEntity); }