Esempio n. 1
0
        /// <summary>
        /// List all the accounts a user has.  The user is prompted to pick
        /// one to edit.  It returns the itemId of the item to edit.
        /// </summary>
        public long listAccounts(UserContext userContext)
        {
            // Get ItemSummary
            object[] itemSummaries = dataService.getItemSummariesWithoutItemData(userContext);

            // Verify that there is an ItemSummary
            if (itemSummaries == null || itemSummaries.Length == 0)
            {
                System.Console.WriteLine("No bank data available");
                return(0);
            }

            System.Console.WriteLine("Please an account:");
            int       count = 1;
            Hashtable map   = new Hashtable();

            for (int i = 0; i < itemSummaries.Length; i++)
            {
                ItemSummary itemSummary = (ItemSummary)itemSummaries[i];
                System.Console.WriteLine(count + ". " +
                                         itemSummary.contentServiceInfo.contentServiceDisplayName);
                map.Add((long)count, (long)itemSummary.itemId);

                count++;
            }

            System.Console.Write("> ");
            // Read User Input
            String readStr = System.Console.ReadLine();

            // Convert input to a long
            long sel    = long.Parse(readStr);
            long itemId = 0;

            // Get ItemId from Hashtable
            if (sel >= 1 && sel <= count)
            {
                IDictionaryEnumerator en = map.GetEnumerator();
                while (en.MoveNext())
                {
                    //System.Console.WriteLine(en.Key + " : " + en.Value);
                    long key = (long)en.Key;
                    if (key == sel)
                    {
                        itemId = (long)en.Value;
                    }
                }
                return(itemId);
            }
            else
            {
                System.Console.WriteLine("Error! Invalid Entry");
            }
            return(0);
        }
Esempio n. 2
0
        public void displayItemSummary(UserContext userContext, long itemId)
        {
            // Create Data Extent, Use the data extent as required for better performance int.MaxValue used only for the sample application.
            // Refer Javadocs for available Extent values for all containers

            DataExtent dataExtent = new DataExtent();

            dataExtent.startLevel = 0;
            dataExtent.endLevel   = int.MaxValue;

            dataExtent.startLevelSpecified = true;
            dataExtent.endLevelSpecified   = true;

            DataExtent  da            = new DataExtent();
            ItemSummary itemSummary   = dataService.getItemSummaryForItem1(userContext, itemId, true, dataExtent);
            String      containerName = itemSummary.contentServiceInfo.containerInfo.containerName;

            if (containerName.Equals(ContainerTypes.CREDIT_CARD))
            {
                DisplayCardData displayCard = new DisplayCardData();
                displayCard.DisplayCardDataForItem(itemSummary);
            }
            else if (containerName.Equals(ContainerTypes.INSURANCE))
            {
                DisplayInsuranceData displayInsurance = new DisplayInsuranceData();
                displayInsurance.displayInsuranceDataForItem(itemSummary);
            }
            else if (containerName.Equals(ContainerTypes.INVESTMENT))
            {
                DisplayInvestmentData displayInvestment = new DisplayInvestmentData();
                displayInvestment.displayInvestmentDataForItem(itemSummary);
            }
            else if (containerName.Equals(ContainerTypes.BANK))
            {
                DisplayBankData displayBank = new DisplayBankData();
                displayBank.displayBankDataForItem(itemSummary);
            }
            else if (containerName.Equals(ContainerTypes.BILL))
            {
                DisplayBillsData displayBills = new DisplayBillsData();
                displayBills.displayBillsDataForItem(itemSummary);
            }
            else if (containerName.Equals(ContainerTypes.LOAN))
            {
                DisplayLoanData displayLoan = new DisplayLoanData();
                displayLoan.displayLoanDataForItem(itemSummary);
            }
            else
            {
                System.Console.WriteLine("Unsupported Container: " + containerName);
            }
            System.Console.WriteLine("");
        }
Esempio n. 3
0
 private void UpdateItemPicture(ItemSummary item)
 {
     D3Api.GetItemIcon(item.Icon, "large",
                       picture =>
     {
         if (picture != null)
         {
             guiItemPicture.Image = new Bitmap(new MemoryStream(picture.Bytes));
         }
     },
                       () => { }
                       );
 }
Esempio n. 4
0
        private static async Task <Item> GetFullItem(ItemSummary itemSummary, string itemName)
        {
            if (itemSummary == null)
            {
                return(null);
            }

            Console.WriteLine($"Downloading {itemName}");

            var itemAsync = await itemSummary?.GetFullItemAsync();

            Console.WriteLine($"{itemName} downloaded");

            return(itemAsync);
        }
Esempio n. 5
0
        public SearchResult Search(string keyword, int pageSize, int pageNumber)
        {
            var searchResult = new SearchResult();
            searchResult.Results = new List<ItemSummary>();
               var luceneResult = Utility.Lucene.Index.Search.SearchBIMXchange("family", keyword, pageSize, pageNumber);
            foreach(var doc in luceneResult.Results)
            {
                var itemSummary = new ItemSummary {FamilyName = doc.Get("family"),
                                                        Name = doc.Get("name")};
                var field = doc.fields_ForNUnit;
                searchResult.Results.Add(itemSummary);

            }
            searchResult.TotalCount = luceneResult.TotalCount;
            return searchResult;
        }
        public DataTable GetCompanyforSearch(ItemSummary itemSummary)
        {
            sqlConnection = new SqlConnection(connectionString);
            commandString = @"SELECT c.Name FROM Item AS i LEFT JOIN Company AS c ON c.ID = i.company_ID WHERE i.category_ID = " + itemSummary.categoryID + " ";
            sqlCommand    = new SqlCommand(commandString, sqlConnection);

            sqlConnection.Open();

            SqlDataAdapter dataAdapter = new SqlDataAdapter(sqlCommand);
            DataTable      dataTable   = new DataTable();

            dataAdapter.Fill(dataTable);

            sqlConnection.Close();

            return(dataTable);
        }
Esempio n. 7
0
        /// <summary>
        /// Get the current credentials of an item.
        /// </summary>

        /*public void getItemInfo(UserContext userContext, long itemId)
         * {
         *
         *  System.Console.WriteLine("Getting Credentials for item: " + itemId);
         *  try
         *  {
         *      Form form = itemManagement.getLoginFormCredentialsForItem(userContext, itemId, true);
         *
         *      System.Console.WriteLine("\n" + SEPARATOR);
         *      FormUtil.PrintFormStructureAsText(form);
         *      System.Console.WriteLine(SEPARATOR + "\n");
         *      fieldInfoList = new ArrayList();
         *      //fieldInfoList = FormUtil.getUserInputFieldInfoList(userContext,
         *      //    itemManagement.getLoginFormCredentialsForItem(userContext, itemId,true));
         *      fieldInfoList = FormUtil.getUserInputFieldInfoList(userContext,
         *          itemManagement.getLoginFormForContentService(userContext, csId, true));
         *     // FormUtil.getUserInputFieldInfoList(form, fieldInfoList);
         *  }
         *  catch (SoapException se)
         *  {
         *      System.Console.WriteLine(se.StackTrace);
         *  }
         * }*/

        public void getItemInfo(UserContext userContext, long itemId)
        {
            System.Console.WriteLine("Getting Credentials for item: " + itemId);
            try
            {
                ItemSummary itemSummary = dataService.getItemSummaryForItem(userContext, itemId, true);
                Form        form        = itemManagement.getLoginFormForContentService(getCobrandContext(), itemSummary.contentServiceId, true);
                System.Console.WriteLine("\n" + SEPARATOR);
                FormUtil.PrintFormStructureAsText(form);
                System.Console.WriteLine(SEPARATOR + "\n");
                fieldInfoList = new ArrayList();
                FormUtil.getUserInputFieldInfoList(form, fieldInfoList);
            }
            catch (SoapException se)
            {
                System.Console.WriteLine(se.StackTrace);
            }
        }
