Example #1
0
        /// <summary>
        /// Prints the symbols.
        /// </summary>
        public void PrintSymbols()
        {
            StackCommercial symbolStack = FileOperation.ReadStockSymbols();

            Console.WriteLine("Your Currently purchased Symbols are ");

            while (!symbolStack.IsEmpty())
            {
                Console.Write(symbolStack.PopFromStack() + " ");
            }
        }
Example #2
0
        /// <summary>
        /// Writes the symbol.
        /// </summary>
        /// <param name="symbolStack">The symbol stack.</param>
        public static void WriteSymbol(StackCommercial symbolStack)
        {
            List <string> symbolList = new List <string>();

            while (!symbolStack.IsEmpty())
            {
                symbolList.Add(symbolStack.PopFromStack());
            }

            string jsonData = JsonConvert.SerializeObject(symbolList);

            System.IO.File.WriteAllText(@"C:\Users\admin\source\repos\Object Orienetd Programming\Object Orienetd Programming\CommercialDataProcessing\SymbolPurchased.txt", jsonData);
        }
Example #3
0
        /// <summary>
        /// Reads the stock symbols.
        /// </summary>
        /// <returns>returns Stack</returns>
        public static StackCommercial ReadStockSymbols()
        {
            StackCommercial symbolStack = new StackCommercial();

            symbolStack.StackCommercial1(1000);

            ////Getting List Of StocksList
            List <SharesOfCompany> stocksList = ReadFromFile();

            //// Pushing all StockSymbol in Custom Stack.
            foreach (SharesOfCompany companyShares in stocksList)
            {
                symbolStack.PushIntoStack(companyShares.Symbol);
            }

            return(symbolStack);
        }