Ejemplo n.º 1
0
        public async Task <string> VoidSupport(string fileId, string supportId, SupportVoidReason reason)
        {
            var supports = essContext.era_evacueesupports
                           .Expand(s => s.era_EvacuationFileId)
                           .Where(s => s.era_name == supportId).ToArray();

            var existingSupport = supports.Where(s => s.era_EvacuationFileId.era_name == fileId).SingleOrDefault();

            if (existingSupport != null)
            {
                existingSupport.era_voidreason = (int)reason;
                essContext.DeactivateObject(existingSupport, (int)SupportStatus.Void);
                await essContext.SaveChangesAsync();
            }
            essContext.DetachAll();

            return(fileId);
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> VoidSupport(string fileId, string supportId, SupportVoidReason voidReason)
        {
            var result = await messagingClient.Send(new VoidSupportCommand
            {
                FileId     = fileId,
                SupportId  = supportId,
                VoidReason = Enum.Parse <EMBC.ESS.Shared.Contracts.Events.SupportVoidReason>(voidReason.ToString(), true)
            });

            return(Ok());
        }
Ejemplo n.º 3
0
 public static SupportStatusTransition VoidSupport(string supportId, SupportVoidReason reason) => new SupportStatusTransition
 {
     SupportId = supportId,
     Reason    = reason.ToString(),
     ToStatus  = SupportStatus.Void
 };