Esempio n. 8
0
        /// <summary>
        /// Summaries the panel.
        /// </summary>
        /// <param name="analytics">The analytics.</param>
        /// <param name="allPublicationTargets">All publication targets.</param>
        /// <param name="PublicationTargets"></param>
        /// <returns>List&lt;ItemSummary&gt;.</returns>
        public List <ItemSummary> SummaryPanelData(IEnumerable <Analytics> analytics, IdentifiableObjectData[] PublicationTargets)
        {
            List <ItemSummary> itemssummary = new List <ItemSummary>();

            foreach (var publicationTarget in PublicationTargets)
            {
                ItemSummary itemsum     = new ItemSummary();
                var         analyticses = analytics as Analytics[] ?? analytics.ToArray();
                var         page        = analyticses.Where(x =>
                                                            (x.ItemType == "Page") && (x.PublicationTarget == publicationTarget.Title))
                                          .Select(x => x.Count)
                                          .ToList();
                var componentTemplate = analyticses.Where(x =>
                                                          (x.ItemType == "ComponentTemplate") && (x.PublicationTarget == publicationTarget.Title))
                                        .Select(x => x.Count)
                                        .ToList();
                var component = analyticses.Where(x =>
                                                  (x.ItemType == "Component") && (x.PublicationTarget == publicationTarget.Title))
                                .Select(x => x.Count)
                                .ToList();
                var category = analyticses.Where(x =>
                                                 (x.ItemType == "Category") && (x.PublicationTarget == publicationTarget.Title))
                               .Select(x => x.Count)
                               .ToList();
                itemsum.title = publicationTarget.Title;
                itemsum.page  = page.Count > 0
                    ? page[0]
                    : 0;
                itemsum.componentTemplate = componentTemplate.Count > 0
                    ? componentTemplate[0]
                    : 0;
                itemsum.component = component.Count > 0
                    ? component[0]
                    : 0;
                itemsum.category = category.Count > 0
                    ? component[0]
                    : 0;

                itemssummary.Add(itemsum);
            }

            return(itemssummary);
        }
Esempio n. 9
0
        private void _printItemSummaries(object[] itemSummaries)
        {
            if (itemSummaries == null)
            {
                System.Console.WriteLine("No items were found for the user.");
                return;
            }
            else if (itemSummaries.Length == 0)
            {
                System.Console.WriteLine("No items were found for the user.");
                return;
            }

            for (int i = 0; i < itemSummaries.Length; i++)
            {
                System.Console.WriteLine("Item Summary Information:");
                ItemSummary itemSummary = (ItemSummary)itemSummaries[i];
                displayItemSummaryInfo(itemSummary);
                System.Console.WriteLine("");
            }
        }
        public DataTable SearchItem(ItemSummary itemSummary)
        {
            commandString = @"SELECT DISTINCT i.Name AS Item, co.Name AS Company, ca.Name AS Category, StockIn.available_quantity AS Available, reorder_level AS ReorderLevel FROM Item AS i
                              LEFT JOIN Company AS co ON co.ID = i.company_ID 
                              LEFT JOIN Category AS ca ON ca.ID = i.category_ID
                              LEFT JOIN StockIn ON StockIn.item_ID = i.ID
                              WHERE co.ID = " + itemSummary.companyID + " AND ca.ID = " + itemSummary.categoryID + "";

            sqlCommand = new SqlCommand(commandString, sqlConnection);

            sqlConnection.Open();

            SqlDataAdapter dataAdapter = new SqlDataAdapter(sqlCommand);
            DataTable      dataTable   = new DataTable();

            dataAdapter.Fill(dataTable);

            sqlConnection.Close();

            return(dataTable);
        }
Esempio n. 11
0
        /// <summary>
        /// Displays all the item summaries of loan items of the user.
        /// </summary>
        /// <param name="userContext"></param>
        /// <param name="isHistoryNeeded"></param>
        public void displayLoanData(UserContext userContext, bool isHistoryNeeded)
        {
            // Create Data Extent
            DataExtent dataExtent = new DataExtent();

            dataExtent.startLevel = 0;
            dataExtent.endLevel   = int.MaxValue;

            // Create Container Criteria
            ContainerCriteria cc = new ContainerCriteria();

            cc.dataExtent    = dataExtent;
            cc.containerType = ContainerTypes.LOAN;

            // Create a list of Container Criteria
            object[] list = { cc };

            // Create Summary request and add Container Criteria
            SummaryRequest sr = new SummaryRequest();

            sr.containerCriteria         = list;
            sr.deletedItemAccountsNeeded = true;
            sr.historyNeeded             = isHistoryNeeded;

            // Get ItemSummary
            object[] itemSummaries = dataService.getItemSummaries1(userContext, sr);

            // Verify that there is an ItemSummary
            if (itemSummaries == null || itemSummaries.Length == 0)
            {
                System.Console.WriteLine("No bank data available");
                return;
            }

            for (int i = 0; i < itemSummaries.Length; i++)
            {
                ItemSummary itemSummary = (ItemSummary)itemSummaries[i];
                displayLoanDataForItem(itemSummary);
            }
        }
Esempio n. 12
0
        public bool IsMFA(long itemId)
        {
            string soapServer  = CurrentValues.Instance.YodleeSoapServer;
            var    dataService = new DataServiceService {
                Url = soapServer + "/" + "DataService"
            };
            ItemSummary itemSummary = dataService.getItemSummaryForItem(UserContext, itemId, true);

            if (itemSummary == null)
            {
                throw new Exception("The item does not exist");
            }

            var mfaType = itemSummary.contentServiceInfo.mfaType;

            if (mfaType != null && mfaType.HasValue)             //mfaType.typeId > 0
            {
                return(true);
            }

            return(false);
        }
 public bool Start(ItemSummary summary, bool forceStart = false)
 {
     return(Start(summary.InfoHash, forceStart));
 }
Esempio n. 14
0
 private static void SelectActiveGem(ComboBox comboBox, IEnumerable <GemsListViewItem> refGems, ItemSummary equippedGem)
 {
     if (equippedGem != null)
     {
         comboBox.SelectedItem = refGems.First(g => equippedGem.Id == g.Item.Id);
     }
 }
