Removed superfluous try catch throw pattern
This commit is contained in:
@@ -223,8 +223,6 @@ MULTIPLE discount / markup ITEMS
|
|||||||
internal async Task<bool> DeleteAsync(long id)
|
internal async Task<bool> DeleteAsync(long id)
|
||||||
{
|
{
|
||||||
using (var transaction = await ct.Database.BeginTransactionAsync())
|
using (var transaction = await ct.Database.BeginTransactionAsync())
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
Contract dbObject = await GetAsync(id, false);
|
Contract dbObject = await GetAsync(id, false);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
@@ -240,19 +238,12 @@ MULTIPLE discount / markup ITEMS
|
|||||||
ct.Contract.Remove(dbObject);
|
ct.Contract.Remove(dbObject);
|
||||||
await ct.SaveChangesAsync();
|
await ct.SaveChangesAsync();
|
||||||
|
|
||||||
|
|
||||||
await EventLogProcessor.DeleteObjectLogAsync(UserId, BizType, dbObject.Id, dbObject.Name, ct);
|
await EventLogProcessor.DeleteObjectLogAsync(UserId, BizType, dbObject.Id, dbObject.Name, ct);
|
||||||
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, BizType, ct);
|
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, BizType, ct);
|
||||||
await TagBiz.ProcessDeleteTagsInRepositoryAsync(ct, dbObject.Tags);
|
await TagBiz.ProcessDeleteTagsInRepositoryAsync(ct, dbObject.Tags);
|
||||||
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -152,8 +152,7 @@ namespace AyaNova.Biz
|
|||||||
{
|
{
|
||||||
using (var transaction = await ct.Database.BeginTransactionAsync())
|
using (var transaction = await ct.Database.BeginTransactionAsync())
|
||||||
{
|
{
|
||||||
try
|
|
||||||
{
|
|
||||||
Customer dbObject = await GetAsync(id, false);
|
Customer dbObject = await GetAsync(id, false);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
{
|
{
|
||||||
@@ -205,14 +204,7 @@ namespace AyaNova.Biz
|
|||||||
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
//NOTE: no need to rollback the transaction, it will auto-rollback if not committed and it is disposed when it goes out of scope either way
|
|
||||||
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -119,8 +119,7 @@ namespace AyaNova.Biz
|
|||||||
Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction transaction = null;
|
Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction transaction = null;
|
||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
transaction = await ct.Database.BeginTransactionAsync();
|
transaction = await ct.Database.BeginTransactionAsync();
|
||||||
try
|
|
||||||
{
|
|
||||||
CustomerNote dbObject = await GetAsync(id, false);
|
CustomerNote dbObject = await GetAsync(id, false);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
{
|
{
|
||||||
@@ -142,12 +141,7 @@ namespace AyaNova.Biz
|
|||||||
//all good do the commit if it's ours
|
//all good do the commit if it's ours
|
||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|||||||
@@ -146,8 +146,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> DeleteAsync(long id)
|
internal async Task<bool> DeleteAsync(long id)
|
||||||
{
|
{
|
||||||
using (var transaction = await ct.Database.BeginTransactionAsync())
|
using (var transaction = await ct.Database.BeginTransactionAsync())
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
CustomerServiceRequest dbObject = await GetAsync(id, false);
|
CustomerServiceRequest dbObject = await GetAsync(id, false);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
@@ -170,12 +168,7 @@ namespace AyaNova.Biz
|
|||||||
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,8 +150,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> DeleteAsync(long id)
|
internal async Task<bool> DeleteAsync(long id)
|
||||||
{
|
{
|
||||||
using (var transaction = await ct.Database.BeginTransactionAsync())
|
using (var transaction = await ct.Database.BeginTransactionAsync())
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
var dbObject = await GetAsync(id, false);
|
var dbObject = await GetAsync(id, false);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
@@ -189,14 +187,7 @@ namespace AyaNova.Biz
|
|||||||
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
//NOTE: no need to rollback the transaction, it will auto-rollback if not committed and it is disposed when it goes out of scope either way
|
|
||||||
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,8 +151,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> DeleteAsync(long id)
|
internal async Task<bool> DeleteAsync(long id)
|
||||||
{
|
{
|
||||||
using (var transaction = await ct.Database.BeginTransactionAsync())
|
using (var transaction = await ct.Database.BeginTransactionAsync())
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
LoanUnit dbObject = await GetAsync(id, false);
|
LoanUnit dbObject = await GetAsync(id, false);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
@@ -175,12 +173,7 @@ namespace AyaNova.Biz
|
|||||||
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -137,8 +137,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> DeleteAsync(long id)
|
internal async Task<bool> DeleteAsync(long id)
|
||||||
{
|
{
|
||||||
using (var transaction = await ct.Database.BeginTransactionAsync())
|
using (var transaction = await ct.Database.BeginTransactionAsync())
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
var dbObject = await GetAsync(id, false);
|
var dbObject = await GetAsync(id, false);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
@@ -161,12 +159,7 @@ namespace AyaNova.Biz
|
|||||||
|
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -135,8 +135,6 @@ namespace AyaNova.Biz
|
|||||||
{
|
{
|
||||||
|
|
||||||
using (var transaction = await ct.Database.BeginTransactionAsync())
|
using (var transaction = await ct.Database.BeginTransactionAsync())
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
var dbObject = await GetAsync(id, false);
|
var dbObject = await GetAsync(id, false);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
@@ -161,12 +159,7 @@ namespace AyaNova.Biz
|
|||||||
|
|
||||||
//all good do the commit
|
//all good do the commit
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -231,7 +224,8 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(proposedObj.DeliveryMethod==NotifyDeliveryMethod.App && !string.IsNullOrEmpty(proposedObj.DeliveryAddress)){
|
if (proposedObj.DeliveryMethod == NotifyDeliveryMethod.App && !string.IsNullOrEmpty(proposedObj.DeliveryAddress))
|
||||||
|
{
|
||||||
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "DeliveryAddress", "In app delivery should not specify a delivery address");
|
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "DeliveryAddress", "In app delivery should not specify a delivery address");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -333,8 +333,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> PMDeleteAsync(long id)
|
internal async Task<bool> PMDeleteAsync(long id)
|
||||||
{
|
{
|
||||||
using (var transaction = await ct.Database.BeginTransactionAsync())
|
using (var transaction = await ct.Database.BeginTransactionAsync())
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
PM dbObject = await ct.PM.AsNoTracking().Where(z => z.Id == id).FirstOrDefaultAsync();// PMGetAsync(id, false);
|
PM dbObject = await ct.PM.AsNoTracking().Where(z => z.Id == id).FirstOrDefaultAsync();// PMGetAsync(id, false);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
@@ -363,14 +361,7 @@ namespace AyaNova.Biz
|
|||||||
await FileUtil.DeleteAttachmentsForObjectAsync(dbObject.AyaType, dbObject.Id, ct);
|
await FileUtil.DeleteAttachmentsForObjectAsync(dbObject.AyaType, dbObject.Id, ct);
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await PMHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await PMHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
//NOTE: no need to rollback the transaction, it will auto-rollback if not committed and it is disposed when it goes out of scope either way
|
|
||||||
|
|
||||||
throw;
|
|
||||||
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1196,8 +1187,7 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> ItemDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
internal async Task<bool> ItemDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
||||||
{
|
{
|
||||||
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
||||||
try
|
|
||||||
{
|
|
||||||
var dbObject = await ct.PMItem.AsNoTracking().SingleOrDefaultAsync(z => z.Id == id);
|
var dbObject = await ct.PMItem.AsNoTracking().SingleOrDefaultAsync(z => z.Id == id);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
{
|
{
|
||||||
@@ -1262,12 +1252,7 @@ namespace AyaNova.Biz
|
|||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await ItemHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await ItemHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1520,8 +1505,7 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> ExpenseDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
internal async Task<bool> ExpenseDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
||||||
{
|
{
|
||||||
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
||||||
try
|
|
||||||
{
|
|
||||||
var dbObject = await ExpenseGetAsync(id, false);
|
var dbObject = await ExpenseGetAsync(id, false);
|
||||||
ExpenseValidateCanDelete(dbObject);
|
ExpenseValidateCanDelete(dbObject);
|
||||||
if (HasErrors)
|
if (HasErrors)
|
||||||
@@ -1536,12 +1520,7 @@ namespace AyaNova.Biz
|
|||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await ExpenseHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await ExpenseHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1870,8 +1849,7 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> LaborDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
internal async Task<bool> LaborDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
||||||
{
|
{
|
||||||
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
||||||
try
|
|
||||||
{
|
|
||||||
var dbObject = await LaborGetAsync(id, false);
|
var dbObject = await LaborGetAsync(id, false);
|
||||||
LaborValidateCanDelete(dbObject);
|
LaborValidateCanDelete(dbObject);
|
||||||
if (HasErrors)
|
if (HasErrors)
|
||||||
@@ -1886,12 +1864,7 @@ namespace AyaNova.Biz
|
|||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await LaborHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await LaborHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2251,8 +2224,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> LoanDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
internal async Task<bool> LoanDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
||||||
{
|
{
|
||||||
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
||||||
try
|
|
||||||
{
|
|
||||||
var dbObject = await LoanGetAsync(id, false);
|
var dbObject = await LoanGetAsync(id, false);
|
||||||
LoanValidateCanDelete(dbObject);
|
LoanValidateCanDelete(dbObject);
|
||||||
if (HasErrors)
|
if (HasErrors)
|
||||||
@@ -2268,12 +2239,7 @@ namespace AyaNova.Biz
|
|||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await LoanHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await LoanHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2648,8 +2614,7 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> OutsideServiceDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
internal async Task<bool> OutsideServiceDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
||||||
{
|
{
|
||||||
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
||||||
try
|
|
||||||
{
|
|
||||||
var dbObject = await OutsideServiceGetAsync(id, false);
|
var dbObject = await OutsideServiceGetAsync(id, false);
|
||||||
OutsideServiceValidateCanDelete(dbObject);
|
OutsideServiceValidateCanDelete(dbObject);
|
||||||
if (HasErrors)
|
if (HasErrors)
|
||||||
@@ -2664,12 +2629,7 @@ namespace AyaNova.Biz
|
|||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await OutsideServiceHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await OutsideServiceHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2981,8 +2941,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> PartDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
internal async Task<bool> PartDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
||||||
{
|
{
|
||||||
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
||||||
try
|
|
||||||
{
|
|
||||||
var dbObject = await PartGetAsync(id, false);
|
var dbObject = await PartGetAsync(id, false);
|
||||||
PartValidateCanDelete(dbObject);
|
PartValidateCanDelete(dbObject);
|
||||||
if (HasErrors)
|
if (HasErrors)
|
||||||
@@ -3001,12 +2959,6 @@ namespace AyaNova.Biz
|
|||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await PartHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await PartHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3399,8 +3351,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> ScheduledUserDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
internal async Task<bool> ScheduledUserDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
||||||
{
|
{
|
||||||
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
||||||
try
|
|
||||||
{
|
|
||||||
var dbObject = await ScheduledUserGetAsync(id, false);
|
var dbObject = await ScheduledUserGetAsync(id, false);
|
||||||
ScheduledUserValidateCanDelete(dbObject);
|
ScheduledUserValidateCanDelete(dbObject);
|
||||||
if (HasErrors)
|
if (HasErrors)
|
||||||
@@ -3414,12 +3364,6 @@ namespace AyaNova.Biz
|
|||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await ScheduledUserHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await ScheduledUserHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3638,8 +3582,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> TaskDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
internal async Task<bool> TaskDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
||||||
{
|
{
|
||||||
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
||||||
try
|
|
||||||
{
|
|
||||||
var dbObject = await TaskGetAsync(id, false);
|
var dbObject = await TaskGetAsync(id, false);
|
||||||
TaskValidateCanDelete(dbObject);
|
TaskValidateCanDelete(dbObject);
|
||||||
if (HasErrors)
|
if (HasErrors)
|
||||||
@@ -3654,12 +3596,6 @@ namespace AyaNova.Biz
|
|||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await TaskHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await TaskHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3914,8 +3850,7 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> TravelDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
internal async Task<bool> TravelDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
||||||
{
|
{
|
||||||
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
||||||
try
|
|
||||||
{
|
|
||||||
var dbObject = await TravelGetAsync(id, false);
|
var dbObject = await TravelGetAsync(id, false);
|
||||||
TravelValidateCanDelete(dbObject);
|
TravelValidateCanDelete(dbObject);
|
||||||
if (HasErrors)
|
if (HasErrors)
|
||||||
@@ -3931,12 +3866,7 @@ namespace AyaNova.Biz
|
|||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await TravelHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await TravelHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4283,8 +4213,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> UnitDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
internal async Task<bool> UnitDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
||||||
{
|
{
|
||||||
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
||||||
try
|
|
||||||
{
|
|
||||||
var dbObject = await UnitGetAsync(id, false);
|
var dbObject = await UnitGetAsync(id, false);
|
||||||
UnitValidateCanDelete(dbObject);
|
UnitValidateCanDelete(dbObject);
|
||||||
if (HasErrors)
|
if (HasErrors)
|
||||||
@@ -4298,12 +4226,7 @@ namespace AyaNova.Biz
|
|||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await UnitHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await UnitHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5270,7 +5193,7 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
throw;
|
thrxxow;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -174,8 +174,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> DeleteAsync(long id)
|
internal async Task<bool> DeleteAsync(long id)
|
||||||
{
|
{
|
||||||
using (var transaction = await ct.Database.BeginTransactionAsync())
|
using (var transaction = await ct.Database.BeginTransactionAsync())
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
PartAssembly dbObject = await GetAsync(id, false);
|
PartAssembly dbObject = await GetAsync(id, false);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
@@ -198,12 +196,7 @@ namespace AyaNova.Biz
|
|||||||
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,8 +151,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> DeleteAsync(long id)
|
internal async Task<bool> DeleteAsync(long id)
|
||||||
{
|
{
|
||||||
using (var transaction = await ct.Database.BeginTransactionAsync())
|
using (var transaction = await ct.Database.BeginTransactionAsync())
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
Part dbObject = await GetAsync(id, false);
|
Part dbObject = await GetAsync(id, false);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
@@ -175,12 +173,7 @@ namespace AyaNova.Biz
|
|||||||
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,8 +42,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<PartInventory> CreateAsync(dtPartInventory newDtObject)
|
internal async Task<PartInventory> CreateAsync(dtPartInventory newDtObject)
|
||||||
{
|
{
|
||||||
using (var transaction = await ct.Database.BeginTransactionAsync())
|
using (var transaction = await ct.Database.BeginTransactionAsync())
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
//get the last record if exists (will not if opening balance)
|
//get the last record if exists (will not if opening balance)
|
||||||
var LastEntry = await ct.PartInventory.OrderByDescending(m => m.EntryDate).FirstOrDefaultAsync(m => m.PartId == newDtObject.PartId && m.PartWarehouseId == newDtObject.PartWarehouseId);
|
var LastEntry = await ct.PartInventory.OrderByDescending(m => m.EntryDate).FirstOrDefaultAsync(m => m.PartId == newDtObject.PartId && m.PartWarehouseId == newDtObject.PartWarehouseId);
|
||||||
@@ -80,12 +78,6 @@ namespace AyaNova.Biz
|
|||||||
return newObject;
|
return newObject;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -93,8 +85,6 @@ namespace AyaNova.Biz
|
|||||||
//CREATE (internal version)
|
//CREATE (internal version)
|
||||||
//
|
//
|
||||||
internal async Task<PartInventory> CreateAsync(dtInternalPartInventory newDtObject)
|
internal async Task<PartInventory> CreateAsync(dtInternalPartInventory newDtObject)
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
//get the last record if exists (will not if opening balance)
|
//get the last record if exists (will not if opening balance)
|
||||||
var LastEntry = await ct.PartInventory.OrderByDescending(m => m.EntryDate).FirstOrDefaultAsync(m => m.PartId == newDtObject.PartId && m.PartWarehouseId == newDtObject.PartWarehouseId);
|
var LastEntry = await ct.PartInventory.OrderByDescending(m => m.EntryDate).FirstOrDefaultAsync(m => m.PartId == newDtObject.PartId && m.PartWarehouseId == newDtObject.PartWarehouseId);
|
||||||
@@ -130,13 +120,6 @@ namespace AyaNova.Biz
|
|||||||
return newObject;
|
return newObject;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -151,8 +151,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> DeleteAsync(long id)
|
internal async Task<bool> DeleteAsync(long id)
|
||||||
{
|
{
|
||||||
using (var transaction = await ct.Database.BeginTransactionAsync())
|
using (var transaction = await ct.Database.BeginTransactionAsync())
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
var dbObject = await GetAsync(id, false);
|
var dbObject = await GetAsync(id, false);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
@@ -173,12 +171,6 @@ namespace AyaNova.Biz
|
|||||||
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,8 +151,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> DeleteAsync(long id)
|
internal async Task<bool> DeleteAsync(long id)
|
||||||
{
|
{
|
||||||
using (var transaction = await ct.Database.BeginTransactionAsync())
|
using (var transaction = await ct.Database.BeginTransactionAsync())
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
var dbObject = await GetAsync(id, false);
|
var dbObject = await GetAsync(id, false);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
@@ -173,12 +171,7 @@ namespace AyaNova.Biz
|
|||||||
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -322,8 +322,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> DeleteAsync(long id)
|
internal async Task<bool> DeleteAsync(long id)
|
||||||
{
|
{
|
||||||
using (var transaction = await ct.Database.BeginTransactionAsync())
|
using (var transaction = await ct.Database.BeginTransactionAsync())
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
var dbObject = await GetAsync(id, false, false);
|
var dbObject = await GetAsync(id, false, false);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
@@ -348,12 +346,7 @@ namespace AyaNova.Biz
|
|||||||
await TagBiz.ProcessDeleteTagsInRepositoryAsync(ct, dbObject.Tags);
|
await TagBiz.ProcessDeleteTagsInRepositoryAsync(ct, dbObject.Tags);
|
||||||
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
||||||
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -341,8 +341,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> QuoteDeleteAsync(long id)
|
internal async Task<bool> QuoteDeleteAsync(long id)
|
||||||
{
|
{
|
||||||
using (var transaction = await ct.Database.BeginTransactionAsync())
|
using (var transaction = await ct.Database.BeginTransactionAsync())
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
Quote dbObject = await ct.Quote.AsNoTracking().Where(z => z.Id == id).FirstOrDefaultAsync();// QuoteGetAsync(id, false);
|
Quote dbObject = await ct.Quote.AsNoTracking().Where(z => z.Id == id).FirstOrDefaultAsync();// QuoteGetAsync(id, false);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
@@ -375,14 +373,7 @@ namespace AyaNova.Biz
|
|||||||
await FileUtil.DeleteAttachmentsForObjectAsync(dbObject.AyaType, dbObject.Id, ct);
|
await FileUtil.DeleteAttachmentsForObjectAsync(dbObject.AyaType, dbObject.Id, ct);
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await QuoteHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await QuoteHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
//NOTE: no need to rollback the transaction, it will auto-rollback if not committed and it is disposed when it goes out of scope either way
|
|
||||||
|
|
||||||
throw;
|
|
||||||
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1026,11 +1017,8 @@ namespace AyaNova.Biz
|
|||||||
//DELETE
|
//DELETE
|
||||||
// (note: this would only ever be called when a quote is deleted, there is no direct delete)
|
// (note: this would only ever be called when a quote is deleted, there is no direct delete)
|
||||||
internal async Task<bool> StateDeleteAsync(long workOrderId, IDbContextTransaction parentTransaction)
|
internal async Task<bool> StateDeleteAsync(long workOrderId, IDbContextTransaction parentTransaction)
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
var stateList = await ct.QuoteState.AsNoTracking().Where(z => z.QuoteId == workOrderId).ToListAsync();
|
var stateList = await ct.QuoteState.AsNoTracking().Where(z => z.QuoteId == workOrderId).ToListAsync();
|
||||||
|
|
||||||
foreach (var wostate in stateList)
|
foreach (var wostate in stateList)
|
||||||
{
|
{
|
||||||
ct.QuoteState.Remove(wostate);
|
ct.QuoteState.Remove(wostate);
|
||||||
@@ -1040,12 +1028,6 @@ namespace AyaNova.Biz
|
|||||||
//nothing to call or do here related to notification
|
//nothing to call or do here related to notification
|
||||||
// await StateHandlePotentialNotificationEvent(AyaEvent.Deleted, wostate);
|
// await StateHandlePotentialNotificationEvent(AyaEvent.Deleted, wostate);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1409,8 +1391,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> ItemDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
internal async Task<bool> ItemDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
||||||
{
|
{
|
||||||
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
||||||
try
|
|
||||||
{
|
|
||||||
var dbObject = await ct.QuoteItem.AsNoTracking().SingleOrDefaultAsync(z => z.Id == id);
|
var dbObject = await ct.QuoteItem.AsNoTracking().SingleOrDefaultAsync(z => z.Id == id);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
{
|
{
|
||||||
@@ -1475,12 +1455,7 @@ namespace AyaNova.Biz
|
|||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await ItemHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await ItemHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1742,8 +1717,7 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> ExpenseDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
internal async Task<bool> ExpenseDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
||||||
{
|
{
|
||||||
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
||||||
try
|
|
||||||
{
|
|
||||||
var dbObject = await ExpenseGetAsync(id, false);
|
var dbObject = await ExpenseGetAsync(id, false);
|
||||||
ExpenseValidateCanDelete(dbObject);
|
ExpenseValidateCanDelete(dbObject);
|
||||||
if (HasErrors)
|
if (HasErrors)
|
||||||
@@ -1759,12 +1733,7 @@ namespace AyaNova.Biz
|
|||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await ExpenseHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await ExpenseHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2112,8 +2081,7 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> LaborDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
internal async Task<bool> LaborDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
||||||
{
|
{
|
||||||
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
||||||
try
|
|
||||||
{
|
|
||||||
var dbObject = await LaborGetAsync(id, false);
|
var dbObject = await LaborGetAsync(id, false);
|
||||||
LaborValidateCanDelete(dbObject);
|
LaborValidateCanDelete(dbObject);
|
||||||
if (HasErrors)
|
if (HasErrors)
|
||||||
@@ -2129,12 +2097,7 @@ namespace AyaNova.Biz
|
|||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await LaborHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await LaborHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2508,8 +2471,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> LoanDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
internal async Task<bool> LoanDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
||||||
{
|
{
|
||||||
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
||||||
try
|
|
||||||
{
|
|
||||||
var dbObject = await LoanGetAsync(id, false);
|
var dbObject = await LoanGetAsync(id, false);
|
||||||
LoanValidateCanDelete(dbObject);
|
LoanValidateCanDelete(dbObject);
|
||||||
if (HasErrors)
|
if (HasErrors)
|
||||||
@@ -2525,12 +2486,7 @@ namespace AyaNova.Biz
|
|||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await LoanHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await LoanHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2914,8 +2870,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> OutsideServiceDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
internal async Task<bool> OutsideServiceDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
||||||
{
|
{
|
||||||
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
||||||
try
|
|
||||||
{
|
|
||||||
var dbObject = await OutsideServiceGetAsync(id, false);
|
var dbObject = await OutsideServiceGetAsync(id, false);
|
||||||
OutsideServiceValidateCanDelete(dbObject);
|
OutsideServiceValidateCanDelete(dbObject);
|
||||||
if (HasErrors)
|
if (HasErrors)
|
||||||
@@ -2930,12 +2884,6 @@ namespace AyaNova.Biz
|
|||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await OutsideServiceHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await OutsideServiceHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3254,9 +3202,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> PartDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
internal async Task<bool> PartDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
||||||
{
|
{
|
||||||
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var dbObject = await PartGetAsync(id, false);
|
var dbObject = await PartGetAsync(id, false);
|
||||||
PartValidateCanDelete(dbObject);
|
PartValidateCanDelete(dbObject);
|
||||||
if (HasErrors)
|
if (HasErrors)
|
||||||
@@ -3275,12 +3220,6 @@ namespace AyaNova.Biz
|
|||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await PartHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await PartHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3690,8 +3629,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> ScheduledUserDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
internal async Task<bool> ScheduledUserDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
||||||
{
|
{
|
||||||
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
||||||
try
|
|
||||||
{
|
|
||||||
var dbObject = await ScheduledUserGetAsync(id, false);
|
var dbObject = await ScheduledUserGetAsync(id, false);
|
||||||
ScheduledUserValidateCanDelete(dbObject);
|
ScheduledUserValidateCanDelete(dbObject);
|
||||||
if (HasErrors)
|
if (HasErrors)
|
||||||
@@ -3705,12 +3642,6 @@ namespace AyaNova.Biz
|
|||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await ScheduledUserHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await ScheduledUserHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3943,8 +3874,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> TaskDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
internal async Task<bool> TaskDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
||||||
{
|
{
|
||||||
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
||||||
try
|
|
||||||
{
|
|
||||||
var dbObject = await TaskGetAsync(id, false);
|
var dbObject = await TaskGetAsync(id, false);
|
||||||
TaskValidateCanDelete(dbObject);
|
TaskValidateCanDelete(dbObject);
|
||||||
if (HasErrors)
|
if (HasErrors)
|
||||||
@@ -3958,12 +3887,6 @@ namespace AyaNova.Biz
|
|||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await TaskHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await TaskHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4227,8 +4150,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> TravelDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
internal async Task<bool> TravelDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
||||||
{
|
{
|
||||||
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
||||||
try
|
|
||||||
{
|
|
||||||
var dbObject = await TravelGetAsync(id, false);
|
var dbObject = await TravelGetAsync(id, false);
|
||||||
TravelValidateCanDelete(dbObject);
|
TravelValidateCanDelete(dbObject);
|
||||||
if (HasErrors)
|
if (HasErrors)
|
||||||
@@ -4243,12 +4164,6 @@ namespace AyaNova.Biz
|
|||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await TravelHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await TravelHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4614,8 +4529,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> UnitDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
internal async Task<bool> UnitDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
||||||
{
|
{
|
||||||
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
||||||
try
|
|
||||||
{
|
|
||||||
var dbObject = await UnitGetAsync(id, false);
|
var dbObject = await UnitGetAsync(id, false);
|
||||||
UnitValidateCanDelete(dbObject);
|
UnitValidateCanDelete(dbObject);
|
||||||
if (HasErrors)
|
if (HasErrors)
|
||||||
@@ -4629,12 +4542,6 @@ namespace AyaNova.Biz
|
|||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await UnitHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await UnitHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -106,8 +106,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> DeleteAsync(long id)
|
internal async Task<bool> DeleteAsync(long id)
|
||||||
{
|
{
|
||||||
using (var transaction = await ct.Database.BeginTransactionAsync())
|
using (var transaction = await ct.Database.BeginTransactionAsync())
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
var dbObject = await GetAsync(id, false);
|
var dbObject = await GetAsync(id, false);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
@@ -126,12 +124,6 @@ namespace AyaNova.Biz
|
|||||||
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, BizType, ct);
|
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, BizType, ct);
|
||||||
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,8 +151,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> DeleteAsync(long id)
|
internal async Task<bool> DeleteAsync(long id)
|
||||||
{
|
{
|
||||||
using (var transaction = await ct.Database.BeginTransactionAsync())
|
using (var transaction = await ct.Database.BeginTransactionAsync())
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
Reminder dbObject = await ct.Reminder.SingleOrDefaultAsync(m => m.Id == id);
|
Reminder dbObject = await ct.Reminder.SingleOrDefaultAsync(m => m.Id == id);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
@@ -175,12 +173,7 @@ namespace AyaNova.Biz
|
|||||||
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -207,8 +207,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> DeleteAsync(long id)
|
internal async Task<bool> DeleteAsync(long id)
|
||||||
{
|
{
|
||||||
using (var transaction = await ct.Database.BeginTransactionAsync())
|
using (var transaction = await ct.Database.BeginTransactionAsync())
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
var dbObject = await GetAsync(id, false);
|
var dbObject = await GetAsync(id, false);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
@@ -225,12 +223,6 @@ namespace AyaNova.Biz
|
|||||||
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, BizType, ct);
|
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, BizType, ct);
|
||||||
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -714,11 +706,7 @@ namespace AyaNova.Biz
|
|||||||
log.LogInformation(PageLog.ToString());
|
log.LogInformation(PageLog.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// var v=await page.GetContentAsync();//for debugging purposes
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// var v=await page.GetContentAsync();
|
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
|||||||
@@ -151,8 +151,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> DeleteAsync(long id)
|
internal async Task<bool> DeleteAsync(long id)
|
||||||
{
|
{
|
||||||
using (var transaction = await ct.Database.BeginTransactionAsync())
|
using (var transaction = await ct.Database.BeginTransactionAsync())
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
var dbObject = await GetAsync(id, false);
|
var dbObject = await GetAsync(id, false);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
@@ -175,12 +173,6 @@ namespace AyaNova.Biz
|
|||||||
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,8 +151,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> DeleteAsync(long id)
|
internal async Task<bool> DeleteAsync(long id)
|
||||||
{
|
{
|
||||||
using (var transaction = await ct.Database.BeginTransactionAsync())
|
using (var transaction = await ct.Database.BeginTransactionAsync())
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
var dbObject = await GetAsync(id, false);
|
var dbObject = await GetAsync(id, false);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
@@ -175,12 +173,6 @@ namespace AyaNova.Biz
|
|||||||
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -158,8 +158,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> DeleteAsync(long id)
|
internal async Task<bool> DeleteAsync(long id)
|
||||||
{
|
{
|
||||||
using (var transaction = await ct.Database.BeginTransactionAsync())
|
using (var transaction = await ct.Database.BeginTransactionAsync())
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
TaskGroup dbObject = await GetAsync(id, false);
|
TaskGroup dbObject = await GetAsync(id, false);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
@@ -181,13 +179,6 @@ namespace AyaNova.Biz
|
|||||||
|
|
||||||
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,8 +151,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> DeleteAsync(long id)
|
internal async Task<bool> DeleteAsync(long id)
|
||||||
{
|
{
|
||||||
using (var transaction = await ct.Database.BeginTransactionAsync())
|
using (var transaction = await ct.Database.BeginTransactionAsync())
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
var dbObject = await GetAsync(id, false);
|
var dbObject = await GetAsync(id, false);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
@@ -175,12 +173,6 @@ namespace AyaNova.Biz
|
|||||||
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,8 +151,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> DeleteAsync(long id)
|
internal async Task<bool> DeleteAsync(long id)
|
||||||
{
|
{
|
||||||
using (var transaction = await ct.Database.BeginTransactionAsync())
|
using (var transaction = await ct.Database.BeginTransactionAsync())
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
var dbObject = await GetAsync(id, false);
|
var dbObject = await GetAsync(id, false);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
@@ -175,12 +173,6 @@ namespace AyaNova.Biz
|
|||||||
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,8 +151,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> DeleteAsync(long id)
|
internal async Task<bool> DeleteAsync(long id)
|
||||||
{
|
{
|
||||||
using (var transaction = await ct.Database.BeginTransactionAsync())
|
using (var transaction = await ct.Database.BeginTransactionAsync())
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
Unit dbObject = await GetAsync(id, false);
|
Unit dbObject = await GetAsync(id, false);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
@@ -173,12 +171,6 @@ namespace AyaNova.Biz
|
|||||||
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -152,8 +152,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> DeleteAsync(long id)
|
internal async Task<bool> DeleteAsync(long id)
|
||||||
{
|
{
|
||||||
using (var transaction = await ct.Database.BeginTransactionAsync())
|
using (var transaction = await ct.Database.BeginTransactionAsync())
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
var dbObject = await GetAsync(id, false);
|
var dbObject = await GetAsync(id, false);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
@@ -174,12 +172,6 @@ namespace AyaNova.Biz
|
|||||||
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -676,8 +676,6 @@ namespace AyaNova.Biz
|
|||||||
Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction transaction = null;
|
Microsoft.EntityFrameworkCore.Storage.IDbContextTransaction transaction = null;
|
||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
transaction = await ct.Database.BeginTransactionAsync();
|
transaction = await ct.Database.BeginTransactionAsync();
|
||||||
try
|
|
||||||
{
|
|
||||||
User dbObject = await ct.User.SingleOrDefaultAsync(z => z.Id == id);
|
User dbObject = await ct.User.SingleOrDefaultAsync(z => z.Id == id);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
{
|
{
|
||||||
@@ -726,14 +724,6 @@ namespace AyaNova.Biz
|
|||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
//no need to rollback, the transaction will rollback automatically if it's disposed without committing
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
//Note: Transaction does not need to be disposed it will automatically when it goes out of scope due to Using statement
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,8 +151,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> DeleteAsync(long id)
|
internal async Task<bool> DeleteAsync(long id)
|
||||||
{
|
{
|
||||||
using (var transaction = await ct.Database.BeginTransactionAsync())
|
using (var transaction = await ct.Database.BeginTransactionAsync())
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
Vendor dbObject = await GetAsync(id, false);
|
Vendor dbObject = await GetAsync(id, false);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
@@ -171,12 +169,6 @@ namespace AyaNova.Biz
|
|||||||
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -194,8 +194,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> DeleteAsync(long id)
|
internal async Task<bool> DeleteAsync(long id)
|
||||||
{
|
{
|
||||||
using (var transaction = await ct.Database.BeginTransactionAsync())
|
using (var transaction = await ct.Database.BeginTransactionAsync())
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
var dbObject = await GetAsync(id, false);
|
var dbObject = await GetAsync(id, false);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
@@ -219,12 +217,6 @@ namespace AyaNova.Biz
|
|||||||
//all good do the commit
|
//all good do the commit
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await HandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -360,8 +360,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> WorkOrderDeleteAsync(long id)
|
internal async Task<bool> WorkOrderDeleteAsync(long id)
|
||||||
{
|
{
|
||||||
using (var transaction = await ct.Database.BeginTransactionAsync())
|
using (var transaction = await ct.Database.BeginTransactionAsync())
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
WorkOrder dbObject = await ct.WorkOrder.AsNoTracking().Where(z => z.Id == id).FirstOrDefaultAsync();// WorkOrderGetAsync(id, false);
|
WorkOrder dbObject = await ct.WorkOrder.AsNoTracking().Where(z => z.Id == id).FirstOrDefaultAsync();// WorkOrderGetAsync(id, false);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
@@ -394,14 +392,6 @@ namespace AyaNova.Biz
|
|||||||
await FileUtil.DeleteAttachmentsForObjectAsync(dbObject.AyaType, dbObject.Id, ct);
|
await FileUtil.DeleteAttachmentsForObjectAsync(dbObject.AyaType, dbObject.Id, ct);
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await WorkOrderHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await WorkOrderHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
//NOTE: no need to rollback the transaction, it will auto-rollback if not committed and it is disposed when it goes out of scope either way
|
|
||||||
|
|
||||||
throw;
|
|
||||||
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1404,8 +1394,6 @@ namespace AyaNova.Biz
|
|||||||
//DELETE
|
//DELETE
|
||||||
// (note: this would only ever be called when a workorder is deleted, there is no direct delete)
|
// (note: this would only ever be called when a workorder is deleted, there is no direct delete)
|
||||||
internal async Task<bool> StateDeleteAsync(long workOrderId, IDbContextTransaction parentTransaction)
|
internal async Task<bool> StateDeleteAsync(long workOrderId, IDbContextTransaction parentTransaction)
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
var stateList = await ct.WorkOrderState.AsNoTracking().Where(z => z.WorkOrderId == workOrderId).ToListAsync();
|
var stateList = await ct.WorkOrderState.AsNoTracking().Where(z => z.WorkOrderId == workOrderId).ToListAsync();
|
||||||
|
|
||||||
@@ -1418,12 +1406,6 @@ namespace AyaNova.Biz
|
|||||||
//nothing to call or do here related to notification
|
//nothing to call or do here related to notification
|
||||||
// await StateHandlePotentialNotificationEvent(AyaEvent.Deleted, wostate);
|
// await StateHandlePotentialNotificationEvent(AyaEvent.Deleted, wostate);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1827,8 +1809,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> ItemDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
internal async Task<bool> ItemDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
||||||
{
|
{
|
||||||
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
||||||
try
|
|
||||||
{
|
|
||||||
var dbObject = await ct.WorkOrderItem.AsNoTracking().SingleOrDefaultAsync(z => z.Id == id);
|
var dbObject = await ct.WorkOrderItem.AsNoTracking().SingleOrDefaultAsync(z => z.Id == id);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
{
|
{
|
||||||
@@ -1896,12 +1876,6 @@ namespace AyaNova.Biz
|
|||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await ItemHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await ItemHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2162,8 +2136,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> ExpenseDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
internal async Task<bool> ExpenseDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
||||||
{
|
{
|
||||||
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
||||||
try
|
|
||||||
{
|
|
||||||
var dbObject = await ExpenseGetAsync(id, false);
|
var dbObject = await ExpenseGetAsync(id, false);
|
||||||
ExpenseValidateCanDelete(dbObject);
|
ExpenseValidateCanDelete(dbObject);
|
||||||
if (HasErrors)
|
if (HasErrors)
|
||||||
@@ -2176,12 +2148,6 @@ namespace AyaNova.Biz
|
|||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await ExpenseHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await ExpenseHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2518,8 +2484,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> LaborDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
internal async Task<bool> LaborDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
||||||
{
|
{
|
||||||
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
||||||
try
|
|
||||||
{
|
|
||||||
var dbObject = await LaborGetAsync(id, false);
|
var dbObject = await LaborGetAsync(id, false);
|
||||||
LaborValidateCanDelete(dbObject);
|
LaborValidateCanDelete(dbObject);
|
||||||
if (HasErrors)
|
if (HasErrors)
|
||||||
@@ -2533,12 +2497,6 @@ namespace AyaNova.Biz
|
|||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await LaborHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await LaborHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2899,8 +2857,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> LoanDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
internal async Task<bool> LoanDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
||||||
{
|
{
|
||||||
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
||||||
try
|
|
||||||
{
|
|
||||||
var dbObject = await LoanGetAsync(id, false);
|
var dbObject = await LoanGetAsync(id, false);
|
||||||
LoanValidateCanDelete(dbObject);
|
LoanValidateCanDelete(dbObject);
|
||||||
if (HasErrors)
|
if (HasErrors)
|
||||||
@@ -2914,11 +2870,6 @@ namespace AyaNova.Biz
|
|||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await LoanHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await LoanHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3295,8 +3246,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> OutsideServiceDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
internal async Task<bool> OutsideServiceDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
||||||
{
|
{
|
||||||
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
||||||
try
|
|
||||||
{
|
|
||||||
var dbObject = await OutsideServiceGetAsync(id, false);
|
var dbObject = await OutsideServiceGetAsync(id, false);
|
||||||
OutsideServiceValidateCanDelete(dbObject);
|
OutsideServiceValidateCanDelete(dbObject);
|
||||||
if (HasErrors)
|
if (HasErrors)
|
||||||
@@ -3310,11 +3259,6 @@ namespace AyaNova.Biz
|
|||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await OutsideServiceHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await OutsideServiceHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3781,9 +3725,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> PartDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
internal async Task<bool> PartDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
||||||
{
|
{
|
||||||
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var dbObject = await PartGetAsync(id, false);
|
var dbObject = await PartGetAsync(id, false);
|
||||||
PartValidateCanDelete(dbObject);
|
PartValidateCanDelete(dbObject);
|
||||||
if (HasErrors)
|
if (HasErrors)
|
||||||
@@ -3804,11 +3745,6 @@ namespace AyaNova.Biz
|
|||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await PartHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await PartHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4352,8 +4288,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> PartRequestDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
internal async Task<bool> PartRequestDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
||||||
{
|
{
|
||||||
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
||||||
try
|
|
||||||
{
|
|
||||||
var dbObject = await PartRequestGetAsync(id, false);
|
var dbObject = await PartRequestGetAsync(id, false);
|
||||||
PartRequestValidateCanDelete(dbObject);
|
PartRequestValidateCanDelete(dbObject);
|
||||||
if (HasErrors)
|
if (HasErrors)
|
||||||
@@ -4366,11 +4300,6 @@ namespace AyaNova.Biz
|
|||||||
if (parentTransaction == null)
|
if (parentTransaction == null)
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
await PartRequestHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
await PartRequestHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -136,8 +136,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> DeleteAsync(long id)
|
internal async Task<bool> DeleteAsync(long id)
|
||||||
{
|
{
|
||||||
using (var transaction = await ct.Database.BeginTransactionAsync())
|
using (var transaction = await ct.Database.BeginTransactionAsync())
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
var dbObject = await GetAsync(id, false);
|
var dbObject = await GetAsync(id, false);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
@@ -156,12 +154,6 @@ namespace AyaNova.Biz
|
|||||||
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, BizType, ct);
|
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, BizType, ct);
|
||||||
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,8 +136,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> DeleteAsync(long id)
|
internal async Task<bool> DeleteAsync(long id)
|
||||||
{
|
{
|
||||||
using (var transaction = await ct.Database.BeginTransactionAsync())
|
using (var transaction = await ct.Database.BeginTransactionAsync())
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
var dbObject = await GetAsync(id, false);
|
var dbObject = await GetAsync(id, false);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
@@ -156,12 +154,6 @@ namespace AyaNova.Biz
|
|||||||
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, BizType, ct);
|
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, BizType, ct);
|
||||||
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,8 +136,6 @@ namespace AyaNova.Biz
|
|||||||
internal async Task<bool> DeleteAsync(long id)
|
internal async Task<bool> DeleteAsync(long id)
|
||||||
{
|
{
|
||||||
using (var transaction = await ct.Database.BeginTransactionAsync())
|
using (var transaction = await ct.Database.BeginTransactionAsync())
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
var dbObject = await GetAsync(id, false);
|
var dbObject = await GetAsync(id, false);
|
||||||
if (dbObject == null)
|
if (dbObject == null)
|
||||||
@@ -156,12 +154,6 @@ namespace AyaNova.Biz
|
|||||||
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, BizType, ct);
|
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, BizType, ct);
|
||||||
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
await FileUtil.DeleteAttachmentsForObjectAsync(BizType, dbObject.Id, ct);
|
||||||
await transaction.CommitAsync();
|
await transaction.CommitAsync();
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -565,8 +565,6 @@ namespace AyaNova.Util
|
|||||||
//Seed known / expected test data for tests/development
|
//Seed known / expected test data for tests/development
|
||||||
//
|
//
|
||||||
public async Task SeedKnownObjectsAsync(ILogger log)
|
public async Task SeedKnownObjectsAsync(ILogger log)
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
var KnownUserTags = new List<string>();
|
var KnownUserTags = new List<string>();
|
||||||
KnownUserTags.Add("known-user");
|
KnownUserTags.Add("known-user");
|
||||||
@@ -1653,16 +1651,6 @@ namespace AyaNova.Util
|
|||||||
await biz.PutAsync(gbiz);
|
await biz.PutAsync(gbiz);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////
|
|
||||||
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ namespace AyaNova.Util
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
// TODO: consider whether derived types are also acceptable.
|
|
||||||
if (!acceptableExceptions.Contains(ex.GetType()))
|
if (!acceptableExceptions.Contains(ex.GetType()))
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user