Пример #1
0
        public static void Add(Person obj)
        {
            Workplace place = Workplace.Instance;

            obj = new Worker(obj.Name, obj.Surname, ++place.Count);
            place.list.Add(obj);
        }
Пример #2
0
        public static void Show()
        {
            Workplace place = Workplace.Instance;

            foreach (Person p in place.list)
            {
                Console.Write(string.Format("{0}. {1} {2} : ", p.Id, p.Name, p.Surname));
                p.Work();
            }
        }
Пример #3
0
        public static void Main(string[] args)
        {
            Person p = new Person("Bogdan", "Oros");
            Person a = new Person("Boris", "Topchiev");

            Workplace.Add(p);
            Workplace.Add(a);
            Workplace.Show();
            Console.WriteLine();
            Workplace.Preferment(1);
            Workplace.Show();
        }
Пример #4
0
 static Workplace()
 {
     workplace = new Workplace ();
 }
Пример #5
0
 static Workplace()
 {
     workplace = new Workplace();
 }
Пример #6
0
        public static void Preferment(int index)
        {
            Workplace place = Workplace.Instance;

            place.list [index - 1] = new Cashier(place.list[index - 1]);
        }