Esempio n. 15
0
        /// <summary>
        /// Displays the item information and item data information
        /// for the given investment itemSummary.
        /// </summary>
        /// <param name="itemSummary">an itemSummary whose containerType is 'stocks'</param>
        public void displayInvestmentDataForItem(ItemSummary itemSummary)
        {
            System.Console.WriteLine("");
            String containerType = itemSummary.contentServiceInfo.containerInfo.containerName;

            if (!containerType.Equals(ContainerTypes.INVESTMENT))
            {
                throw new Exception("DisplayInvestmentDataForItem called with invalid container type" +
                                    containerType);
            }

            DisplayItemInfo displayItemInfo = new DisplayItemInfo();

            displayItemInfo.displayItemSummaryInfo(itemSummary);

            // Get ItemData
            ItemData1 itemData = itemSummary.itemData;

            if (itemData == null)
            {
                System.Console.WriteLine("\tItemData is null");
            }
            else
            {
                // InvestmentData
                object[] accounts = itemData.accounts;
                if (accounts == null || accounts.Length == 0)
                {
                    System.Console.WriteLine("\tNo accounts");
                }
                else
                {
                    System.Console.WriteLine("\n\t\t**InvestmentData**");
                    for (int i = 0; i < accounts.Length; i++)
                    {
                        InvestmentData investment = (InvestmentData)accounts[i];
                        System.Console.WriteLine("\t\tAccount Name: " + investment.accountName);
                        System.Console.WriteLine("\t\tAccount Number: " + investment.accountNumber);
                        System.Console.WriteLine("\t\tAccount Holder: " + investment.accountHolder);
                        System.Console.WriteLine("\t\tAccount Type: " + investment.acctType);
                        System.Console.WriteLine("\t\tCash: " + investment.cash);
                        System.Console.WriteLine("\t\tTotal Balance: " + investment.totalBalance.amount);
                        System.Console.WriteLine("\t\tTotal Vested Balance: " + investment.totalVestedBalance.amount);
                        System.Console.WriteLine("\t\tTotal Unvested Balance: " + investment.totalUnvestedBalance.amount);
                        System.Console.WriteLine("\t\tMargin Balance: " + investment.marginBalance.amount);
                        System.Console.WriteLine("\t\tlastUpdated: " + UtcToDateTime(investment.lastUpdated.Value));

                        // HoldingData
                        object[] holdings = investment.holdings;
                        if (holdings == null || holdings.Length == 0)
                        {
                            System.Console.WriteLine("\t\tNo investment holdings.");
                        }
                        else
                        {
                            System.Console.WriteLine("\t\t\t**HoldingData**");
                            for (int j = 0; j < holdings.Length; j++)
                            {
                                HoldingData holding = (HoldingData)holdings[j];
                                System.Console.WriteLine("\t\t\tHoldingData Symbol: " + holding.symbol);
                                System.Console.WriteLine("\t\t\tHoldingData Quantity: " + holding.quantity);
                                System.Console.WriteLine("\t\t\tHoldingData Value: " + holding.value.amount);
                                System.Console.WriteLine("\t\t\tHoldingData Description: " + holding.description);
                                System.Console.WriteLine("\t\t\tHoldingData Price: " + holding.price.amount);
                                System.Console.WriteLine("\t\t\tHoldingData Link: " + holding.link);
                                System.Console.WriteLine("\t\t\tHoldingData HoldingType: " + holding.holdingType);
                                System.Console.WriteLine("\t\t\tHoldingData HoldingTypeId: " + holding.holdingTypeId);
                                System.Console.WriteLine("\t\t\tHoldingData Percentage Allocaton: " + holding.percentAllocation);
                                System.Console.WriteLine("\t\t\tHoldingData Percantage Change: " + holding.percentageChange);
                                System.Console.WriteLine("\t\t\tHoldingData Employee Contribution: " + holding.employeeContribution);
                                System.Console.WriteLine("\t\t\tHoldingData Employeer Contribution: " + holding.employerContribution);
                                System.Console.WriteLine("\t\t\tHoldingData Cusip Number: " + holding.cusipNumber);
                                System.Console.WriteLine("\t\t\tHoldingData Daily Change: " + holding.dailyChange);
                                System.Console.WriteLine("\t\t\tHoldingData Cost Basis: " + holding.costBasis.amount + "\n");

                                // TaxLots
                                object[] taxLots = holding.taxLots;
                                if (taxLots == null || taxLots.Length == 0)
                                {
                                    System.Console.WriteLine("\t\t\tNo holdings taxLots");
                                }
                                else
                                {
                                    System.Console.WriteLine("\t\t\t\t**TaxLot**");
                                    for (int u = 0; u < taxLots.Length; u++)
                                    {
                                        TaxLot taxLot = (TaxLot)taxLots[u];
                                        System.Console.WriteLine("\t\t\t\tTaxLot Symbol: " + taxLot.symbol);
                                        System.Console.WriteLine("\t\t\t\tTaxLot Description: " + taxLot.description);
                                        System.Console.WriteLine("\t\t\t\tTaxLot Quantity: " + taxLot.quantity);
                                        System.Console.WriteLine("\t\t\t\tTaxLot Amount: " + taxLot.amount.amount);
                                        System.Console.WriteLine("\t\t\t\tTaxLot Price: " + taxLot.price.amount);
                                        System.Console.WriteLine("\t\t\t\tTaxLot Link: " + taxLot.link);
                                        System.Console.WriteLine("\t\t\t\tTaxLot Cusip Number: " + taxLot.cusipNumber + "\n");
                                    }
                                }
                                // End TaxLot
                            }
                        }
                        // End HoldingData

                        // InvestmentTransactionData
                        object[] investTransactions = investment.investmentTransactions;
                        if (investTransactions == null || investTransactions.Length == 0)
                        {
                            System.Console.WriteLine("\t\tNo investment tranactions");
                        }
                        else
                        {
                            System.Console.WriteLine("\t\t\t**InvestmentTransactionsData**");
                            for (int j = 0; j < investTransactions.Length; j++)
                            {
                                InvestmentTransactionsData trans =
                                    (InvestmentTransactionsData)investTransactions[j];
                                System.Console.WriteLine("\t\t\tTranaction.symbol: " + trans.symbol);
                                System.Console.WriteLine("\t\t\tTranaction.amount: " + trans.amount.amount);
                                System.Console.WriteLine("\t\t\tTranaction.price : " + trans.price.amount);
                                System.Console.WriteLine("\t\t\tTranaction.quantity : " + trans.quantity);
                                System.Console.WriteLine("\t\t\tTranaction.transDate : " + trans.transDate.date);
                                System.Console.WriteLine("\t\t\tTransaction.description: " + trans.description);
                                System.Console.WriteLine("\t\t\tTranaction.link : " + trans.link);
                                System.Console.WriteLine("\t\t\tTranaction.transactionType : " + trans.transactionType);
                                System.Console.WriteLine("\t\t\tTranaction.confirmantionNumber : " + trans.confirmationNumber + "\n");
                            }
                        }
                        // End InvestmentTransactionData
                    }
                }
                // End InvestmentData
            }

/*
 *                      // Get AccountHistory
 *                      object[] acctHistories = itemData.accountHistory;
 *                      if(acctHistories == null || acctHistories.Length == 0)
 *                      {
 *                              System.Console.WriteLine("\tNo Account History");
 *                      }
 *                      else
 *                      {
 *                              System.Console.WriteLine("\n\t**Account History**");
 *                              for(int i = 0; i < acctHistories.Length; i++)
 *                              {
 *                                      AccountHistory acctHistory = (AccountHistory)acctHistories[i];
 *
 *                                      System.Console.WriteLine("\tAccount ID: {0}", acctHistory.accountId );
 *
 *                                      // Get History
 *                                      object[] histories = acctHistory.history;
 *                                      if(histories == null || histories.Length == 0)
 *                                      {
 *                                              System.Console.WriteLine("\t\tNo History");
 *                                      }
 *                                      else
 *                                      {
 *                                              System.Console.WriteLine("\t\t**History**");
 *                                              for(int j = 0; j < histories.Length; j++)
 *                                              {
 *                                                      InvestmentData investment = (InvestmentData) histories[j];
 *                                                      System.Console.WriteLine("\t\taccountName: "+ investment.accountName );
 *                                                      System.Console.WriteLine("\t\taccountNumber: "+ investment.accountNumber );
 *                                                      System.Console.WriteLine("\t\taccountHolder: "+ investment.accountHolder );
 *                                                      System.Console.WriteLine("\t\tacctType: "+ investment.acctType );
 *                                                      System.Console.WriteLine("\t\tcash: "+ investment.cash );
 *                                                      System.Console.WriteLine("\t\ttotalBalance: "+ investment.totalBalance.amount );
 *                                                      System.Console.WriteLine("\t\ttotalVestedBalance: "+ investment.totalVestedBalance.amount );
 *                                                      System.Console.WriteLine("\t\ttotalUnvestedBalance: "+ investment.totalUnvestedBalance.amount );
 *                                                      System.Console.WriteLine("\t\tmarginBalance: "+ investment.marginBalance.amount );
 *                                                      System.Console.WriteLine("\t\tlastUpdated: " + UtcToDateTime(investment.lastUpdated.Value) + "\n");
 *                                              }
 *                                      }
 *                              }
 *                      }
 *                      // AccountHistory*/
        }
