GroupActiveMembership IActiveGroupMembershipInterface.this[UUI requestingAgent, UUI principal]
 {
     get
     {
         GroupActiveMembership gam;
         if (!ActiveMembership.TryGetValue(requestingAgent, principal, out gam))
         {
             throw new KeyNotFoundException();
         }
         return(gam);
     }
 }
Ejemplo n.º 2
0
        public static ActiveMembership GetActiveMembership(INotification <ActiveMembership> notify)
        {
            var id         = new Random().Next(int.MaxValue - 5);
            var order      = GetOrder();
            var mid        = new Random().Next(int.MaxValue - 5);
            var name       = "ActiveMembership";
            var membership = new ActiveMembership(notify)
            {
                Id         = mid,
                CreatedOn  = DateTime.Now,
                ItemName   = $"{name}-{mid}",
                ItemPrice  = id + 1,
                ItemStatus = Status.Accepted,
                ItemType   = name,
                Quantity   = 1,
                UnitPrice  = id + 1,
                Owner      = order.Customer,
                IsActive   = true
            };

            order.AddOrderItem(membership);

            return(membership);
        }
        bool IActiveGroupMembershipInterface.ContainsKey(UGUI requestingAgent, UGUI principal)
        {
            GroupActiveMembership gam;

            return(ActiveMembership.TryGetValue(requestingAgent, principal, out gam));
        }