コード例 #1
0
        /// <summary>
        /// 新增基金信息
        /// </summary>
        /// <param name="contributionFundEntity"></param>
        /// <returns></returns>
        public bool AddContributionFund(ContributionFundEntity contributionFundEntity,DbTransaction trans=null)
        {
            StringBuilder sqlCommandText = new StringBuilder();
            sqlCommandText.Append(" @CID");
            sqlCommandText.Append(", @JournalID");
            sqlCommandText.Append(", @FundLevel");
            sqlCommandText.Append(", @FundCode");
            sqlCommandText.Append(", @FundName");
            sqlCommandText.Append(", @FundCertPath");
            sqlCommandText.Append(", @Note");

            DbCommand cmd = db.GetSqlStringCommand(String.Format("INSERT INTO dbo.ContributionFund ({0},AddDate) VALUES ({1},getdate())", sqlCommandText.ToString().Replace("@", ""), sqlCommandText.ToString()));

            db.AddInParameter(cmd, "@CID", DbType.Int64, contributionFundEntity.CID);
            db.AddInParameter(cmd, "@JournalID", DbType.Int64, contributionFundEntity.JournalID);
            db.AddInParameter(cmd, "@FundLevel", DbType.Int32, contributionFundEntity.FundLevel);
            db.AddInParameter(cmd, "@FundCode", DbType.AnsiString, contributionFundEntity.FundCode.TextFilter());
            db.AddInParameter(cmd, "@FundName", DbType.AnsiString, contributionFundEntity.FundName.TextFilter());
            db.AddInParameter(cmd, "@FundCertPath", DbType.AnsiString, contributionFundEntity.FundCertPath);
            db.AddInParameter(cmd, "@Note", DbType.AnsiString, contributionFundEntity.Note.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;
            }
        }
コード例 #2
0
 /// <summary>
 /// 新增基金信息
 /// </summary>
 /// <param name="contributionFundEntity"></param>
 /// <returns></returns>
 public bool AddContributionFund(ContributionFundEntity contributionFundEntity)
 {
     return ContributionInfoBusProvider.AddContributionFund(contributionFundEntity);
 }
コード例 #3
0
 /// <summary>
 /// 编辑基金信息
 /// </summary>
 /// <param name="contributionFundEntity"></param>
 /// <returns></returns>
 public bool UpdateContributionFund(ContributionFundEntity contributionFundEntity)
 {
     return ContributionInfoDataAccess.Instance.UpdateContributionFund(contributionFundEntity);
 }
コード例 #4
0
 /// <summary>
 /// 编辑基金信息
 /// </summary>
 /// <param name="contributionFundEntity"></param>
 /// <returns></returns>
 public bool UpdateContributionFund(ContributionFundEntity contributionFundEntity)
 {
     return ContributionInfoBusProvider.UpdateContributionFund(contributionFundEntity);
 }