Esempio n. 16
0
        public void displayAccountSummary(UserContext userContext, bool isHistoryNeeded)
        {
            // Create Data Extent
            DataExtent dataExtent = new DataExtent();

            dataExtent.startLevel = 0;
            dataExtent.endLevel   = int.MaxValue;

            //// Create Credit Card Container Criteria
            //ContainerCriteria cc = new ContainerCriteria();
            //cc.dataExtent = dataExtent;
            //cc.containerType = ContainerTypes.CREDIT_CARD;

            //// Create Investment Container Criteria
            //ContainerCriteria invest = new ContainerCriteria();
            //invest.dataExtent = dataExtent;
            //invest.containerType = ContainerTypes.INVESTMENT;

            // Create Bank Container Criteria
            ContainerCriteria bank = new ContainerCriteria();

            bank.dataExtent    = dataExtent;
            bank.containerType = ContainerTypes.BANK;

            //// Create Loan Container Criteria
            //ContainerCriteria loan = new ContainerCriteria();
            //loan.dataExtent = dataExtent;
            //loan.containerType = ContainerTypes.LOAN;

            //// Create Insurance Container Criteria
            //ContainerCriteria insur = new ContainerCriteria();
            //insur.dataExtent = dataExtent;
            //insur.containerType = ContainerTypes.INSURANCE;

            //// Create Bill Container Criteria
            //ContainerCriteria bill = new ContainerCriteria();
            //bill.dataExtent = dataExtent;
            //bill.containerType = ContainerTypes.BILL;

            // Create a list of Container Criteria
            object[] list = { bank /*, cc, invest, loan, insur, bill*/ };

            // Create Summary request and add Container Criteria
            SummaryRequest sr = new SummaryRequest();

            sr.containerCriteria         = list;
            sr.deletedItemAccountsNeeded = true;
            sr.historyNeeded             = isHistoryNeeded;

            // Get ItemSummary
            object[] itemSummaries = dataService.getItemSummaries1(userContext, sr);

            // Verify that there is an ItemSummary
            if (itemSummaries == null || itemSummaries.Length == 0)
            {
                System.Console.WriteLine("No bank data available");
                return;
            }

            for (int i = 0; i < itemSummaries.Length; i++)
            {
                ItemSummary itemSummary = (ItemSummary)itemSummaries[i];
                //String containerName =
                //    itemSummary.contentServiceInfo.containerInfo.containerName;

                //if(containerName.Equals(ContainerTypes.CREDIT_CARD))
                //{
                //    DisplayCardData displayCard = new DisplayCardData();
                //    displayCard.DisplayCardDataForItem(itemSummary);
                //}
                //else if(containerName.Equals(ContainerTypes.INSURANCE))
                //{
                //    DisplayInsuranceData displayInsurance = new DisplayInsuranceData();
                //    displayInsurance.displayInsuranceDataForItem(itemSummary);
                //}
                //else if(containerName.Equals(ContainerTypes.INVESTMENT))
                //{
                //    DisplayInvestmentData displayInvestment = new DisplayInvestmentData();
                //    displayInvestment.displayInvestmentDataForItem(itemSummary);
                //}
                //else if(containerName.Equals(ContainerTypes.BANK))
                //{
                DisplayBankData displayBank = new DisplayBankData();
                displayBank.displayBankDataForItem(itemSummary);
                //}
                //else if(containerName.Equals(ContainerTypes.BILL))
                //{
                //    DisplayBillsData displayBills = new DisplayBillsData();
                //    displayBills.displayBillsDataForItem(itemSummary);
                //}
                //else if(containerName.Equals(ContainerTypes.LOAN))
                //{
                //    DisplayLoanData displayLoan = new DisplayLoanData();
                //    displayLoan.displayLoanDataForItem(itemSummary);
                //}
                //else
                //{
                //    System.Console.WriteLine("Unsupported Container: "+ containerName );
                //}
                System.Console.WriteLine("");
            }
        }
Esempio n. 17
0
 private void InsertContextMenu(TreeNode node, ItemSummary d3Object)
 {
     node.Tag = d3Object;
     node.ContextMenuStrip = guiItemSummaryContextMenu;
     node.NodeFont         = defaultNodeFont;
 }
