Пример #1
0
        public void InvokePORequest(Guid instanceId, int itemId, float itemCost, string itemName, IIdentity identity)
        {
            InitiatePOEventArgs args           = new InitiatePOEventArgs(instanceId, itemId, itemName, itemCost);
            String          securityIdentifier = null;
            WindowsIdentity windowsIdentity    = identity as WindowsIdentity;

            if (windowsIdentity != null && windowsIdentity.User != null)
            {
                securityIdentifier = windowsIdentity.User.Translate(typeof(NTAccount)).ToString();
            }
            else if (identity != null)
            {
                securityIdentifier = identity.Name;
            }

            args.Identity = securityIdentifier;
            Console.WriteLine("Purchase Order initiated by: {0}", identity.Name);

            if (InitiatePurchaseOrder != null)
            {
                InitiatePurchaseOrder(null, args);
            }
        }
Пример #2
0
        public void InvokePORequest(Guid instanceId, int itemId, float itemCost, string itemName, IIdentity identity)
        {
            InitiatePOEventArgs args = new InitiatePOEventArgs(instanceId, itemId, itemName, itemCost);
            String securityIdentifier = null;
            WindowsIdentity windowsIdentity = identity as WindowsIdentity;

            if (windowsIdentity != null && windowsIdentity.User != null)
                securityIdentifier = windowsIdentity.User.Translate(typeof(NTAccount)).ToString();
            else if (identity != null)
                securityIdentifier = identity.Name;

            args.Identity = securityIdentifier;
            Console.WriteLine("Purchase Order initiated by: {0}", identity.Name);

            if (InitiatePurchaseOrder != null)
                InitiatePurchaseOrder(null, args);
        }