Exemple #1
0
 public static void Dothings()
 {
     Console.WriteLine(GSM.CallSum());
     GSM.DeleteLongestCall();
     Console.WriteLine(GSM.CallSum());
     while (GSM.History.Count() > 0)
     {
         GSM.DeleteCalls(0);
     }
 }
        public static void DeleteLongestCall()
        {
            DateTime current         = new DateTime();
            DateTime max             = new DateTime();
            int      position        = 0;
            int      currentposition = 0;

            foreach (var item in GSM.History)
            {
                current = ToTime(item.Duration);
                if (current.TimeOfDay > max.TimeOfDay)
                {
                    max      = current;
                    position = currentposition;
                }
                currentposition++;
            }
            GSM.DeleteCalls(position);
        }