Esempio n. 18
0
        /// <summary>
        /// Displays the item information and item data information
        /// for the given Insurance itemSummary.
        /// </summary>
        /// <param name="itemSummary">an itemSummary whose containerType is 'insurance'</param>
        public void displayInsuranceDataForItem(ItemSummary itemSummary)
        {
            System.Console.WriteLine("");
            String containerType = itemSummary.contentServiceInfo.containerInfo.containerName;

            if (!containerType.Equals(ContainerTypes.INSURANCE))
            {
                throw new Exception("DisplayInsuranceDataForItem called with invalid container type" +
                                    containerType);
            }

            DisplayItemInfo displayItemInfo = new DisplayItemInfo();

            displayItemInfo.displayItemSummaryInfo(itemSummary);

            // Get ItemData
            ItemData1 itemData = itemSummary.itemData;

            if (itemData == null)
            {
                System.Console.WriteLine("\tItemData is null");
            }
            else
            {
                // InsuranceLoginAccountData
                object[] accounts = itemData.accounts;
                if (accounts == null || accounts.Length == 0)
                {
                    System.Console.WriteLine("\tNo accounts");
                }
                else
                {
                    System.Console.WriteLine("\n\t\t**InsuranceLoginAccountData**");
                    for (int i = 0; i < accounts.Length; i++)
                    {
                        InsuranceLoginAccountData ilad = (InsuranceLoginAccountData)accounts[i];
                        System.Console.WriteLine("\t\tInsuranceLoginAccountData.lastUpdated: " + UtcToDateTime(ilad.lastUpdated.Value));

                        // InsuranceData
                        object[] insurancePolicys = ilad.insurancePolicys;
                        if (insurancePolicys == null || insurancePolicys.Length == 0)
                        {
                            System.Console.WriteLine("\t\tNo InsuranceData.");
                        }
                        else
                        {
                            System.Console.WriteLine("\t\t\t**InsuranceData**");
                            for (int j = 0; j < insurancePolicys.Length; j++)
                            {
                                InsuranceData insData = (InsuranceData)insurancePolicys[j];
                                System.Console.WriteLine("\t\t\tInsuranceData.accountNumber: " + insData.accountNumber);
                                System.Console.WriteLine("\t\t\tInsuranceData.cashValue: " + insData.cashValue.amount);
                                System.Console.WriteLine("\t\t\tInsuranceData.insuranceType: " + insData.insuranceType);
                            }
                        }
                        // End InsuranceData
                    }
                }
                // End InsuranceLoginAccountData
            }
        }
 public async Task <bool> Remove(ItemSummary summary, bool removeData = false)
 {
     return(await Remove(summary.InfoHash, removeData));
 }
 public DataTable SearchItem(ItemSummary itemSummary)
 {
     return(_stockRepository.SearchItem(itemSummary));
 }
 public bool Pause(ItemSummary summary)
 {
     return(Pause(summary.InfoHash));
 }
Esempio n. 22
0
        /// <summary>
        /// Displays the item information and item data information
        /// for the given bank itemSummary.
        /// </summary>
        /// <param name="itemSummary">an itemSummary whose containerType is 'bank'</param>
        public void displayBankDataForItem(ItemSummary itemSummary)
        {
            System.Console.WriteLine("");
            String containerType = itemSummary.contentServiceInfo.containerInfo.containerName;

            if (!containerType.Equals("bank"))
            {
                throw new Exception("displayBankDataForItem called with invalid container type" + containerType);
            }

            DisplayItemInfo displayItemInfo = new DisplayItemInfo();

            displayItemInfo.displayItemSummaryInfo(itemSummary);

            // Get ItemData
            ItemData1 itemData = itemSummary.itemData;

            if (itemData == null)
            {
                System.Console.WriteLine("\tItemData is null");
            }
            else
            {
                object[] accounts = itemData.accounts;
                if (accounts == null || accounts.Length == 0)
                {
                    System.Console.WriteLine("\tNo accounts");
                }
                else
                {
                    for (int i = 0; i < accounts.Length; i++)
                    {
                        System.Console.WriteLine("\n\t\t**BankData**");
                        BankData bankData = (BankData)accounts[i];
                        System.Console.WriteLine("\t\tBank Account Name: {0}",
                                                 bankData.accountName);
                        System.Console.WriteLine("\t\tBank Account Cust Description: {0}",
                                                 bankData.customDescription);
                        System.Console.WriteLine("\t\tBank Account Identifier: {0}",
                                                 bankData.bankAccountId);
                        System.Console.WriteLine("\t\tBank Account Balance: {0}",
                                                 bankData.availableBalance.amount);
                        System.Console.WriteLine("\t\tBank Current Balance: {0}",
                                                 bankData.currentBalance.amount);
                        System.Console.WriteLine("\t\tBank Current Acct Type: {0}",
                                                 bankData.acctType);
                        System.Console.WriteLine("\t\tBank Current As of Date: {0}",
                                                 bankData.asOfDate.date);

                        // BankTransactionData
                        object[] bankTransactions = bankData.bankTransactions;
                        if (bankTransactions == null || bankTransactions.Length == 0)
                        {
                            System.Console.WriteLine("\t\tNo bank transactions");
                        }
                        else
                        {
                            System.Console.WriteLine("\n\t\t**BankTransactionData**");
                            for (int j = 0; j < bankTransactions.Length; j++)
                            {
                                BankTransactionData transactionData =
                                    (BankTransactionData)bankTransactions[j];
                                System.Console.WriteLine("\t\t\tTransaction Id: {0}",
                                                         transactionData.bankTransactionId);
                                System.Console.WriteLine("\t\t\tTransaction Description: {0}",
                                                         transactionData.description);
                                System.Console.WriteLine("\t\t\tTransaction Amount: {0}",
                                                         transactionData.transactionAmount.amount);
                                System.Console.WriteLine("\t\t\tTransaction Base Type: {0}",
                                                         transactionData.transactionBaseType);
                                System.Console.WriteLine("\t\t\tCategory: {0}",
                                                         transactionData.category);
                                System.Console.WriteLine("");
                            }
                        }
                        System.Console.WriteLine("");
                    }
                }
            }

            // Get AccountHistory

            object[] acctHistories = itemData.accountHistory;
            if (acctHistories == null || acctHistories.Length == 0)
            {
                System.Console.WriteLine("\tNo Account History");
            }
            else
            {
                System.Console.WriteLine("\n\t**Account History**");
                for (int i = 0; i < acctHistories.Length; i++)
                {
                    AccountHistory acctHistory = (AccountHistory)acctHistories[i];

                    System.Console.WriteLine("\tAccount ID: {0}", acctHistory.accountId);

                    // Get History
                    object[] histories = acctHistory.history;
                    if (histories == null || histories.Length == 0)
                    {
                        System.Console.WriteLine("\t\tNo History");
                    }
                    else
                    {
                        System.Console.WriteLine("\t\t**History**");
                        for (int j = 0; j < histories.Length; j++)
                        {
                            BankData bankData = (BankData)histories[j];
                            System.Console.WriteLine("\t\tBank Account Name: {0}",
                                                     bankData.accountName);
                            System.Console.WriteLine("\t\tBank Account Cust Description: {0}",
                                                     bankData.customDescription);
                            System.Console.WriteLine("\t\tBank Account Identifier: {0}",
                                                     bankData.bankAccountId);
                            System.Console.WriteLine("\t\tBank Account Balance: {0}",
                                                     bankData.availableBalance.amount);
                            System.Console.WriteLine("\t\tBank Current Balance: {0}",
                                                     bankData.currentBalance.amount);
                            System.Console.WriteLine("\t\tBank Current Acct Type: {0}",
                                                     bankData.acctType);
                            System.Console.WriteLine("\t\tBank Current As of Date: {0}",
                                                     bankData.asOfDate.date);
                            System.Console.WriteLine("\t\tLast Updated: {0}\n",
                                                     UtcToDateTime(bankData.lastUpdated.Value));
                        }
                    }
                }
            }
        }
