public Product(string name, double quantity, double unitPrice, ProductType type) { this.name = name; this.id = IDGENERATOR.generator(); this.quantity = quantity; this.unitPrice = unitPrice; this.type = type; }
static void Main(string[] args) { ProductType ob1 = new ProductType(); ob1.typeDescription = "This is soap"; ob1.typeName = "Universal"; Product ob2 = new Product("Lux", 10.0, 38.0, ob1); Console.WriteLine("After Buying:\n\n"); ob2.buy(5); ob2.print_Product(); Console.WriteLine("After Selling : \n\n"); ob2.sell(5); ob2.print_Product(); }