/// <summary> /// Method updates product status for "saled", because the Deal is done /// </summary> /// <param name="product"></param> /// <param name="id"></param> public static void Deal(IRepository<Product> product, int id) { Console.WriteLine("Consratulations! You have bought the product {0} on address {1}", product.GetItem(id).name, product.GetItem(id).address); Product saledProduct = new Product(id, product.GetItem(id).name, product.GetItem(id).address, "saled"); product.Update(saledProduct); }
/// <summary> /// Method choses manager for user (at random. All the managers want to earn more money) /// </summary> /// <param name="manager"></param> public static void ChooseManager(IRepository<Manager> manager) { Random rand = new Random(); Console.WriteLine("Your manager will be {0}", manager.GetItem(rand.Next(1, 10)).name); }