Esempio n. 23
0
 private static void UpdateNodeText(TreeNode node, ItemSummary d3Object)
 {
     node.Text += $" >> {d3Object.Name}";
 }
Esempio n. 24
0
        /// <summary>
        /// Displays the item information and item data information
        /// for the given bank itemSummary.
        /// </summary>
        /// <param name="itemSummary">an itemSummary whose containerType is 'bank'</param>
        public void DisplayCardDataForItem(ItemSummary itemSummary)
        {
            System.Console.WriteLine("");
            String containerType = itemSummary.contentServiceInfo.containerInfo.containerName;

            if (!containerType.Equals(ContainerTypes.CREDIT_CARD))
            {
                throw new Exception("DisplayCardDataForItem called with invalid container type" +
                                    containerType);
            }

            DisplayItemInfo displayItemInfo = new DisplayItemInfo();

            displayItemInfo.displayItemSummaryInfo(itemSummary);

            // Get ItemData
            ItemData1 itemData = itemSummary.itemData;

            if (itemData == null)
            {
                System.Console.WriteLine("\tItemData is null");
            }
            else
            {
                // CardData
                object[] accounts = itemData.accounts;
                if (accounts == null || accounts.Length == 0)
                {
                    System.Console.WriteLine("\tNo accounts");
                }
                else
                {
                    System.Console.WriteLine("\n\t\t**CardData**");
                    for (int i = 0; i < accounts.Length; i++)
                    {
                        CardData cardData = (CardData)accounts[i];
                        System.Console.WriteLine("\t\taccountNumber : " + cardData.accountNumber);
                        System.Console.WriteLine("\t\taccountId : " + cardData.accountId);
                        System.Console.WriteLine("\t\tamountDue : " + cardData.amountDue.amount);
                        System.Console.WriteLine("\t\tlastPayment : " + cardData.lastPayment.amount);
                        System.Console.WriteLine("\t\tminPayment : " + cardData.minPayment);
                        System.Console.WriteLine("\t\trunningBalance : " + cardData.runningBalance.amount);
                        System.Console.WriteLine("\t\tavailableCredit : " + cardData.availableCredit.amount);
                        System.Console.WriteLine("\t\ttotalCreditLine : " + cardData.totalCreditLine.amount);
                        System.Console.WriteLine("\t\tlastUpdated: " + UtcToDateTime(cardData.lastUpdated.Value));

                        // CardStatementData
                        object[] cardStatements = cardData.cardStatements;
                        if (cardStatements == null || cardStatements.Length == 0)
                        {
                            System.Console.WriteLine("\t\tNo card statements");
                        }
                        else
                        {
                            System.Console.WriteLine("\t\t\t**CardStatementData**");
                            for (int j = 0; j < cardStatements.Length; j++)
                            {
                                CardStatementData csd = (CardStatementData)cardStatements[j];
                                System.Console.WriteLine("\t\t\tCardStatementData availableCredit: " + csd.availableCredit.amount);
                                System.Console.WriteLine("\t\t\tCardStatementData availableCash: " + csd.availableCash.amount);
                                System.Console.WriteLine("\t\t\tCardStatementData credit: " + csd.credit.amount);
                                System.Console.WriteLine("\t\t\tCardStatementData payments: " + csd.payments.amount);

                                // CardTransactionData
                                object[] cardStatementTransactions = csd.cardTransactions;
                                if (cardStatementTransactions == null || cardStatementTransactions.Length == 0)
                                {
                                    System.Console.WriteLine("\t\t\tNo card transactions");
                                }
                                else
                                {
                                    System.Console.WriteLine("\t\t\t\t**CardTransactionData**");
                                    for (int u = 0; u < cardStatementTransactions.Length; u++)
                                    {
                                        CardTransactionData ctd =
                                            (CardTransactionData)cardStatementTransactions[u];
                                        System.Console.WriteLine("\t\t\t\tTransaction transactionType: " + ctd.transactionType);
                                        System.Console.WriteLine("\t\t\t\tTransaction description: " + ctd.description);
                                        System.Console.WriteLine("\t\t\t\tTransaction postDate: " + ctd.postDate.date);
                                        System.Console.WriteLine("\t\t\t\tTransaction transAmount: " + ctd.transAmount.amount);
                                        System.Console.WriteLine("\t\t\t\tTransaction transDate: " + ctd.transDate.date);
                                    }
                                }
                                // End CardTransactionData
                            }
                        }
                        // End CardStatementData

                        // CardTransactionData
                        object[] cardTransactions = cardData.cardTransactions;
                        if (cardTransactions == null || cardTransactions.Length == 0)
                        {
                            System.Console.WriteLine("\t\tNo card transactions");
                        }
                        else
                        {
                            System.Console.WriteLine("\t\t\t**CardTransactionData**");
                            for (int j = 0; j < cardTransactions.Length; j++)
                            {
                                CardTransactionData ctd =
                                    (CardTransactionData)cardTransactions[j];
                                System.Console.WriteLine("\t\t\tTransaction transactionType: " + ctd.transactionType);
                                System.Console.WriteLine("\t\t\tTransaction description: " + ctd.description);
                                System.Console.WriteLine("\t\t\tTransaction postDate: " + ctd.postDate.date);
                                System.Console.WriteLine("\t\t\tTransaction transAmount: " + ctd.transAmount.amount);
                                System.Console.WriteLine("\t\t\tTransaction transDate: " + ctd.transDate.date);
                            }
                        }
                        // End CardTransactionData
                    }
                }
                // End CardData
            }

            /*// Get AccountHistory
             * object[] acctHistories = itemData.accountHistory;
             * if(acctHistories == null || acctHistories.Length == 0)
             * {
             *      System.Console.WriteLine("\tNo Account History");
             * }
             * else
             * {
             *      System.Console.WriteLine("\n\t**Account History**");
             *      for(int i = 0; i < acctHistories.Length; i++)
             *      {
             *              AccountHistory acctHistory = (AccountHistory)acctHistories[i];
             *
             *              System.Console.WriteLine("\tAccount ID: {0}", acctHistory.accountId );
             *
             *              // Get History
             *              object[] histories = acctHistory.history;
             *              if(histories == null || histories.Length == 0)
             *              {
             *                      System.Console.WriteLine("\t\tNo History");
             *              }
             *              else
             *              {
             *                      System.Console.WriteLine("\t\t**History**");
             *                      for(int j = 0; j < histories.Length; j++)
             *                      {
             *                              //BankData bankData = (BankData)histories[j];
             *                              CardData cardData = (CardData) histories[j];
             *                              System.Console.WriteLine("\t\taccountNumber : " + cardData.accountNumber );
             *                              System.Console.WriteLine("\t\taccountId : " + cardData.accountId );
             *                              System.Console.WriteLine("\t\tamountDue : " + cardData.amountDue.amount );
             *                              System.Console.WriteLine("\t\tlastPayment : " + cardData.lastPayment.amount );
             *                              System.Console.WriteLine("\t\tminPayment : " + cardData.minPayment );
             *                              System.Console.WriteLine("\t\trunningBalance : " + cardData.runningBalance.amount );
             *                              System.Console.WriteLine("\t\tavailableCredit : " + cardData.availableCredit.amount );
             *                              System.Console.WriteLine("\t\ttotalCreditLine : " + cardData.totalCreditLine.amount );
             *                              System.Console.WriteLine("\t\tlastUpdated: " + UtcToDateTime(cardData.lastUpdated.Value) );
             *                      }
             *              }
             *      }
             * }
             * // AccountHistory*/
        }
 public async Task <bool> Start(ItemSummary summary, bool forceStart = false)
 {
     return(await Start(summary.InfoHash, forceStart));
 }
