示例#1
0
 public HoaDon()
 {
     MaHD      = 0;
     NV        = new NhanVien();
     KH        = new KhachHang();
     NgayLap   = DateTime.Now;
     ThanhToan = 0;
     TrangThai = 1;
     ChiTiet   = new ChiTietHD();
 }
示例#2
0
        public HoaDon(int mahd)
        {
            MaHD = mahd;
            if (mahd == 0)
            {
                NV        = new NhanVien();
                KH        = new KhachHang();
                NgayLap   = DateTime.Now;
                ThanhToan = 0;
                TrangThai = 1;
                ChiTiet   = new ChiTietHD();
                return;
            }
            DataTable dt = HoaDonControl.layDuLieu(mahd);

            NV        = new NhanVien(Convert.ToInt32(dt.Rows[0]["MaNV"].ToString()));
            KH        = new KhachHang(Convert.ToInt32(dt.Rows[0]["MaKH"].ToString()));
            NgayLap   = DateTime.Parse(dt.Rows[0]["NgayLap"].ToString());
            ThanhToan = double.Parse(dt.Rows[0]["ThanhToan"].ToString());
            TrangThai = Convert.ToInt32(dt.Rows[0]["TrangThai"].ToString());
            ChiTiet   = new ChiTietHD(mahd);
        }