public BOChiTietBanHang(CHITIETBANHANG chiTiet, Transit transit)
 {
     _ListKhuyenMai = new List<BOChiTietBanHang>();
     ChiTietBanHang = chiTiet;
     MenuKichThuocMon = ChiTietBanHang.MENUKICHTHUOCMON;
     MenuMon = ChiTietBanHang.MENUKICHTHUOCMON.MENUMON;
     mTransit = transit;
     SoLuongBanTam = (int)ChiTietBanHang.SoLuongBan;            
 }
 public static int CapNhat(CHITIETBANHANG item, Transit mTransit)
 {
     CHITIETBANHANG m = (from x in mTransit.KaraokeEntities.CHITIETBANHANGs where x.ChiTietBanHangID == item.ChiTietBanHangID select x).First();
     m.BanHangID = item.BanHangID;            
     m.SoLuongBan = item.SoLuongBan;
     m.GiaBan = item.GiaBan;
     m.ThanhTien = item.ThanhTien;
     m.KichThuocMonID = item.KichThuocMonID;
     m.NhanVienID = item.NhanVienID;
     mTransit.KaraokeEntities.SaveChanges();
     return item.ChiTietBanHangID;
 }
 public static IQueryable<BOChiTietBanHang> QueryKhuyenMai(CHITIETBANHANG chitietbh, KaraokeEntities kara)
 {
     var iQuery =
         //from chitiet in banhang.CHITIETBANHANGs.Where(o=>o.ChiTietBanHangID_Ref==null)
         from chitiet in kara.CHITIETBANHANGs.Where(o => o.ChiTietBanHangID_Ref==chitietbh.ChiTietBanHangID)
         join kichthuoc in kara.MENUKICHTHUOCMONs on chitiet.KichThuocMonID equals kichthuoc.KichThuocMonID
         join menu in kara.MENUMONs on kichthuoc.MonID equals menu.MonID
         select new BOChiTietBanHang
         {
             MenuKichThuocMon = kichthuoc,
             ChiTietBanHang = chitiet,
             MenuMon = menu
         };
     return iQuery;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the CHITIETBANHANGs EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToCHITIETBANHANGs(CHITIETBANHANG cHITIETBANHANG)
 {
     base.AddObject("CHITIETBANHANGs", cHITIETBANHANG);
 }
 /// <summary>
 /// Create a new CHITIETBANHANG object.
 /// </summary>
 /// <param name="chiTietBanHangID">Initial value of the ChiTietBanHangID property.</param>
 /// <param name="soLuongBan">Initial value of the SoLuongBan property.</param>
 /// <param name="kichThuocLoaiBan">Initial value of the KichThuocLoaiBan property.</param>
 /// <param name="giamGia">Initial value of the GiamGia property.</param>
 /// <param name="giaBan">Initial value of the GiaBan property.</param>
 /// <param name="thanhTien">Initial value of the ThanhTien property.</param>
 /// <param name="loaiChiTietBanHang">Initial value of the LoaiChiTietBanHang property.</param>
 public static CHITIETBANHANG CreateCHITIETBANHANG(global::System.Int32 chiTietBanHangID, global::System.Int32 soLuongBan, global::System.Int32 kichThuocLoaiBan, global::System.Int32 giamGia, global::System.Decimal giaBan, global::System.Decimal thanhTien, global::System.Int32 loaiChiTietBanHang)
 {
     CHITIETBANHANG cHITIETBANHANG = new CHITIETBANHANG();
     cHITIETBANHANG.ChiTietBanHangID = chiTietBanHangID;
     cHITIETBANHANG.SoLuongBan = soLuongBan;
     cHITIETBANHANG.KichThuocLoaiBan = kichThuocLoaiBan;
     cHITIETBANHANG.GiamGia = giamGia;
     cHITIETBANHANG.GiaBan = giaBan;
     cHITIETBANHANG.ThanhTien = thanhTien;
     cHITIETBANHANG.LoaiChiTietBanHang = loaiChiTietBanHang;
     return cHITIETBANHANG;
 }