Supermarket cashier System

Source: Internet
Author: User
Tags acer
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>///&LT;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;
 }


    }
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.