示例#1
0
        // Open Form Gio Hang


        private void guna2CircleButton3_Click(object sender, EventArgs e)
        {
            frm = new GioHangfrm();
            frm.LayDataFormMain(lbNV.Text);

            CheckFormIsOpen("GioHangfrm", frm);
        }
示例#2
0
        //add Shoping Cart

        private void gunaGradientButton2_Click(object sender, EventArgs e)
        {
            int    PriceG;
            string sL, tensp, masp, colorsp, sizesp;

            if (tbPrice.Text == "" || tbTen.Text.StartsWith(" ") || colorG == null || sizeG == null)
            {
                MessageBox.Show("Điền đầy đủ Thông tin");
            }
            else
            {
                if (cbListColor.Items.Count > 0 && cbListSize.Items.Count > 0)
                {
                    List <CartGioHang> newlistUser = new List <CartGioHang>();
                    List <GioHang>     newListGH   = new List <GioHang>();
                    PriceG  = int.Parse(tbPrice.Text);
                    sL      = tbSoLuong.Text;
                    tensp   = tbTen.Text;
                    masp    = maspG;
                    colorsp = colorG;
                    sizesp  = sizeG;
                    GioHang sp = new GioHang(masp, tensp, PriceG, sL, colorsp, sizesp);
                    newListGH.Add(sp);

                    if (DataSanPham.Them_GioHang(sp))
                    {
                        MessageBox.Show("Thêm Success,Kiểm tra Giỏ hàng");
                        if (frm == null)
                        {
                            frm = new GioHangfrm();
                        }
                        frm.HienThi(newlistUser, newListGH);
                    }
                    else
                    {
                        MessageBox.Show("Thêm Thất Bại");
                    }
                }
                else
                {
                    MessageBox.Show("Size và Color chưa có ");
                }
            }
        }