List <Producto> getAllProducts() { List <Producto> list = new List <Producto>(); Random rand = new Random(); for (int i = 1; i <= 10; i++) { sells ventas = new sells(); ventas.q1 = rand.Next(0, 100); ventas.q2 = rand.Next(0, 100); ventas.q3 = rand.Next(0, 100); string mes = rand.Next(10, 12).ToString(); string dia = rand.Next(10, 31).ToString(); string code = rand.Next(1000, 9999).ToString(); string itemid = String.Concat("2015", mes, dia, code); Producto prod = new Producto("producto " + i, itemid, ventas); list.Add(prod); } return(list); }
public Producto(string pname, string pnoInv, sells pventas) { this.name = pname; this.itemID = pnoInv; this.ventas = pventas; }