コード例 #1
0
 private void SetAddUserRejectionParameters(int downloadId, FailedUserData failedUserData,
                                            AddUserRejectionParameters parameters)
 {
     parameters.DownloadId.Value      = downloadId;
     parameters.LineNumber.Value      = failedUserData.LineNumber;
     parameters.RejectionReason.Value = errorMessageService.GetErrorMessage(failedUserData);
 }
コード例 #2
0
        private void AddUserRejections(IDatabaseConnectionService databaseConnection, DbTransaction transaction,
                                       int downloadId, IEnumerable <FailedUserData> failedUsersData)
        {
            AddUserRejectionParameters parameters = CreateAddUserRejectionParameters(databaseConnection);

            using (DbCommand command = databaseConnection.CreateDbCommand())
            {
                command.CommandText = Constants.StatsUploadDatabase.AddUserRejectionProcedureName;
                command.CommandType = CommandType.StoredProcedure;
                command.Transaction = transaction;
                command.Parameters.AddRange(parameters.AllParameters);

                foreach (FailedUserData failedUserData in failedUsersData ?? new FailedUserData[0])
                {
                    SetAddUserRejectionParameters(downloadId, failedUserData, parameters);
                    command.ExecuteNonQuery();
                }
            }
        }