public static void Add(Person obj) { Workplace place = Workplace.Instance; obj = new Worker(obj.Name, obj.Surname, ++place.Count); place.list.Add(obj); }
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(); } }
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(); }
static Workplace() { workplace = new Workplace (); }
static Workplace() { workplace = new Workplace(); }
public static void Preferment(int index) { Workplace place = Workplace.Instance; place.list [index - 1] = new Cashier(place.list[index - 1]); }