Example #1
0
        /// <summary>
        /// 添加补贴配置记录
        /// danny-20150320
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool SaveData(SubsidyModel model)
        {
            try
            {
                string        sql  = @"
                           INSERT INTO subsidy
                               ( [OrderCommission]
                                ,[DistribSubsidy]
                                ,[WebsiteSubsidy]
                                ,[StartDate]
                                ,[EndDate]
                                ,[Status]
                                ,[GroupId])
                         VALUES
                               (@OrderCommission
                               ,@DistribSubsidy
                               ,@WebsiteSubsidy
                               ,@StartDate
                               ,@EndDate
                               ,@Status
                               ,@GroupId)SELECT @@IDENTITY  ";
                IDbParameters parm = DbHelper.CreateDbParameters();
                parm.AddWithValue("@OrderCommission", model.OrderCommission != null ? model.OrderCommission.Value / 100 : 0.1m);
                parm.AddWithValue("@DistribSubsidy", model.DistribSubsidy);
                parm.AddWithValue("@WebsiteSubsidy", model.WebsiteSubsidy);
                parm.AddWithValue("@StartDate", model.StartDate);
                parm.AddWithValue("@EndDate", model.EndDate);
                parm.AddWithValue("@Status", 1);
                parm.AddWithValue("@GroupId", model.GroupId);
                return(ParseHelper.ToInt(DbHelper.ExecuteScalar(SuperMan_Write, sql, parm)) > 0 ? true : false);
            }
            catch (Exception ex)
            {
                LogHelper.LogWriter("添加补贴配置记录", new { ex = ex, model = model });
                return(false);

                throw;
            }
        }
 /// <summary>
 /// 添加补贴配置记录
 /// danny-20150320
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public bool SaveData(SubsidyModel model)
 {
     return(subsidyDao.SaveData(model));
 }