Ejemplo n.º 1
0
 public void XuliGopBan()
 {
     int banHang = this.BanHang.BANHANG.BanHangID;
     this.BanHang.GopBan(this);
     GOPBAN gopban = new GOPBAN();            
     gopban.BanHangID = this.BanHang.BANHANG.BanHangID;
     gopban.NhanVienID = mTransit.NhanVien.NhanVienID;
     gopban.ThoiGian = DateTime.Now;                                    
     foreach (var item in _ListBan)
     {
         CHITIETGOPBAN chitiet = new CHITIETGOPBAN();                                
         chitiet.BanHangID = item.BANHANG.BanHangID;
         gopban.CHITIETGOPBANs.Add(chitiet);                
     }
     if (banHang>0)
     {
         CHITIETGOPBAN chitiet = new CHITIETGOPBAN();                
         chitiet.BanHangID = banHang;                
         gopban.CHITIETGOPBANs.Add(chitiet);                
     }
     mKaraokeEntities.GOPBANs.AddObject(gopban);
     mKaraokeEntities.SaveChanges();
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the GOPBANs EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToGOPBANs(GOPBAN gOPBAN)
 {
     base.AddObject("GOPBANs", gOPBAN);
 }
 /// <summary>
 /// Create a new GOPBAN object.
 /// </summary>
 /// <param name="gopBanID">Initial value of the GopBanID property.</param>
 public static GOPBAN CreateGOPBAN(global::System.Int32 gopBanID)
 {
     GOPBAN gOPBAN = new GOPBAN();
     gOPBAN.GopBanID = gopBanID;
     return gOPBAN;
 }