Using System;
Using System.Collections.Generic;
Using System.Linq;
Using System.Text;
Using System.Threading.Tasks; Namespace _16 Supermarket cashier system {class Cangku {list<list<productfather>> List = new List<list<pro
Ductfather>> (); <summary>///Show Users the goods///</summary> public void Showpros () {f Oreach (var item in list)//item is list<> shelf, item[0] is the inside productfather,0 is key, after the period is Value,key will automatically traverse through foreach, traversal, Item[0], automatically traverses from zero to the final index {Console.WriteLine ("Our supermarket has:" + item[0]. Name + "," + "T" + "have" + item. Count + "," + "T" + "each" + item[0]. Price + "meta");//Display all properties of item[0]}//list[0] store acer computer//LIST[1] store Samsung mobile phone//list[2] Save
Storage of soy sauce//list[3] Store Banana///<summary>///when creating a warehouse object, like adding a shelf to a warehouse///</summary> Public Cangku () {list.
ADD (New list<productfather> ()); List.
ADD (New list<productfather> ()); List.
ADD (New list<productfather> ()); List.
ADD (New list<productfather> ()); ///<summary>///incoming///</summary>///<param name= "strtype" > Types of Goods ;/param>///<param name= "Count" > Quantity of Goods </param> public void Jinpros (string strtype, int coun
T)//The inbound of the sequential table {for (int i = 0; i < count; i++) {switch (strtype) {case "Acer": list[0]. ADD (New Acer (GUID.NEWGUID).
ToString (), 1000, "Acer Notebook"));
Break Case "SamSung": list[1]. ADD (New SamSung (GUID.NEWGUID).
ToString (), 2000, "Stick Cell phone");
Break Case "Jiangyou": list[2]. ADD (New Jiangyou (GUID.NEWGUID).
ToString (), 10, "old soy Sauce"));
Break Case "Banana": list[3]. ADD (New Banana (GUID.NEwguid ().
ToString (), 50, "Big Banana"));
Break ///<summary>///extract goods from warehouse///</summary>///<PA Ram Name= "Strtype" ></param>///<param name= "Count" ></param>///<returns></ Returns> public productfather[] Qupros (string strtype, int count) {productfather[] pros =
New Productfather[count]; for (int i = 0; i < Pros. Length;
i++) {switch (strtype) {case "Acer": Pros[i] = list[0][0];//takes the first of the corresponding shelves, the outbound list[0 of the sequential table].
RemoveAt (0);
Break
Case "SamSung": pros[i] = list[1][0]; LIST[1].
RemoveAt (0);
Break
Case "Jiangyou": pros[i] = list[2][0]; LIST[2]. RemoveAt (0);
Break
Case "Banana": pros[i] = list[3][0]; LIST[3].
RemoveAt (0);
Break
} return pros;
}
}
}