public class wage { public string id {get;set;} public string name {get;set;} public IWageType type {get; private set;} public void SetType(int id) { if(type.Id!=id} { if (id==1) type=new salary(); else type=new hourywage(); } } } public interface IWageType { int id {get;} }
public class salary:IwageType { public int Id { get;} public double Amount {get;set;} } public class Hourlywage :IWageType { public int Id {get;} public double Multiplier {get;set;} public double Rate {get;set;} }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)