public BOBanHang(Transit tran,KaraokeEntities kara) { mTransit = tran; mKaraokeEntities = kara; _CAIDATBANHANG = mKaraokeEntities.CAIDATBANHANGs.FirstOrDefault(); if (_CAIDATBANHANG==null) { _CAIDATBANHANG = new CAIDATBANHANG(); } _ListChiTietBanHang = new List<BOChiTietBanHang>(); mListChiTietBanHangDeleted = new List<BOChiTietBanHang>(); //LoadBanHang(); }
public Transit() { StringButton = new ClassStringButton(); MenuGiaoDien = new Data.MenuGiaoDien(); HashMD5 = "KTr"; DuongDanHinh = "c:\\"; Admin = new NHANVIEN(); Admin.NhanVienID = 0; Admin.LoaiNhanVienID = (int)Data.EnumLoaiNhanVien.Admin; Admin.CapDo = -1; Admin.TenNhanVien = "Admin"; Admin.TenDangNhap = "0000"; Admin.MatKhau = Utilities.SecurityKaraoke.GetMd5Hash("0000", HashMD5); KhoID = 1; MayID = 1; KaraokeEntities = new KaraokeEntities(); KaraokeEntities.ContextOptions.LazyLoadingEnabled = false; ThamSo = KaraokeEntities.THAMSOes.Where(o => o.SoMay == 1).FirstOrDefault(); ListDonVi = BODonVi.GetAll(this).ToList(); BOChiTietQuyen = new BOChiTietQuyen(this); CaiDatBanHang = KaraokeEntities.CAIDATBANHANGs.FirstOrDefault(); if (CaiDatBanHang == null) { CaiDatBanHang = new CAIDATBANHANG(); } //================== //var nhom = KaraokeEntities.CHUCNANGs.ToList(); //foreach (var item in nhom) //{ // KaraokeEntities.Attach(item); // KaraokeEntities.DeleteObject(item); //} //var list = KaraokeEntities.NHOMCHUCNANGs.ToList(); //foreach (var item in list) //{ // KaraokeEntities.Attach(item); // KaraokeEntities.DeleteObject(item); //} //KaraokeEntities.SaveChanges(); //new BONhomChucNang(this); }
/// <summary> /// Create a new CAIDATBANHANG object. /// </summary> /// <param name="id">Initial value of the ID property.</param> /// <param name="phiDichVu">Initial value of the PhiDichVu property.</param> /// <param name="choPhepPhiDichVu">Initial value of the ChoPhepPhiDichVu property.</param> /// <param name="thueVAT">Initial value of the ThueVAT property.</param> /// <param name="choPhepThueVAT">Initial value of the ChoPhepThueVAT property.</param> /// <param name="soPhutToiThieu">Initial value of the SoPhutToiThieu property.</param> /// <param name="khoaSoDoBan">Initial value of the KhoaSoDoBan property.</param> public static CAIDATBANHANG CreateCAIDATBANHANG(global::System.Int32 id, global::System.Int32 phiDichVu, global::System.Boolean choPhepPhiDichVu, global::System.Int32 thueVAT, global::System.Boolean choPhepThueVAT, global::System.Int32 soPhutToiThieu, global::System.Boolean khoaSoDoBan) { CAIDATBANHANG cAIDATBANHANG = new CAIDATBANHANG(); cAIDATBANHANG.ID = id; cAIDATBANHANG.PhiDichVu = phiDichVu; cAIDATBANHANG.ChoPhepPhiDichVu = choPhepPhiDichVu; cAIDATBANHANG.ThueVAT = thueVAT; cAIDATBANHANG.ChoPhepThueVAT = choPhepThueVAT; cAIDATBANHANG.SoPhutToiThieu = soPhutToiThieu; cAIDATBANHANG.KhoaSoDoBan = khoaSoDoBan; return cAIDATBANHANG; }
/// <summary> /// Deprecated Method for adding a new object to the CAIDATBANHANGs EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToCAIDATBANHANGs(CAIDATBANHANG cAIDATBANHANG) { base.AddObject("CAIDATBANHANGs", cAIDATBANHANG); }