Esempio n. 26
0
 private void OnNodeClick(ItemSummary d3Object)
 {
     D3ObjectLiveUrl.Text = D3Api.GetItemUrlFromTooltipParams(d3Object.TooltipParams);
 }
 public bool Remove(ItemSummary summary, bool removeData = false)
 {
     return(Remove(summary.InfoHash, removeData));
 }
Esempio n. 28
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)*/);
                }
            }
        }
            public void AddMessage(MigrationReportMessage message)
            {
                ItemSummary item;
                string sourceName = message.SourceName ?? string.Empty;

                if (!_items.TryGetValue(sourceName, out item))
                {
                    item = new ItemSummary(sourceName, message.GeneratedItem);
                    _items.Add(sourceName, item);
                }

                item.AddMessage(message);

                if (message.Type == BuildMessageType.Error)
                {
                    _errors++;
                }
                else if (message.Type == BuildMessageType.Warning)
                {
                    _warnings++;
                }
            }
 public async Task <bool> Pause(ItemSummary summary)
 {
     return(await Pause(summary.InfoHash));
 }
Esempio n. 31
0
        /// <summary>
        /// Displays the item information and item data information
        /// for the given loan itemSummary.
        /// </summary>
        /// <param name="itemSummary">an itemSummary whose containerType is 'loan'</param>
        public void displayLoanDataForItem(ItemSummary itemSummary)
        {
            System.Console.WriteLine("");
            String containerType = itemSummary.contentServiceInfo.containerInfo.containerName;

            if (!containerType.Equals(ContainerTypes.LOAN))
            {
                throw new Exception("DisplayLoanDataForItem called with invalid container type" +
                                    containerType);
            }

            DisplayItemInfo displayItemInfo = new DisplayItemInfo();

            displayItemInfo.displayItemSummaryInfo(itemSummary);

            // Get ItemData
            ItemData1 itemData = itemSummary.itemData;

            if (itemData == null)
            {
                System.Console.WriteLine("\tItemData is null");
            }
            else
            {
                // LoanLoginAccountData
                object[] accounts = itemData.accounts;
                if (accounts == null || accounts.Length == 0)
                {
                    System.Console.WriteLine("\tNo accounts");
                }
                else
                {
                    System.Console.WriteLine("\n\t\t**LoanLoginAccountData**");
                    for (int i = 0; i < accounts.Length; i++)
                    {
                        LoanLoginAccountData llad = (LoanLoginAccountData)accounts[i];
                        System.Console.WriteLine("\t\tLoanLoginAccountData.loanAccountNumber: " + llad.loanAccountNumber);
                        System.Console.WriteLine("\t\tLoanLoginAccountData.loanAccountNumber: " + UtcToDateTime(llad.lastUpdated.Value));

                        // Loan
                        object[] loans = llad.loans;
                        if (loans == null || loans.Length == 0)
                        {
                            System.Console.WriteLine("\t\tNo Loans.");
                        }
                        else
                        {
                            System.Console.WriteLine("\t\t\t**Loan**");
                            for (int j = 0; j < loans.Length; j++)
                            {
                                Loan loan = (Loan)loans[j];
                                System.Console.WriteLine("\t\t\tLoan.accountName: " + loan.accountName);
                                System.Console.WriteLine("\t\t\tLoan.accountNumber: " + loan.accountNumber);
                                System.Console.WriteLine("\t\t\tLoan.interestRate: " + loan.interestRate);

                                // LoanPayOffs
                                object[] loanPayOffs = loan.loanPayOffs;
                                if (loanPayOffs == null || loanPayOffs.Length == 0)
                                {
                                    System.Console.WriteLine("\t\t\tNo loanPayOffs");
                                }
                                else
                                {
                                    System.Console.WriteLine("\t\t\t\t**LoanPayoff**");
                                    for (int u = 0; u < loanPayOffs.Length; u++)
                                    {
                                        LoanPayoff loanPayOff = (LoanPayoff)loanPayOffs[u];
                                        System.Console.WriteLine("\t\t\t\tLoanPayoff.payoffAmount: " + loanPayOff.payoffAmount.amount);
                                        System.Console.WriteLine("\t\t\t\tLoan Pay By Date: " + loanPayOff.payByDate.date);
                                    }
                                }
                                // End LoanPayOffs

                                // LoanPayMentDues
                                object[] loanPaymentDues = loan.loanPaymentDues;
                                if (loanPaymentDues == null || loanPaymentDues.Length == 0)
                                {
                                    System.Console.WriteLine("\t\t\tNo loanPaymentDues");
                                }
                                else
                                {
                                    System.Console.WriteLine("\t\t\t\t**LoanPaymentDue**");
                                    for (int u = 0; u < loanPaymentDues.Length; u++)
                                    {
                                        LoanPaymentDue lpd = (LoanPaymentDue)loanPaymentDues[u];
                                        System.Console.WriteLine("\t\t\t\tLoanPaymentDue.interestAmount: " + lpd.interestAmount.amount);
                                        System.Console.WriteLine("\t\t\t\tLoanPaymentDue.principalAmount: " + lpd.principalAmount.amount);

                                        // Bill
                                        Bill bill = lpd.bill;
                                        if (bill == null)
                                        {
                                            System.Console.WriteLine("\t\t\t\t\tNo Bill");
                                        }
                                        else
                                        {
                                            System.Console.WriteLine("\t\t\t\tBill.dueDate: " + bill.dueDate.date);
                                            System.Console.WriteLine("\t\t\t\tBill.minPayment: " + bill.minPayment.amount);
                                        }
                                        // end Bill
                                    }
                                }
                                // End LoanPayMentDues

                                // LoanTransaction
                                object[] loanTransactions = loan.loanTransactions;
                                if (loanTransactions == null || loanTransactions.Length == 0)
                                {
                                    System.Console.WriteLine("\t\tNo loan tranactions");
                                }
                                else
                                {
                                    System.Console.WriteLine("\t\t\t**LoanTransaction**");
                                    for (int u = 0; u < loanTransactions.Length; u++)
                                    {
                                        LoanTransaction trans =
                                            (LoanTransaction)loanTransactions[u];
                                        System.Console.WriteLine("\t\t\t\tTranaction.amount: " + trans.amount.amount);
                                        System.Console.WriteLine("\t\t\t\tTranaction.transDate : " + (trans.transactionDate.month + '-' + trans.transactionDate.dayOfMonth + '-' + trans.transactionDate.year));
                                        System.Console.WriteLine("\t\t\t\tTransaction.description: " + trans.description);
                                        System.Console.WriteLine("\t\t\t\tTranaction.transactionType : " + trans.transactionType);
                                    }
                                }
                                // End LoanTransaction
                            }
                        }
                        // End Loan
                    }
                }
                // End LoanLoginAccountData
            }

            /*// Get AccountHistory
             * object[] acctHistories = itemData.accountHistory;
             * if(acctHistories == null || acctHistories.Length == 0)
             * {
             *      System.Console.WriteLine("\tNo Account History");
             * }
             * else
             * {
             *      System.Console.WriteLine("\n\t**Account History**");
             * for(int i = 0; i < acctHistories.Length; i++)
             *      {
             *              AccountHistory acctHistory = (AccountHistory)acctHistories[i];
             *
             *              System.Console.WriteLine("\tAccount ID: {0}", acctHistory.accountId );
             *
             *              // Get History
             *              object[] histories = acctHistory.history;
             *              if(histories == null || histories.Length == 0)
             *              {
             *                      System.Console.WriteLine("\t\tNo History");
             *              }
             *              else
             *              {
             *                      System.Console.WriteLine("\t\t**History**");
             *                      for(int j = 0; j < histories.Length; j++)
             *                      {
             *                              LoanLoginAccountData llad = (LoanLoginAccountData) histories[j];
             *                              System.Console.WriteLine("\t\tLoanLoginAccountData.loanAccountNumber: "+ llad.loanAccountNumber );
             *                              System.Console.WriteLine("\t\tLoanLoginAccountData.loanAccountNumber: " + UtcToDateTime(llad.lastUpdated.Value) );
             *
             *                              // Loan
             *                              object[] loans = llad.loans;
             *                              if (loans == null || loans.Length == 0)
             *                              {
             *                                      System.Console.WriteLine("\t\tNo Loans.");
             *                              }
             *                              else
             *                              {
             *                                      System.Console.WriteLine("\t\t\t**Loan**");
             *                                      for (int u = 0; u < loans.Length; u++)
             *                                      {
             *                                              Loan loan = (Loan) loans[u];
             *                                              System.Console.WriteLine("\t\t\tLoan.accountName: " + loan.accountName );
             *                                              System.Console.WriteLine("\t\t\tLoan.accountNumber: " + loan.accountNumber );
             *                                              System.Console.WriteLine("\t\t\tLoan.interestRate: " + loan.interestRate );
             *
             *                                      }
             *                              }
             *                      }
             *              }
             *      }
             * }
             * // end AccountHistory
             *
             */
        }
