コード例 #1
0
 public BOXuliTinhTien(Transit transit, BOBanHang banhang)
 {
     mTransit = transit;
     mBanHang = new BANHANG();
     Copy(banhang.BANHANG, mBanHang);
     mBanHang.TongTien = banhang.TongTien();
 }
コード例 #2
0
        public static IQueryable <BOChiTietBanHang> Query(BANHANG banhang, 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 == null && o.BanHangID == banhang.BanHangID)
                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);
        }
コード例 #3
0
        public void LoadBanHang(BAN ban)
        {
            BAN = ban;
            BOBanHang bh = null;

            if (ban != null)
            {
                bh = GetAllBanHang(ban).FirstOrDefault();
            }
            if (bh != null)
            {
                BANHANG   = bh.BANHANG;
                KHACHHANG = bh.KHACHHANG;
                LoadChiTiet();
                ReloadGioKaraoke();
            }
            else
            {
                BANHANG            = new BANHANG();
                BANHANG.NhanVienID = mTransit.NhanVien.NhanVienID;
                if (BANHANG.NhanVienID == 0)
                {
                    BANHANG.NhanVienID = null;
                }
                if (ban != null)
                {
                    BANHANG.BanID = ban.BanID;
                }
                BANHANG.NgayBan     = BANHANG.NgayKetThuc = DateTime.Now;
                BANHANG.MaHoaDon    = String.Format("HD-{0:00}-{1:000000}", mTransit.ThamSo.SoMay, mTransit.ThamSo.ThuTuMaHoaDon);
                BANHANG.TrangThaiID = 1;
                if (_CAIDATBANHANG.ChoPhepPhiDichVu)
                {
                    BANHANG.PhiDichVu = _CAIDATBANHANG.PhiDichVu;
                }
                if (_CAIDATBANHANG.ChoPhepThueVAT)
                {
                    BANHANG.ThueVAT = _CAIDATBANHANG.ThueVAT;
                }
            }
        }
コード例 #4
0
 public void Copy(BANHANG bhFrom, BANHANG bhTo)
 {
     bhTo.BanHangID    = bhFrom.BanHangID;
     bhTo.NhanVienID   = bhFrom.NhanVienID;
     bhTo.BanID        = bhFrom.BanID;
     bhTo.TrangThaiID  = bhFrom.TrangThaiID;
     bhTo.NgayBan      = bhFrom.NgayBan;
     bhTo.MaHoaDon     = bhFrom.MaHoaDon;
     bhTo.TheID        = bhFrom.TheID;
     bhTo.KhachHangID  = bhFrom.KhachHangID;
     bhTo.GiamGia      = bhFrom.GiamGia;
     bhTo.PhiDichVu    = bhFrom.PhiDichVu;
     bhTo.ThueVAT      = bhFrom.ThueVAT;
     bhTo.TienMat      = bhFrom.TienMat;
     bhTo.TienThe      = bhFrom.TienThe;
     bhTo.TienTraLai   = bhFrom.TienTraLai;
     bhTo.ChietKhau    = bhFrom.ChietKhau;
     bhTo.TienBo       = bhFrom.TienBo;
     bhTo.TongTien     = bhFrom.TongTien;
     bhTo.TienKhacHang = bhFrom.TienKhacHang;
 }