示例#1
0
        /// <summary>
        /// 插入广发联名卡发券任务
        /// </summary>
        /// <param name="task"></param>
        /// <returns></returns>
        public async Task <bool> InsertGFBankPromotionTask(GFBankPromotionTask task)
        {
            var sql = @"INSERT  Tuhu_groupon..GFBankPromotionTask
        ( UserId ,
          Mobile ,
          RuleGuid ,
          BusinessType ,
          Status ,
          SourceFileName 
        )
VALUES  ( @UserId ,
          @Mobile ,
          @RuleGuid ,
          @BusinessType ,
          @Status ,
          @SourceFileName 
        );";

            using (var dbHelper = DbHelper.CreateDbHelper(Tuhu_Groupon_Write_Str))
                using (var cmd = dbHelper.CreateCommand(sql))
                {
                    cmd.Parameters.Add(new SqlParameter("@UserId", task.UserId));
                    cmd.Parameters.Add(new SqlParameter("@Mobile", task.Mobile));
                    cmd.Parameters.Add(new SqlParameter("@RuleGuid", task.RuleGuid));
                    cmd.Parameters.Add(new SqlParameter("@BusinessType", task.BusinessType));
                    cmd.Parameters.Add(new SqlParameter("@Status", task.Status));
                    cmd.Parameters.Add(new SqlParameter("@SourceFileName", task.SourceFileName));
                    return((await dbHelper.ExecuteNonQueryAsync(cmd)) > 0);
                }
        }
 public GFPromotionTaskExecutor(GFBankPromotionTask task)
 {
     this._task = task;
 }