Exemple #1
0
        public UserPanel(Reapeted obj)
        {
            InitializeComponent();

            userlist(out GoodsName);

            items = new List <Goods>();


            constant = new int[100];


            for (int i = 0; i < GoodsName.Length; ++i)
            {
                string a, b, c;
                int    d, e;


                TGoods TGS;

                string temp = path;
                temp += GoodsName[i] + ".txt";

                StreamReader reader = new StreamReader(temp);

                a   = reader.ReadLine();
                d   = int.Parse(reader.ReadLine());
                e   = int.Parse(reader.ReadLine());
                b   = reader.ReadLine();
                c   = reader.ReadLine();
                TGS = (TGoods)Enum.Parse(typeof(TGoods), reader.ReadLine());

                reader.Close();

                items.Add(new Goods()
                {
                    Name = a, Price = d, ID = e, Pro1 = b, Pro2 = c, Type = TGS
                });
            }

            lvUsers.ItemsSource = items;



            if (obj is Student)
            {
                TOS  = (obj as Student);
                flag = Type.Student;
            }
            else if (obj is Teacher)
            {
                TOT  = (obj as Teacher);
                flag = Type.Teacher;
            }
            else
            {
                TOC  = (obj as Customer);
                flag = Type.Customer;
            }
        }
Exemple #2
0
        public PaymentPage(Reapeted obj)
        {
            InitializeComponent();

            Fitem = new List <Goods>();

            TypeOfCustomer = obj;
        }