public void Themgiaohang(DTOHoaDonBH dto)
 {
     DAO_Entity dao = new DAO_Entity();
     dao.ThemPhieuGiaoHang(dto);
 }
        public bool ThemPhieuGiaoHang(DTOHoaDonBH dto)
        {
            bool ketqua = false;
            ketnoi.TaoKetNoi();
            try
            {
                string lenh = "insert into HDBH(MaHDBH, MaKH, NgayHDBH, TongTien) values (@mahd, @makh, @ngaytt, @st)";
                ketnoi.LenhKetNoi = new SqlCommand(lenh, ketnoi.KetNoi);

                ketnoi.LenhKetNoi.Parameters.Add("@mahd", SqlDbType.VarChar);
                ketnoi.LenhKetNoi.Parameters.Add("@makh", SqlDbType.Int);
                ketnoi.LenhKetNoi.Parameters.Add("@ngaytt", SqlDbType.DateTime);
                ketnoi.LenhKetNoi.Parameters.Add("@st", SqlDbType.Decimal);

                ketnoi.LenhKetNoi.Parameters["@mahd"].Value = dto.MaHDBH;
                ketnoi.LenhKetNoi.Parameters["@makh"].Value = dto.MaKH;
                ketnoi.LenhKetNoi.Parameters["@ngaytt"].Value = dto.NgayHDBH;
                ketnoi.LenhKetNoi.Parameters["@st"].Value = dto.TongTien;

                if (ketnoi.LenhKetNoi.ExecuteNonQuery() != 0)
                    ketqua = true;
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                ketnoi.DongKetNoi();
            }
            return ketqua;
        }