Esempio n. 32
0
        /// <summary>
        /// Displays the item information and item data information
        /// for the given bank itemSummary.
        /// </summary>
        /// <param name="userContext"></param>
        /// <param name="itemId"></param>
        /// <param name="itemSummaryInfo"></param>
        /// <param name="error"></param>
        /// <param name="bankTransactionDataList"></param>
        public void GetBankDataForItem(UserContext userContext, long itemId, out string itemSummaryInfo, out string error, out Dictionary <BankData, List <BankTransactionData> > bankTransactionDataList)
        {
            Log.Debug(string.Format("GetBankDataForItem: userContex valid {0}, itemId {1}", userContext.valid, itemId));
            var dataExtent = new DataExtent
            {
                startLevel          = 0,
                endLevel            = int.MaxValue,
                startLevelSpecified = true,
                endLevelSpecified   = true
            };

            ItemSummary itemSummary = dataService.getItemSummaryForItem1(userContext, itemId, true, dataExtent);

            if (itemSummary == null)
            {
                throw new Exception(string.Format("Item for item id {0} not found", itemId));
            }

            error = "";
            bankTransactionDataList = new Dictionary <BankData, List <BankTransactionData> >();

            String containerType = itemSummary.contentServiceInfo.containerInfo.containerName;

            if (!containerType.Equals("bank"))
            {
                throw new Exception("displayBankDataForItem called with invalid container type" + containerType);
            }

            var displayItemInfo = new DisplayItemInfo();

            itemSummaryInfo = displayItemInfo.getItemSummaryInfo(itemSummary);
            Log.Debug(itemSummaryInfo);
            // Get ItemData
            ItemData1 itemData = itemSummary.itemData;

            if (itemData == null)
            {
                error += "\tItemData is null";
            }
            else
            {
                object[] accounts = itemData.accounts;
                if (accounts == null || accounts.Length == 0)
                {
                    Log.Warn("Yodlee get bank data: No accounts");
                }
                else
                {
                    foreach (object account in accounts)
                    {
                        var bankData = (BankData)account;
                        bankTransactionDataList.Add(bankData, new List <BankTransactionData>());
                        object[] bankTransactions = bankData.bankTransactions;
                        if (bankTransactions == null || bankTransactions.Length == 0)
                        {
                            Log.Warn("Yodlee get bank data: No bank transactions");
                        }
                        else
                        {
                            foreach (object bankTransaction in bankTransactions)
                            {
                                var transactionData =
                                    (BankTransactionData)bankTransaction;
                                bankTransactionDataList[bankData].Add(transactionData);
                            }
                        }
                    }
                }
            }
            // Get AccountHistory

            if (itemData != null)
            {
                object[] acctHistories = itemData.accountHistory;
                if (acctHistories == null || acctHistories.Length == 0)
                {
                    //error += "\tNo Account History";
                }
                else
                {
                    foreach (object accountHistory in acctHistories)
                    {
                        var acctHistory = (AccountHistory)accountHistory;

                        Log.Debug(string.Format("\tHistory For Account ID: {0}", acctHistory.accountId));

                        // Get History
                        object[] histories = acctHistory.history;
                        if (histories == null || histories.Length == 0)
                        {
                            Log.Warn("Yodlee get bank data: No History");
                        }
                        else
                        {
                            foreach (object history in histories)
                            {
                                var bankData = (BankData)history;
                                Log.Debug(
                                    string.Format(
                                        "Account History: Bank Account Name: {0}, Bank Account Cust Description: {1} Bank Account Identifier: {2} Bank Account Balance: {3} Bank Current Balance: {4} Bank Current Acct Type: {5} Bank Current As of Date: {6} Last Updated: {7}",
                                        bankData.accountName, bankData.customDescription, bankData.bankAccountId, bankData.availableBalance.amount,
                                        bankData.currentBalance.amount, bankData.acctType, bankData.asOfDate.date,
                                        UtcToDateTime(bankData.lastUpdated.HasValue ? bankData.lastUpdated.Value : 0)));
                            }
                        }
                    }
                }
            }

            if (!string.IsNullOrEmpty(error))
            {
                Log.Warn(error);
            }
        }