コード例 #1
0
        public void loadListOrder2()
        {
            try
            {
                flowLayoutPanel1.Controls.Clear();
                bool colorFlag;
                for (int i = 0; i < lstCT.Count; i++)
                {
                    colorFlag = true;
                    DoUongGioHang_Item item;
                    item      = new DoUongGioHang_Item(lstCT[i].tblThucDon.TenMon, lstCT[i].SoLuong, double.Parse(lstCT[i].tblThucDon.DonGia), colorFlag, lstCT[i].MaMon);
                    item.Dock = DockStyle.Top;
                    flowLayoutPanel1.Controls.Add(item);
                }
                double sum1 = (double)lstCT.Sum(t => t.TongTien);

                List <Item> lstCart = ca.getCart2();
                for (int i = 0; i < lstCart.Count; i++)
                {
                    colorFlag = false;
                    DoUongGioHang_Item item;
                    item      = new DoUongGioHang_Item(lstCart[i].tenMon, lstCart[i].sl, lstCart[i].donGia, colorFlag, lstCart[i].maMon);
                    item.Dock = DockStyle.Top;
                    flowLayoutPanel1.Controls.Add(item);
                }
                double sum2 = lstCart.Sum(t => t.tongTien);
                lblTongTien.Text = mc.convertCurrency((sum1 + sum2)) + "";
            }
            catch (Exception ee)
            { }
        }
コード例 #2
0
 public void loadListOrder()
 {
     try
     {
         flowLayoutPanel1.Controls.Clear();
         bool        colorFlag = false;
         List <Item> lstCart   = ca.getCart();
         for (int i = 0; i < lstCart.Count; i++)
         {
             DoUongGioHang_Item item;
             item      = new DoUongGioHang_Item(lstCart[i].tenMon, lstCart[i].sl, lstCart[i].donGia, colorFlag, lstCart[i].maMon);
             item.Dock = DockStyle.Top;
             flowLayoutPanel1.Controls.Add(item);
         }
         lblTongTien.Text = mc.convertCurrency(ca.tinhTong()) + "";
     }
     catch (Exception ee)
     { }
 }