This commit is contained in:
@@ -322,7 +322,7 @@ namespace AyaNova.Biz
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.Id, BizType, AyaEvent.Modified), ct);
|
||||
await PMSearchIndexAsync(putObject, false);
|
||||
await TagBiz.ProcessUpdateTagsInRepositoryAsync(ct, putObject.Tags, dbObject.Tags);
|
||||
await PMPopulateVizFields(putObject, true, false);//doing this here ahead of notification because notification may require the viz field lookup anyway and afaict no harm in it
|
||||
await PMPopulateVizFields(putObject, true, false);
|
||||
await PMHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||
return putObject;
|
||||
}
|
||||
@@ -576,15 +576,8 @@ namespace AyaNova.Biz
|
||||
.SingleOrDefaultAsync();
|
||||
w.ChildItemId = itemid;
|
||||
return w;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//SEARCH
|
||||
//
|
||||
@@ -612,7 +605,6 @@ namespace AyaNova.Biz
|
||||
searchParams.AddText(obj.Notes).AddText(obj.Serial).AddText(obj.Wiki).AddText(obj.Tags).AddCustomFields(obj.CustomFields);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//VALIDATION
|
||||
//
|
||||
@@ -635,7 +627,6 @@ namespace AyaNova.Biz
|
||||
return;//this is a completely disqualifying error
|
||||
}
|
||||
|
||||
|
||||
//Did they exclude *all* days of the week (int value 127)
|
||||
if ((int)proposedObj.ExcludeDaysOfWeek == 127)
|
||||
{
|
||||
@@ -672,8 +663,6 @@ namespace AyaNova.Biz
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private async Task PMValidateCanDelete(PM dbObject)
|
||||
{
|
||||
//Check restricted role preventing create
|
||||
@@ -688,9 +677,6 @@ namespace AyaNova.Biz
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// GET PARTIAL WORKORDER FOR REPORTING
|
||||
// (returns quote consisting only of the path from child or grandchild up to header populated
|
||||
@@ -706,19 +692,13 @@ namespace AyaNova.Biz
|
||||
|
||||
//get header only
|
||||
var ret = await ct.PM.AsNoTracking().SingleOrDefaultAsync(x => x.Id == wid.ParentId);
|
||||
|
||||
//not found don't bomb, just return null
|
||||
if (ret == null) return ret;
|
||||
|
||||
//explicit load subitems as required...
|
||||
|
||||
|
||||
PMItem quoteitem = null;
|
||||
|
||||
//it's requesting a fully populated woitem so do that here
|
||||
if (includeWoItemDescendants)
|
||||
{
|
||||
|
||||
quoteitem = await ct.PMItem.AsSplitQuery()
|
||||
.AsNoTracking()
|
||||
.Include(wi => wi.Expenses)
|
||||
@@ -1119,8 +1099,8 @@ namespace AyaNova.Biz
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, AyaType.PMItem, AyaEvent.Created), ct);
|
||||
await ItemSearchIndexAsync(newObject, true);
|
||||
await TagBiz.ProcessUpdateTagsInRepositoryAsync(ct, newObject.Tags, null);
|
||||
await ItemHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
||||
await ItemPopulateVizFields(newObject, false);
|
||||
await ItemHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
||||
return newObject;
|
||||
}
|
||||
}
|
||||
@@ -1190,9 +1170,6 @@ namespace AyaNova.Biz
|
||||
await ItemValidateAsync(putObject, dbObject);
|
||||
if (HasErrors) return null;
|
||||
ct.Replace(dbObject, putObject);
|
||||
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
await ct.SaveChangesAsync();
|
||||
@@ -1208,8 +1185,8 @@ namespace AyaNova.Biz
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, putObject.Id, AyaType.PMItem, AyaEvent.Modified), ct);
|
||||
await ItemSearchIndexAsync(putObject, false);
|
||||
await TagBiz.ProcessUpdateTagsInRepositoryAsync(ct, putObject.Tags, dbObject.Tags);
|
||||
await ItemHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||
await ItemPopulateVizFields(putObject, false);
|
||||
await ItemHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||
return putObject;
|
||||
}
|
||||
|
||||
@@ -1474,9 +1451,8 @@ namespace AyaNova.Biz
|
||||
await ct.SaveChangesAsync();
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, newObject.AyaType, AyaEvent.Created), ct);
|
||||
await ExpenseSearchIndexAsync(newObject, true);
|
||||
|
||||
await ExpenseHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
||||
await ExpensePopulateVizFields(newObject);
|
||||
await ExpenseHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
||||
return newObject;
|
||||
}
|
||||
}
|
||||
@@ -1533,8 +1509,8 @@ namespace AyaNova.Biz
|
||||
}
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, putObject.Id, putObject.AyaType, AyaEvent.Modified), ct);
|
||||
await ExpenseSearchIndexAsync(putObject, false);
|
||||
await ExpenseHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||
await ExpensePopulateVizFields(putObject);
|
||||
await ExpenseHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||
return putObject;
|
||||
}
|
||||
|
||||
@@ -1557,7 +1533,6 @@ namespace AyaNova.Biz
|
||||
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "pmitem:" + dbObject.PMItemId.ToString(), ct);//Fix??
|
||||
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, dbObject.AyaType, ct);
|
||||
|
||||
|
||||
if (parentTransaction == null)
|
||||
await transaction.CommitAsync();
|
||||
await ExpenseHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||
@@ -1669,7 +1644,6 @@ namespace AyaNova.Biz
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (proposedObj.PMItemId == 0)
|
||||
{
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, "PMItemId");
|
||||
@@ -1771,7 +1745,6 @@ namespace AyaNova.Biz
|
||||
}
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// NOTIFICATION PROCESSING
|
||||
//
|
||||
@@ -1829,8 +1802,8 @@ namespace AyaNova.Biz
|
||||
await ct.SaveChangesAsync();
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, newObject.AyaType, AyaEvent.Created), ct);
|
||||
await LaborSearchIndexAsync(newObject, true);
|
||||
await LaborHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
||||
await LaborPopulateVizFields(newObject);
|
||||
await LaborHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
||||
return newObject;
|
||||
}
|
||||
}
|
||||
@@ -1869,7 +1842,6 @@ namespace AyaNova.Biz
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
await LaborValidateAsync(putObject, dbObject);
|
||||
if (HasErrors) return null;
|
||||
ct.Replace(dbObject, putObject);
|
||||
@@ -1887,9 +1859,8 @@ namespace AyaNova.Biz
|
||||
}
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.Id, putObject.AyaType, AyaEvent.Modified), ct);
|
||||
await LaborSearchIndexAsync(putObject, false);
|
||||
|
||||
await LaborHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||
await LaborPopulateVizFields(putObject);
|
||||
await LaborHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||
return putObject;
|
||||
}
|
||||
|
||||
@@ -1912,7 +1883,6 @@ namespace AyaNova.Biz
|
||||
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "pmitem:" + dbObject.PMItemId.ToString(), ct);//Fix??
|
||||
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, dbObject.AyaType, ct);
|
||||
|
||||
|
||||
if (parentTransaction == null)
|
||||
await transaction.CommitAsync();
|
||||
await LaborHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||
@@ -2057,13 +2027,11 @@ namespace AyaNova.Biz
|
||||
}
|
||||
o.LineTotalViz = o.NetViz + o.TaxAViz + o.TaxBViz;
|
||||
|
||||
|
||||
//RESTRICTIONS ON COST VISIBILITY?
|
||||
if (!UserCanViewLaborOrTravelRateCosts)
|
||||
{
|
||||
o.CostViz = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -2125,11 +2093,9 @@ namespace AyaNova.Biz
|
||||
RequiredFieldsValidator.Validate(this, FormCustomization, proposedObj);//note: this is passed only to add errors
|
||||
|
||||
//validate custom fields
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void LaborValidateCanDelete(PMItemLabor obj)
|
||||
{
|
||||
if (obj == null)
|
||||
@@ -2219,9 +2185,8 @@ namespace AyaNova.Biz
|
||||
await ct.SaveChangesAsync();
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, newObject.AyaType, AyaEvent.Created), ct);
|
||||
await LoanSearchIndexAsync(newObject, true);
|
||||
|
||||
await LoanHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
||||
await LoanPopulateVizFields(newObject);
|
||||
await LoanHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
||||
return newObject;
|
||||
}
|
||||
}
|
||||
@@ -2275,9 +2240,8 @@ namespace AyaNova.Biz
|
||||
}
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.Id, putObject.AyaType, AyaEvent.Modified), ct);
|
||||
await LoanSearchIndexAsync(putObject, false);
|
||||
|
||||
await LoanHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||
await LoanPopulateVizFields(putObject);
|
||||
await LoanHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||
return putObject;
|
||||
}
|
||||
|
||||
@@ -2620,9 +2584,8 @@ namespace AyaNova.Biz
|
||||
await ct.SaveChangesAsync();
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, newObject.AyaType, AyaEvent.Created), ct);
|
||||
await OutsideServiceSearchIndexAsync(newObject, true);
|
||||
|
||||
await OutsideServiceHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
||||
await OutsideServicePopulateVizFields(newObject);
|
||||
await OutsideServiceHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
||||
return newObject;
|
||||
}
|
||||
}
|
||||
@@ -2657,10 +2620,6 @@ namespace AyaNova.Biz
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
await OutsideServiceValidateAsync(putObject, dbObject);
|
||||
if (HasErrors) return null;
|
||||
ct.Replace(dbObject, putObject);
|
||||
@@ -2678,10 +2637,8 @@ namespace AyaNova.Biz
|
||||
}
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, putObject.Id, putObject.AyaType, AyaEvent.Modified), ct);
|
||||
await OutsideServiceSearchIndexAsync(putObject, false);
|
||||
|
||||
|
||||
await OutsideServiceHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||
await OutsideServicePopulateVizFields(putObject);
|
||||
await OutsideServiceHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||
return putObject;
|
||||
}
|
||||
|
||||
@@ -2704,7 +2661,6 @@ namespace AyaNova.Biz
|
||||
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "pmitem:" + dbObject.PMItemId.ToString(), ct);//Fix??
|
||||
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, dbObject.AyaType, ct);
|
||||
|
||||
|
||||
if (parentTransaction == null)
|
||||
await transaction.CommitAsync();
|
||||
await OutsideServiceHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||
@@ -2950,8 +2906,8 @@ namespace AyaNova.Biz
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, newObject.AyaType, AyaEvent.Created), ct);
|
||||
await PartSearchIndexAsync(newObject, true);
|
||||
await transaction.CommitAsync();
|
||||
|
||||
await PartPopulateVizFields(newObject);
|
||||
await PartHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
||||
return newObject;
|
||||
}
|
||||
}
|
||||
@@ -2989,10 +2945,6 @@ namespace AyaNova.Biz
|
||||
AddError(ApiErrorCode.CONCURRENCY_CONFLICT);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
await PartValidateAsync(putObject, dbObject);
|
||||
if (HasErrors) return null;
|
||||
await PartBizActionsAsync(AyaEvent.Modified, putObject, dbObject, null);
|
||||
@@ -3016,10 +2968,9 @@ namespace AyaNova.Biz
|
||||
}
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, putObject.Id, putObject.AyaType, AyaEvent.Modified), ct);
|
||||
await PartSearchIndexAsync(putObject, false);
|
||||
|
||||
await PartHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||
await transaction.CommitAsync();
|
||||
await PartPopulateVizFields(putObject);
|
||||
await PartHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||
return putObject;
|
||||
}
|
||||
}
|
||||
@@ -3030,7 +2981,6 @@ namespace AyaNova.Biz
|
||||
internal async Task<bool> PartDeleteAsync(long id, IDbContextTransaction parentTransaction = null)
|
||||
{
|
||||
var transaction = parentTransaction ?? await ct.Database.BeginTransactionAsync();
|
||||
|
||||
try
|
||||
{
|
||||
var dbObject = await PartGetAsync(id, false);
|
||||
@@ -3048,8 +2998,6 @@ namespace AyaNova.Biz
|
||||
//Log event
|
||||
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "pmitem:" + dbObject.PMItemId.ToString(), ct);//Fix??
|
||||
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, dbObject.AyaType, ct);
|
||||
|
||||
|
||||
if (parentTransaction == null)
|
||||
await transaction.CommitAsync();
|
||||
await PartHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||
@@ -3280,7 +3228,6 @@ namespace AyaNova.Biz
|
||||
return;//this is a completely disqualifying error
|
||||
}
|
||||
|
||||
|
||||
if (!await BizObjectExistsInDatabase.ExistsAsync(AyaType.Part, proposedObj.PartId, ct))
|
||||
{
|
||||
AddError(ApiErrorCode.NOT_FOUND, "PartId");
|
||||
@@ -3304,7 +3251,6 @@ namespace AyaNova.Biz
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void PartValidateCanDelete(PMItemPart obj)
|
||||
{
|
||||
if (UserIsRestrictedType)
|
||||
@@ -3388,15 +3334,11 @@ namespace AyaNova.Biz
|
||||
return null;
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
await ct.PMItemScheduledUser.AddAsync(newObject);
|
||||
await ct.SaveChangesAsync();
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, newObject.AyaType, AyaEvent.Created), ct);
|
||||
|
||||
|
||||
await ScheduledUserHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
||||
await ScheduledUserPopulateVizFields(newObject);
|
||||
await ScheduledUserHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
||||
return newObject;
|
||||
}
|
||||
}
|
||||
@@ -3430,9 +3372,6 @@ namespace AyaNova.Biz
|
||||
AddError(ApiErrorCode.CONCURRENCY_CONFLICT);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
await ScheduledUserValidateAsync(putObject, dbObject);
|
||||
if (HasErrors) return null;
|
||||
ct.Replace(dbObject, putObject);
|
||||
@@ -3449,10 +3388,8 @@ namespace AyaNova.Biz
|
||||
return null;
|
||||
}
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.Id, putObject.AyaType, AyaEvent.Modified), ct);
|
||||
|
||||
|
||||
await ScheduledUserHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||
await ScheduledUserPopulateVizFields(putObject);
|
||||
await ScheduledUserHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||
return putObject;
|
||||
}
|
||||
|
||||
@@ -3474,8 +3411,6 @@ namespace AyaNova.Biz
|
||||
//Log event
|
||||
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "pmitem:" + dbObject.PMItemId.ToString(), ct);//Fix??
|
||||
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, dbObject.AyaType, ct);
|
||||
|
||||
|
||||
if (parentTransaction == null)
|
||||
await transaction.CommitAsync();
|
||||
await ScheduledUserHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||
@@ -3545,29 +3480,6 @@ namespace AyaNova.Biz
|
||||
if (proposedObj.StartDate > proposedObj.StopDate)
|
||||
AddError(ApiErrorCode.VALIDATION_STARTDATE_AFTER_ENDDATE, "StartDate");
|
||||
|
||||
|
||||
//For now decision is to not check for sched conflicts on pm as it's not a work order yet anyway
|
||||
// //Scheduling conflict?
|
||||
// if (!AyaNova.Util.ServerGlobalBizSettings.Cache.AllowScheduleConflicts
|
||||
// && proposedObj.UserId != null
|
||||
// && proposedObj.StartDate != null
|
||||
// && proposedObj.StopDate != null
|
||||
// && (isNew
|
||||
// || (proposedObj.StartDate != currentObj.StartDate)
|
||||
// || (proposedObj.StopDate != currentObj.StopDate)
|
||||
// || (proposedObj.UserId != currentObj.UserId)
|
||||
// ))
|
||||
// {
|
||||
// if (await ct.PMItemScheduledUser.AnyAsync(x => x.Id != proposedObj.Id
|
||||
// && x.UserId == proposedObj.UserId
|
||||
// && x.StartDate <= proposedObj.StopDate
|
||||
// && proposedObj.StartDate <= x.StopDate))
|
||||
// {
|
||||
// AddError(ApiErrorCode.VALIDATION_FAILED, "StartDate", await Translate("ScheduleConflict"));
|
||||
// AddError(ApiErrorCode.VALIDATION_FAILED, "StopDate", await Translate("ScheduleConflict"));
|
||||
// }
|
||||
// }
|
||||
|
||||
//Any form customizations to validate?
|
||||
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(z => z.FormKey == AyaType.PMItemScheduledUser.ToString());
|
||||
if (FormCustomization != null)
|
||||
@@ -3578,11 +3490,9 @@ namespace AyaNova.Biz
|
||||
RequiredFieldsValidator.Validate(this, FormCustomization, proposedObj);//note: this is passed only to add errors
|
||||
|
||||
//validate custom fields
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void ScheduledUserValidateCanDelete(PMItemScheduledUser obj)
|
||||
{
|
||||
if (obj == null)
|
||||
@@ -3662,15 +3572,12 @@ namespace AyaNova.Biz
|
||||
return null;
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
await ct.PMItemTask.AddAsync(newObject);
|
||||
await ct.SaveChangesAsync();
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, newObject.AyaType, AyaEvent.Created), ct);
|
||||
await TaskSearchIndexAsync(newObject, true);
|
||||
|
||||
await TaskHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
||||
await TaskPopulateVizFields(newObject);
|
||||
await TaskHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
||||
return newObject;
|
||||
}
|
||||
}
|
||||
@@ -3703,7 +3610,6 @@ namespace AyaNova.Biz
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
await TaskValidateAsync(putObject, dbObject);
|
||||
if (HasErrors) return null;
|
||||
ct.Replace(dbObject, putObject);
|
||||
@@ -3721,9 +3627,8 @@ namespace AyaNova.Biz
|
||||
}
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.Id, putObject.AyaType, AyaEvent.Modified), ct);
|
||||
await TaskSearchIndexAsync(dbObject, false);
|
||||
|
||||
await TaskHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||
await TaskPopulateVizFields(putObject);
|
||||
await TaskHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||
return putObject;
|
||||
}
|
||||
|
||||
@@ -3746,7 +3651,6 @@ namespace AyaNova.Biz
|
||||
await EventLogProcessor.DeleteObjectLogAsync(UserId, dbObject.AyaType, dbObject.Id, "pmitem:" + dbObject.PMItemId.ToString(), ct);//Fix??
|
||||
await Search.ProcessDeletedObjectKeywordsAsync(dbObject.Id, dbObject.AyaType, ct);
|
||||
|
||||
|
||||
if (parentTransaction == null)
|
||||
await transaction.CommitAsync();
|
||||
await TaskHandlePotentialNotificationEvent(AyaEvent.Deleted, dbObject);
|
||||
@@ -3857,12 +3761,9 @@ namespace AyaNova.Biz
|
||||
//validate users choices for required non custom fields
|
||||
RequiredFieldsValidator.Validate(this, FormCustomization, proposedObj);//note: this is passed only to add errors
|
||||
|
||||
//validate custom fields
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void TaskValidateCanDelete(PMItemTask obj)
|
||||
{
|
||||
if (obj == null)
|
||||
@@ -3946,8 +3847,8 @@ namespace AyaNova.Biz
|
||||
await ct.SaveChangesAsync();
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, newObject.AyaType, AyaEvent.Created), ct);
|
||||
await TravelSearchIndexAsync(newObject, true);
|
||||
await TravelHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
||||
await TravelPopulateVizFields(newObject);
|
||||
await TravelHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
||||
return newObject;
|
||||
}
|
||||
}
|
||||
@@ -4002,9 +3903,8 @@ namespace AyaNova.Biz
|
||||
}
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.Id, putObject.AyaType, AyaEvent.Modified), ct);
|
||||
await TravelSearchIndexAsync(putObject, false);
|
||||
|
||||
await TravelHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||
await TravelPopulateVizFields(putObject);
|
||||
await TravelHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||
return putObject;
|
||||
}
|
||||
|
||||
@@ -4224,13 +4124,9 @@ namespace AyaNova.Biz
|
||||
|
||||
//validate users choices for required non custom fields
|
||||
RequiredFieldsValidator.Validate(this, FormCustomization, proposedObj);//note: this is passed only to add errors
|
||||
|
||||
//validate custom fields
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void TravelValidateCanDelete(PMItemTravel obj)
|
||||
{
|
||||
if (obj == null)
|
||||
@@ -4255,8 +4151,6 @@ namespace AyaNova.Biz
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// NOTIFICATION PROCESSING
|
||||
//
|
||||
@@ -4309,16 +4203,11 @@ namespace AyaNova.Biz
|
||||
//
|
||||
internal async Task<PMItemUnit> UnitCreateAsync(PMItemUnit newObject)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
await UnitValidateAsync(newObject, null);
|
||||
if (HasErrors)
|
||||
return null;
|
||||
else
|
||||
{
|
||||
|
||||
newObject.Tags = TagBiz.NormalizeTags(newObject.Tags);
|
||||
newObject.CustomFields = JsonUtil.CompactJson(newObject.CustomFields);
|
||||
await ct.PMItemUnit.AddAsync(newObject);
|
||||
@@ -4326,9 +4215,8 @@ namespace AyaNova.Biz
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, newObject.AyaType, AyaEvent.Created), ct);
|
||||
await UnitSearchIndexAsync(newObject, true);
|
||||
await TagBiz.ProcessUpdateTagsInRepositoryAsync(ct, newObject.Tags, null);
|
||||
await UnitHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
||||
await UnitPopulateVizFields(newObject, false);
|
||||
|
||||
await UnitHandlePotentialNotificationEvent(AyaEvent.Created, newObject);
|
||||
return newObject;
|
||||
}
|
||||
}
|
||||
@@ -4368,7 +4256,6 @@ namespace AyaNova.Biz
|
||||
await UnitValidateAsync(putObject, dbObject);
|
||||
if (HasErrors) return null;
|
||||
|
||||
|
||||
ct.Replace(dbObject, putObject);
|
||||
try
|
||||
{
|
||||
@@ -4385,10 +4272,8 @@ namespace AyaNova.Biz
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.Id, putObject.AyaType, AyaEvent.Modified), ct);
|
||||
await UnitSearchIndexAsync(putObject, false);
|
||||
await TagBiz.ProcessUpdateTagsInRepositoryAsync(ct, putObject.Tags, dbObject.Tags);
|
||||
await UnitHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||
await UnitPopulateVizFields(putObject, false);
|
||||
|
||||
|
||||
await UnitHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||
return putObject;
|
||||
}
|
||||
|
||||
|
||||
@@ -330,7 +330,7 @@ namespace AyaNova.Biz
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.Id, BizType, AyaEvent.Modified), ct);
|
||||
await QuoteSearchIndexAsync(putObject, false);
|
||||
await TagBiz.ProcessUpdateTagsInRepositoryAsync(ct, putObject.Tags, dbObject.Tags);
|
||||
await QuotePopulateVizFields(putObject, true, false);//doing this here ahead of notification because notification may require the viz field lookup anyway and afaict no harm in it
|
||||
await QuotePopulateVizFields(putObject, true, false);
|
||||
await QuoteHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||
return putObject;
|
||||
}
|
||||
|
||||
@@ -349,11 +349,8 @@ namespace AyaNova.Biz
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.Id, BizType, AyaEvent.Modified), ct);
|
||||
await WorkOrderSearchIndexAsync(putObject, false);
|
||||
await TagBiz.ProcessUpdateTagsInRepositoryAsync(ct, putObject.Tags, dbObject.Tags);
|
||||
await WorkOrderPopulateVizFields(putObject, true, false);//doing this here ahead of notification because notification may require the viz field lookup anyway and afaict no harm in it
|
||||
await WorkOrderPopulateVizFields(putObject, true, false);
|
||||
await WorkOrderHandlePotentialNotificationEvent(AyaEvent.Modified, putObject, dbObject);
|
||||
|
||||
|
||||
|
||||
return putObject;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user