public void Visit(Oge oge) { Calisan calisan = oge as Calisan; calisan.TatilGunu += 3; Console.WriteLine("{0} -> {1} --> {2} gun tatil", calisan.GetType().Name, calisan.Ad, calisan.TatilGunu); }
public void Visit(Oge oge) { Calisan calisan = oge as Calisan; calisan.Gelir *= 1.10; Console.WriteLine("{0} -> {1} --> {2:C}", calisan.GetType().Name, calisan.Ad, calisan.Gelir); }
static void Main(string[] args) { Manager eray = new Manager { Name = "Eray", Salary = 1000 }; Manager hakan = new Manager { Name = "Hakan", Salary = 1100 }; Calisan semih = new Calisan { Name = "Semih", Salary = 800 }; Calisan mustafa = new Calisan { Name = "Mustafa", Salary = 800 }; eray.employeeBases.Add(hakan); hakan.employeeBases.Add(semih); hakan.employeeBases.Add(mustafa); OrganisationalStructure organisational = new OrganisationalStructure(eray); PayrollVisitor payrollVisitor = new PayrollVisitor(); Payrise payriseVisitor = new Payrise(); organisational.Accept(payrollVisitor); organisational.Accept(payriseVisitor); Console.ReadLine(); }
public void Cikar(Calisan calisan) { _calisanlar.Remove(calisan); }
public void Ac(Calisan calisan) { _calisanlar.Add(calisan); }
public abstract void Visit(Calisan calisan);
public override void Visit(Calisan calisan) { Console.WriteLine("{0} Yeni Maaşınız {1}", calisan.Name, calisan.Salary * (decimal)1.1); }
public override void Visit(Calisan calisan) { Console.WriteLine("{0} Maaş : {1}", calisan.Name, calisan.Salary); }