private void BtnQLSP_Click(object sender, EventArgs e)
        {
            this.Hide();
            QuanLySanPham sp = new QuanLySanPham();

            sp.ShowDialog();
            this.Close();
        }
Exemplo n.º 2
0
        private void BtnThanhToan_Click(object sender, EventArgs e)
        {
            conn.Open();
            DateTime now = DateTime.Now;

            foreach (ListViewItem item in lvGioHang.Items)
            {
                string     sqlTT = @"insert into ChiTietDonHang(MaKH,MaHH,TenHH,SoLuong,TongTien,NgayMua) values('" + txtMaKH.Text + "','" + txtMaSP.Text + "','" + item.Text + "','" + txtSoLuong.Text + "','" + Tong.ToString() + "','" + now.ToShortDateString() + "')";
                SqlCommand cmd   = new SqlCommand(sqlTT, conn);
                cmd.ExecuteNonQuery();
            }

            MessageBox.Show("Cảm ơn bạn đã thanh toán", "Cảm ơn", MessageBoxButtons.OK);
            conn.Close();
            this.Hide();
            QuanLySanPham gd = new QuanLySanPham();

            gd.ShowDialog();
            this.Close();
        }