예제 #1
0
        private void POSMain_ClickItem(object sender, EventArgs e)
        {
            item         itm1  = (sender as item);
            summaryitems items = new summaryitems();

            items.ItemName = itm1.FoodName.ToString();
            items.Price    = itm1.Price.ToString();
            items.Details  = itm1.Category;
            items.Width    = shopinglist.Width - 8;
            shopinglist.Controls.Add(items);

            //add items 0
            Total += double.Parse(itm1.Price.ToString());
            // total.Text = Total.ToString();
        }
예제 #2
0
        //add items to shopping list
        void LoadShopping()
        {
            shopinglist.Controls.Clear();
            summaryitems[] items = new summaryitems[4];
            for (int i = 0; i < items.Count(); i++)
            {
                items[i]       = new summaryitems();
                items[i].Width = shopinglist.Width - 1;
                items[i].Dock  = DockStyle.Top;

                // items[i].Location = new Point(shopinglist.Location.X -10 , shopinglist.Location.Y - 4);

                shopinglist.Controls.Add(items[i]);
            }
        }