public FdpImportErrorExclusion FdpImportErrorExclusionDelete(FdpImportErrorExclusion fdpImportErrorExclusion) { FdpImportErrorExclusion retVal = new EmptyFdpImportErrorExclusion(); using (var conn = DbHelper.GetDBConnection()) { try { var para = new DynamicParameters(); para.Add("@FdpImportErrorExclusionId", fdpImportErrorExclusion.FdpImportErrorExclusionId.GetValueOrDefault(), DbType.Int32); para.Add("@CDSId", CurrentCDSID, DbType.String); // Skip the first dataset which is the import queue from a child sproc var multiple = conn.QueryMultiple("Fdp_ImportErrorExclusion_Delete", para, commandType: CommandType.StoredProcedure); //multiple.Read(); var results = multiple.Read <FdpImportErrorExclusion>(); if (results.Any()) { retVal = results.First(); } } catch (Exception ex) { Log.Error(ex); throw; } } return(retVal); }
public async Task <ActionResult> Delete(IgnoredExceptionParameters parameters) { var ignoredExceptionView = await GetModelFromParameters(parameters); if (ignoredExceptionView.IgnoredException is EmptyFdpImportErrorExclusion) { return(JsonGetFailure("IgnoredException does not exist")); } ignoredExceptionView.IgnoredException = await DataContext.Import.DeleteFdpImportErrorExclusion(FdpImportErrorExclusion.FromParameters(parameters)); if (ignoredExceptionView.IgnoredException is EmptyFdpImportErrorExclusion) { return(JsonGetFailure("IgnoredException could not be deleted")); } return(JsonGetSuccess()); }
public async Task <FdpImportErrorExclusion> DeleteFdpImportErrorExclusion(FdpImportErrorExclusion fdpImportErrorExclusion) { return(await Task.FromResult(_importDataStore.FdpImportErrorExclusionDelete(fdpImportErrorExclusion))); }