Пример #1
0
        static void Main(string[] args)
        {
            Angajati lista = new Angajati();

            lista.Vizualizare();
            Console.WriteLine();
            string   s = "Ion Vasile 2018.05.24";
            Persoana p = new Persoana(s);

            lista.Add(p);
            lista.Vizualizare();
            Console.WriteLine();

            lista.Remove(p);
            lista.Vizualizare();
            Console.WriteLine();

            lista.SortName();
            lista.AfisareFisier(@"..\..\TextFile2.txt");

            lista.SortDate();
            s = DateTime.Today.ToString();
            string[] local = s.Split('.');
            string   S     = local[2].Split(' ')[0] + "." + local[1] + "." + local[0];
            Data     d     = new Data(S);

            lista.AfisareFisier(@"..\..\TextFile3.txt", d);

            Console.WriteLine(lista[0]);
            Console.ReadKey();
        }
Пример #2
0
 public void SortDate()
 {
     for (int j = 1; j < angajati.Count; j++)
     {
         for (int i = j; i > 0; i--)
         {
             if (angajati[i].data < angajati[i - 1].data)
             {
                 Persoana aux = angajati[i];
                 angajati[i]     = angajati[i - 1];
                 angajati[i - 1] = aux;
             }
         }
     }
 }
Пример #3
0
 public void Remove(Persoana p)
 {
     angajati.Remove(p);
 }
Пример #4
0
 public void Add(Persoana p)
 {
     angajati.Add(p);
 }