Ejemplo n.º 1
0
        public static void PopulateTable(string parentFileLine, string childFileLine)
        {
            string[] data  = childFileLine.Split('|');
            var      table = new TablePopulation();

            PopulateTable(parentFileLine);
            ((MainWindow)Application.Current.MainWindow).childCompanyName.Text = data[4];
            ((MainWindow)Application.Current.MainWindow).childTicker.Text      = data[2];
            ((MainWindow)Application.Current.MainWindow).childTSO.Text         = data[9];
            ((MainWindow)Application.Current.MainWindow).childFloat.Text       = $"{(1 - MainWindow.ConvertToDouble(data[11]))}";
            ((MainWindow)Application.Current.MainWindow).childSize.Text        = DetermineSize(data);
            ((MainWindow)Application.Current.MainWindow).childGrowth.Text      = data[15];
            ((MainWindow)Application.Current.MainWindow).childDynamic.Text     = "";
            if (data[22] == "Y")
            {
                ((MainWindow)Application.Current.MainWindow).childSP5.IsChecked = true;
            }
            else
            {
                ((MainWindow)Application.Current.MainWindow).childSP5.IsChecked = false;
            }
        }
Ejemplo n.º 2
0
        public static void PopulateTable(string parentFileLine, string childFileLine)
        {
            string[] data  = childFileLine.Split('|');
            var      table = new TablePopulation();

            PopulateTable(parentFileLine);

            ((MainWindow)Application.Current.MainWindow).childCompanyName.Text = data[4];
            ((MainWindow)Application.Current.MainWindow).childTicker.Text      = data[2];
            ((MainWindow)Application.Current.MainWindow).childTSO.Text         = data[9];
            ((MainWindow)Application.Current.MainWindow).childFloat.Text       = $"{(1 - (Convert.ToDouble(data[11])))}";
            ((MainWindow)Application.Current.MainWindow).childSize.Text        = DetermineSize(data);
            ((MainWindow)Application.Current.MainWindow).childGrowth.Text      = data[15];
            ((MainWindow)Application.Current.MainWindow).childDynamic.Text     = "";

            //get Child company name and suffix
            string[] cName   = data[4].Split(' ');
            string   cSuffix = cName[cName.Length - 1];

            //check if cSuffix is been contained in the original company. if so, it will be the last item in the cName array, else the suffix dosen't exists.
            if ((cSuffix == "CORP") || (cSuffix == "INC") || (cSuffix == "CO") || (cSuffix == "LTD") || (cSuffix == "IN"))
            {
                string printName = "";
                for (int i = 0; i < (cName.Length - 1); i++)
                {
                    printName = printName + UppercaseFirst(cName[i]) + " ";
                }
                cSuffix = UppercaseFirst(cSuffix);
                ((MainWindow)Application.Current.MainWindow).childCompanyName.Text = printName.Trim();
                ((MainWindow)Application.Current.MainWindow).childNameSuffix.Text  = cSuffix;
            }
            else
            {
                ((MainWindow)Application.Current.MainWindow).childCompanyName.Text = data[4].Trim();
                MessageBox.Show("Please Enter the Suffix for the parent Company");
            }    // End of getting child company and suffix



            //Check the exchange of the parent constituents
            if (data[5] == "V")

            {
                ((MainWindow)Application.Current.MainWindow).ChildExchange.Text = "NASDAQ";
            }

            else if (data[5] == "B")

            {
                ((MainWindow)Application.Current.MainWindow).ChildExchange.Text = "NYSE American";
            }

            else if (data[5] == "A")

            {
                ((MainWindow)Application.Current.MainWindow).ChildExchange.Text = "NYSE";
            }

            else if (data[5] == "NCBO")
            {
                ((MainWindow)Application.Current.MainWindow).ChildExchange.Text = "CBOE";
            }
            // End of getting the exchange of parent
            ////////////



            if (data[22] == "Y")    //child RSCC check
            {
                ((MainWindow)Application.Current.MainWindow).childSP5.IsChecked = true;
            }
            else
            {
                ((MainWindow)Application.Current.MainWindow).childSP5.IsChecked = false;
            }     //end Child RSCC check


            //check Child R3
            if (data[24] == "Y")
            {
                ((MainWindow)Application.Current.MainWindow).ChildR3.IsChecked = true;
            }    //end of Child R3 check
        }