public void Chuyen() { CHUYENKHO chuyenKho = new CHUYENKHO(); chuyenKho.KhoDiID = TonKho.KhoID; chuyenKho.KhoDenID = KhoDenID; chuyenKho.NhanVienID = NhanVienID; chuyenKho.NgayChuyen = DateTime.Now; chuyenKho.Visual = true; chuyenKho.Deleted = false; CHITIETCHUYENKHO chieiet = new CHITIETCHUYENKHO(); chieiet.MonID = TonKho.MonID; chieiet.NgaySanXuat = TonKho.NgaySanXuat; chieiet.NgayHetHan = TonKho.NgayHetHan; chieiet.SoLuongChuyen = SoLuong; chieiet.GiaNhap = TonKho.GiaNhap; chieiet.GiaBan = TonKho.GiaBan; chuyenKho.CHITIETCHUYENKHOes.Add(chieiet); BOTonKho.ChuyenKhoTong(mKaraokeEntities, TonKho, KhoDenID, SoLuong); mKaraokeEntities.CHUYENKHOes.AddObject(chuyenKho); BOLichSuTonKho.ChuyenKho(mKaraokeEntities, this); mKaraokeEntities.SaveChanges(); }
public void LuuNhapKho() { foreach (var item in ListChiTietNhapKho) { NhapKho.CHITIETNHAPKHOes.Add(item.ChiTietNhapKho); NhapKho.TongTien += item.ChiTietNhapKho.GiaNhap; BOLichSuTonKho.NhapKho(mKaraokeEntities, item, this); BOTonKho.NhapKhoTong(mKaraokeEntities, item, this); } mKaraokeEntities.NHAPKHOes.AddObject(NhapKho); mKaraokeEntities.SaveChanges(); }
public int TinhTien() { if (this.BANHANG.TrangThaiID == 1 || this.BANHANG.TrangThaiID == 2) { this.BANHANG.TrangThaiID = 4; //this.BANHANG.NgayBan = DateTime.Now; this.BANHANG.NgayKetThuc = DateTime.Now; BOTonKho.BanHang(mKaraokeEntities, this); BOLichSuTonKho.BanHang(mKaraokeEntities, this); mKaraokeEntities.SaveChanges(); return(this.BANHANG.BanHangID); } return(0); }