Exemple #1
0
 public void viewItems(UserContext userContext)
 {
     ItemSummary[] itemSummaries = (ItemSummary[])dataService.getItemSummaries(userContext);
     if (itemSummaries == null || itemSummaries.Length == 0)
     {
         System.Console.WriteLine("You have no Items Added.");
     }
     else
     {
         for (int i = 0; i < itemSummaries.Length; i++)
         {
             ItemSummary itemSummary = (ItemSummary)itemSummaries[i];
             String      displayName = itemSummary.contentServiceInfo.contentServiceDisplayName;
             System.Console.WriteLine("ItemId: " + itemSummary.itemId + " DisplayName: "
                                      + displayName + " errorCode: " + itemSummary.refreshInfo.statusCode +
                                      " refreshInfo time: " /**new Date(itemSummary.refreshInfo.lastUpdatedTime * 1000)*/);
             ItemData1 id = itemSummary.itemData;
             if (id != null)
             {
                 ItemAccountData[] itemAccounts = (ItemAccountData[])id.accounts;
                 for (int j = 0; j < itemAccounts.Length; j++)
                 {
                     ItemAccountData iad = (ItemAccountData)itemAccounts[j];
                     System.Console.WriteLine("\tItemAccountId: " + iad.itemAccountInfo.itemAccountId);
                 }
             }
         }
     }
 }
Exemple #2
0
        public void viewItems(UserContext userContext)
        {
            var itemSummaries = (ItemSummary[])dataService.getItemSummaries(userContext);

            if (itemSummaries == null || itemSummaries.Length == 0)
            {
                Console.WriteLine("You have no Items Added.");
            }
            else
            {
                foreach (ItemSummary itemSummary in itemSummaries)
                {
                    String displayName = itemSummary.contentServiceInfo.contentServiceDisplayName;
                    Console.WriteLine("ItemId: " + itemSummary.itemId + " DisplayName: "
                                      + displayName + " errorCode: " + itemSummary.refreshInfo.statusCode +
                                      " refreshInfo time: " /**new Date(itemSummary.refreshInfo.lastUpdatedTime * 1000)*/);
                    ItemData1 id = itemSummary.itemData;
                    if (id != null)
                    {
                        var itemAccounts = (ItemAccountData[])id.accounts;
                        foreach (var iad in itemAccounts)
                        {
                            Console.WriteLine("\tItemAccountId: " + iad.itemAccountInfo.itemAccountId);
                        }
                    }
                }
            }
        }
Exemple #3
0
        public void removeItem()
        {
            DataServiceService dataService = new DataServiceService();

            dataService.Url = System.Configuration.ConfigurationManager.AppSettings.Get("soapServer") + "/" + "DataService";
            object[] itemSummaries = dataService.getItemSummaries(userContext);
            if (itemSummaries != null && itemSummaries.Length >= 0)
            {
                for (int i = 0; i < itemSummaries.Length; i++)
                {
                    ItemSummary itemSummary = (ItemSummary)itemSummaries[i];
                    System.Console.WriteLine("itemId=" + itemSummary.itemId + " "
                                             + itemSummary.itemDisplayName);
                }
            }
            else
            {
                System.Console.WriteLine("No Items to remove");
            }
            RemoveItem removeItem = new RemoveItem();

            System.Console.Write("\nEnter Item ID: ");
            String input  = System.Console.ReadLine();
            long   itemId = 0;

            if (long.TryParse(input, out itemId))
            {
                if (itemId > 0)
                {
                    removeItem.removeItem(userContext, itemId);
                }
            }
        }
Exemple #4
0
        void sessionlessViewItems()
        {
            System.Console.Write("Login: "******"";

            System.Console.Write("Password: "******"SessionLess core calls");
            PasswordCredentials passwordCredentials = new PasswordCredentials();

            passwordCredentials.loginName = userName;
            passwordCredentials.password  = password;

            UserContext    sessionlessUserContext = new UserContext();
            CobrandContext cobrandContext         = getCobrandContext();

            sessionlessUserContext.cobrandConversationCredentials = cobrandContext.cobrandConversationCredentials;
            sessionlessUserContext.conversationCredentials        = passwordCredentials;

            sessionlessUserContext.applicationId       = cobrandContext.applicationId;
            sessionlessUserContext.channelId           = cobrandContext.channelId;
            sessionlessUserContext.channelIdSpecified  = true;
            sessionlessUserContext.cobrandId           = cobrandContext.cobrandId;
            sessionlessUserContext.cobrandIdSpecified  = true;
            sessionlessUserContext.ipAddress           = cobrandContext.ipAddress;
            sessionlessUserContext.isPasswordExpired   = false;
            sessionlessUserContext.locale              = cobrandContext.locale;
            sessionlessUserContext.preferenceInfo      = cobrandContext.preferenceInfo;
            sessionlessUserContext.tncVersion          = cobrandContext.tncVersion;
            sessionlessUserContext.tncVersionSpecified = true;
            sessionlessUserContext.valid             = true;
            sessionlessUserContext.validationHandler = cobrandContext.validationHandler;

            Object[] itemSummaries = (Object[])dataService.getItemSummaries(sessionlessUserContext);
            if (itemSummaries == null || itemSummaries.Length == 0)
            {
                System.Console.WriteLine("You have no Items Added.");
            }
            else
            {
                for (int i = 0; i < itemSummaries.Length; i++)
                {
                    ItemSummary itemSummary = (ItemSummary)itemSummaries[i];
                    String      displayName = itemSummary.contentServiceInfo.contentServiceDisplayName;
                    System.Console.WriteLine("ItemId: " + itemSummary.itemId + " DisplayName: "
                                             + displayName + " errorCode: " + itemSummary.refreshInfo.statusCode +
                                             " refreshInfo time: " /**new Date(itemSummary.refreshInfo.lastUpdatedTime * 1000)*/);
                }
            }
        }