Exemple #1
0
        /// <summary>
        /// Split lines into better strings to use and adds them to the currDay
        /// </summary>
        /// <param name="line"></param>
        private void SplitAndAddLoadedEntry(string line)
        {
            if (line != null)
            {
                string[] splittedLine = line.Split(';');

                foreach (Product p in Products)
                {
                    if (Convert.ToString(p.Id) == splittedLine[0])
                    {
                        Entry e = new Entry(p, Convert.ToInt32(splittedLine[1]), Convert.ToInt32(splittedLine[2]), Convert.ToInt32(splittedLine[1]) * p.Price);
                        CurrWeek.GetCurrentDayAndAddEntry(e);
                        break;
                    }
                }
            }
        }
        //Splits the Line which is loaded from the week files
        private void SplitLoadedEntry(string line)
        {
            if (line != null)
            {
                string[] splittedLine = line.Split(';');

                foreach (Product p in products)
                {
                    if (Convert.ToString(p.ID) == splittedLine[0])
                    {
                        //DBG  MessageBox.Show(p.Id + " | " + (splittedLine[1]) + " | " + (splittedLine[2]) + " | " + Convert.ToString(Convert.ToInt32(splittedLine[1]) * p.Price));
                        Entry e = new Entry(p, Convert.ToInt32(splittedLine[1]), Convert.ToInt32(splittedLine[2]), Convert.ToInt32(splittedLine[1]) * p.Price);
                        currWeek.GetCurrentDayAndAddEntry(e);
                        break;
                    }
                }
            }
        }