static public bool GetRecivedCommand(Guid guid, out PDiscountCard.AlohaExternal.ICommandResponse RecivedCommand) { if (RecivedCommands.TryGetValue(guid, out RecivedCommand)) { return(true); } return(false); }
static public void ComplitedRecivedCommand(PDiscountCard.AlohaExternal.ICommandResponse RecivedCommand) { PDiscountCard.AlohaExternal.ICommandResponse RC; if (RecivedCommands.TryGetValue(RecivedCommand.RequestId, out RC)) { if (RecivedCommand.Success) { RecivedCommand.Status = 1; } else { RecivedCommand.Status = 2; } RC = RecivedCommand; } }
static public bool AddRecivedCommand(PDiscountCard.AlohaExternal.ICommandResponse RecivedCommand) { PDiscountCard.AlohaExternal.ICommandResponse RC; if (!RecivedCommands.TryGetValue(RecivedCommand.RequestId, out RC)) { RecivedCommand.Status = 0; RecivedCommands.Add(RecivedCommand.RequestId, RecivedCommand); return(true); } else { if (!RC.Success) { return(false); } else { RC = RecivedCommand; return(true); } } }