public static IQueryable<BAOCAONGAYKHACHHANG> GetBaoCaoNgayKhachHang(KaraokeEntities kara,DateTime dtFrom, DateTime dtTo) { return from x in kara.BAOCAONGAYKHACHHANGs where dtFrom.CompareTo(x.NgayBan.Value) <= 0 && dtTo.CompareTo(x.NgayBan.Value) >= 0 orderby x.TenKhachHang select x; }
public static IQueryable <BAOCAONGAYTHE> GetBaoCaoThe(KaraokeEntities kara, DateTime dtFrom, DateTime dtTo) { return(from x in kara.BAOCAONGAYTHEs where dtFrom.CompareTo(x.NgayBan.Value) <= 0 && dtTo.CompareTo(x.NgayBan.Value) >= 0 orderby x.TenThe select x); }
public static IQueryable<BAOCAONGAYTHE> GetBaoCaoThe(KaraokeEntities kara,DateTime dtFrom, DateTime dtTo) { return from x in kara.BAOCAONGAYTHEs where dtFrom.CompareTo(x.NgayBan.Value) <= 0 && dtTo.CompareTo(x.NgayBan.Value) >= 0 orderby x.TenThe select x; }
public static IQueryable <BAOCAONGAYKHACHHANG> GetBaoCaoNgayKhachHang(KaraokeEntities kara, DateTime dtFrom, DateTime dtTo) { return(from x in kara.BAOCAONGAYKHACHHANGs where dtFrom.CompareTo(x.NgayBan.Value) <= 0 && dtTo.CompareTo(x.NgayBan.Value) >= 0 orderby x.TenKhachHang select x); }
public BOKhachHang(Data.Transit transit) { mTransit = transit; mKaraokeEntities = new KaraokeEntities(); frmKhachHang = new FrameworkRepository <KHACHHANG>(transit.KaraokeEntities, transit.KaraokeEntities.KHACHHANGs); frmLoaiKhachHang = new FrameworkRepository <LOAIKHACHHANG>(transit.KaraokeEntities, transit.KaraokeEntities.LOAIKHACHHANGs); }
public static IQueryable<MENULOAINHOM> GetAll(KaraokeEntities kara, int limit) { return (from x in kara.MENULOAINHOMs where x.Deleted == false && x.Visual == true orderby x.LoaiNhomID select x).Take(limit); }
public static IQueryable <TONKHO> GetTonKhoByMonID(KaraokeEntities kara, int?monID, int?khoID) { return(from a in kara.TONKHOes where a.SoLuongTon > 0 && a.MonID == monID && a.KhoID == khoID orderby a.NgayHetHan ascending select a); }
public static void ChuyenKhoTong(KaraokeEntities kara, TONKHO tonkho, int?khoDen, int soluong) { if (soluong <= tonkho.SoLuongTon) { tonkho.SoLuongTon -= soluong; TONKHO tonkhoDen = new TONKHO(); tonkhoDen.KhoID = khoDen; tonkhoDen.MonID = tonkho.MonID; tonkhoDen.LoaiBanID = tonkho.LoaiBanID; tonkhoDen.DonViID = tonkho.DonViID; tonkhoDen.DonViTinh = tonkho.DonViTinh; tonkhoDen.PhatSinhTuTonKhoID = tonkho.TonKhoID; tonkhoDen.SoLuongNhap = soluong; tonkhoDen.SoLuongTon = soluong; tonkhoDen.NgayNhap = tonkho.NgayNhap; tonkhoDen.NgaySanXuat = tonkho.NgaySanXuat; tonkhoDen.NgayHetHan = tonkho.NgayHetHan; tonkhoDen.GiaBan = tonkho.GiaBan; tonkhoDen.GiaNhap = tonkho.GiaNhap; tonkhoDen.LoaiPhatSinhID = 2; tonkhoDen.SoLuongPhatSinh = soluong; tonkhoDen.Visual = true; kara.TONKHOes.AddObject(tonkhoDen); kara.SaveChanges(); } }
public static void NhapKho(KaraokeEntities kara, BOChiTietNhapKho chitiet,BONhapKho nhapKho) { LICHSUTONKHO lichSuDauKy = (from a in kara.LICHSUTONKHOes where a.MonID == chitiet.MenuKichThuocMon.MenuKichThuocMon.MonID && a.KhoID==nhapKho.NhapKho.KhoID orderby a.ID descending select a).FirstOrDefault(); LICHSUTONKHO lichSu = new LICHSUTONKHO(); if (lichSuDauKy == null) { lichSu.DauKySoLuong = 0; lichSu.DauKyDonGia = 0; } else { lichSu.DauKySoLuong = lichSuDauKy.CuoiKySoLuong; lichSu.DauKyDonGia = lichSuDauKy.CuoiKyDonGia; } int soluong = chitiet.ChiTietNhapKho.SoLuongNhap * chitiet.MenuKichThuocMon.MenuKichThuocMon.KichThuocLoaiBan; lichSu.NhapSoLuong = soluong; lichSu.NhapDonGia = chitiet.ChiTietNhapKho.GiaNhap / chitiet.MenuKichThuocMon.MenuKichThuocMon.KichThuocLoaiBan; lichSu.CuoiKySoLuong = lichSu.DauKySoLuong + lichSu.NhapSoLuong; lichSu.CuoiKyDonGia = lichSu.CuoiKyDonGia; lichSu.NgayGhiNhan = DateTime.Now; lichSu.MonID = chitiet.MenuKichThuocMon.MenuKichThuocMon.MonID; lichSu.KhoID = nhapKho.NhapKho.KhoID; lichSu.LoaiPhatSinhID = 1; kara.LICHSUTONKHOes.AddObject(lichSu); }
public static void BanHang(KaraokeEntities kara, BOBanHang banhang) { foreach (var chitiet in banhang._ListChiTietBanHang) { int soluong = chitiet.ChiTietBanHang.SoLuongBan * chitiet.ChiTietBanHang.KichThuocLoaiBan; LICHSUTONKHO lichSuDauKy = (from a in kara.LICHSUTONKHOes where a.MonID == chitiet.MenuKichThuocMon.MonID orderby a.ID descending select a).FirstOrDefault(); LICHSUTONKHO lichSu = new LICHSUTONKHO(); if (lichSuDauKy == null) { lichSu.DauKySoLuong = 0; lichSu.DauKyDonGia = 0; } else { lichSu.DauKySoLuong = lichSuDauKy.CuoiKySoLuong; lichSu.DauKyDonGia = lichSuDauKy.CuoiKyDonGia; } lichSu.XuatSoLuong = soluong; lichSu.XuatDonGia = chitiet.ChiTietBanHang.GiaBan; lichSu.CuoiKySoLuong = lichSu.DauKySoLuong - lichSu.XuatSoLuong; lichSu.CuoiKyDonGia = lichSu.CuoiKyDonGia; lichSu.NgayGhiNhan = DateTime.Now; lichSu.MonID = chitiet.MenuKichThuocMon.MonID; lichSu.KhoID = banhang.KhoID; lichSu.LoaiPhatSinhID = 5; kara.LICHSUTONKHOes.AddObject(lichSu); } }
public static IQueryable<BOLichBieuKhongDinhKy> GetAllVisualRun(KaraokeEntities kara,BAN ban) { int? khuID = ban == null ? null : ban.KhuID; DateTime dtNow = DateTime.Now; DateTime dt = new DateTime(dtNow.Year, dtNow.Month, dtNow.Day); TimeSpan ts = new TimeSpan(dt.Hour, dt.Minute, dt.Second); var querya = BOMenuLoaiGia.GetAllVisual(kara); var queryb = from b in GetAllVisual(kara) where ts.CompareTo(b.GioBatDau.Value) >= 0 && ts.CompareTo(b.GioKetThuc.Value) <= 0 && dt.CompareTo(b.NgayBatDau.Value) >= 0 && dt.CompareTo(b.NgayKetThuc.Value) <= 0 && ( b.KhuID == null || b.KhuID == khuID ) select b; var query = from a in querya join b in queryb on a.LoaiGiaID equals b.LoaiGiaID select new BOLichBieuKhongDinhKy { MenuLoaiGia = a, LichBieuKhongDinhKy = b }; return query.Distinct(); }
public static IQueryable <MENULOAIGIA> GetAllLoaiGiaRun(KaraokeEntities kara, BAN ban) { var lichBieuDinhKy = Data.BOLichBieuDinhKy.GetAllVisualRun(kara, ban); var lichBieuKhongDinhKy = Data.BOLichBieuKhongDinhKy.GetAllVisualRun(kara, ban); return((from a in lichBieuDinhKy select a.MenuLoaiGia).Union(from b in lichBieuKhongDinhKy select b.MenuLoaiGia).Distinct()); }
public static IQueryable <BOLichBieuKhongDinhKy> GetAllVisualRun(KaraokeEntities kara, BAN ban) { int? khuID = ban == null ? null : ban.KhuID; DateTime dtNow = DateTime.Now; DateTime dt = new DateTime(dtNow.Year, dtNow.Month, dtNow.Day); TimeSpan ts = new TimeSpan(dt.Hour, dt.Minute, dt.Second); var querya = BOMenuLoaiGia.GetAllVisual(kara); var queryb = from b in GetAllVisual(kara) where ts.CompareTo(b.GioBatDau.Value) >= 0 && ts.CompareTo(b.GioKetThuc.Value) <= 0 && dt.CompareTo(b.NgayBatDau.Value) >= 0 && dt.CompareTo(b.NgayKetThuc.Value) <= 0 && ( b.KhuID == null || b.KhuID == khuID ) select b; var query = from a in querya join b in queryb on a.LoaiGiaID equals b.LoaiGiaID select new BOLichBieuKhongDinhKy { MenuLoaiGia = a, LichBieuKhongDinhKy = b }; return(query.Distinct()); }
public static void NhapKho(KaraokeEntities kara, BOChiTietNhapKho chitiet, BONhapKho nhapKho) { LICHSUTONKHO lichSuDauKy = (from a in kara.LICHSUTONKHOes where a.MonID == chitiet.MenuKichThuocMon.MenuKichThuocMon.MonID && a.KhoID == nhapKho.NhapKho.KhoID orderby a.ID descending select a).FirstOrDefault(); LICHSUTONKHO lichSu = new LICHSUTONKHO(); if (lichSuDauKy == null) { lichSu.DauKySoLuong = 0; lichSu.DauKyDonGia = 0; } else { lichSu.DauKySoLuong = lichSuDauKy.CuoiKySoLuong; lichSu.DauKyDonGia = lichSuDauKy.CuoiKyDonGia; } int soluong = chitiet.ChiTietNhapKho.SoLuongNhap * chitiet.MenuKichThuocMon.MenuKichThuocMon.KichThuocLoaiBan; lichSu.NhapSoLuong = soluong; lichSu.NhapDonGia = chitiet.ChiTietNhapKho.GiaNhap / chitiet.MenuKichThuocMon.MenuKichThuocMon.KichThuocLoaiBan; lichSu.CuoiKySoLuong = lichSu.DauKySoLuong + lichSu.NhapSoLuong; lichSu.CuoiKyDonGia = lichSu.CuoiKyDonGia; lichSu.NgayGhiNhan = DateTime.Now; lichSu.MonID = chitiet.MenuKichThuocMon.MenuKichThuocMon.MonID; lichSu.KhoID = nhapKho.NhapKho.KhoID; lichSu.LoaiPhatSinhID = 1; kara.LICHSUTONKHOes.AddObject(lichSu); }
public static IQueryable <MENULOAINHOM> GetAll(KaraokeEntities kara, int limit) { return((from x in kara.MENULOAINHOMs where x.Deleted == false && x.Visual == true orderby x.LoaiNhomID select x).Take(limit)); }
public BOKhachHang(Data.Transit transit) { mTransit = transit; mKaraokeEntities = new KaraokeEntities(); frmKhachHang = new FrameworkRepository<KHACHHANG>(transit.KaraokeEntities, transit.KaraokeEntities.KHACHHANGs); frmLoaiKhachHang = new FrameworkRepository<LOAIKHACHHANG>(transit.KaraokeEntities, transit.KaraokeEntities.LOAIKHACHHANGs); }
public static void BanHang(KaraokeEntities kara, BOBanHang banhang) { foreach (var chitiet in banhang._ListChiTietBanHang) { int soluongBan = chitiet.ChiTietBanHang.SoLuongBan * chitiet.ChiTietBanHang.KichThuocLoaiBan; var dsTonKho = GetTonKhoByMonID(kara, chitiet.MenuKichThuocMon.MonID, banhang.KhoID); foreach (var item in dsTonKho) { if (soluongBan > 0) { if (soluongBan >= item.SoLuongTon) { soluongBan -= item.SoLuongTon; item.SoLuongTon = 0; } else { item.SoLuongTon -= soluongBan; soluongBan = 0; } } } if (soluongBan > 0) { //xy ly sau KHOATRAN } } }
public static IQueryable<BAOCAOTONKHO> GetBaoCaoTonKho(KaraokeEntities kara,DateTime dtFrom) { return from x in kara.BAOCAOTONKHOes where (x.NgayBan.Value.Year == dtFrom.Year && x.NgayBan.Value.Month == dtFrom.Month && x.NgayBan.Value.Day == dtFrom.Day) || x.NgayBan == null select x; }
public BOXuliMayIn(Transit transit) { mTransit = transit; mKaraokeEntities = new KaraokeEntities(); _CAIDATMAYINBEP = BOCaiDatMayInBep.GetQueryNoTracking(mKaraokeEntities); _CAIDATMAYINHOADON = BOCaiDatMayInHoaDon.GetQueryNoTracking(mKaraokeEntities); _ImageLogo = Utilities.ImageHandler.BitmapImage2Bitmap(this._CAIDATMAYINHOADON.Logo); }
public static IQueryable<BOChiTietThuChi> GetAllByThuChiID(int thuChiID, KaraokeEntities kara) { return from a in kara.CHITIETTHUCHIs where a.ThuChiID == thuChiID select new BOChiTietThuChi { ChiTietThuChi=a }; }
public static IQueryable <BOChiTietThuChi> GetAllByThuChiID(int thuChiID, KaraokeEntities kara) { return(from a in kara.CHITIETTHUCHIs where a.ThuChiID == thuChiID select new BOChiTietThuChi { ChiTietThuChi = a }); }
public static IQueryable <BOTableStatus> GetAll(KaraokeEntities kara) { return(from a in BOBanHang.GetAllNotCompleted(kara) select new BOTableStatus { TableID = (int)a.BanID, Status = (int)a.TrangThaiID }); }
public void LoadKhuyenMai(KaraokeEntities kara) { var queryKhuyenMai = Data.BOMenuKhuyenMai.GetAllByKichThuocMon(kara, MenuKichThuocMon); foreach (var item in queryKhuyenMai) { BOChiTietBanHang ct = new BOChiTietBanHang(item.KichThuocMonTang, mTransit); _ListKhuyenMai.Add(ct); } }
public static IQueryable<BOTableStatus> GetAll(KaraokeEntities kara) { return from a in BOBanHang.GetAllNotCompleted(kara) select new BOTableStatus { TableID=(int)a.BanID, Status=(int)a.TrangThaiID }; }
public static System.Data.Objects.ObjectResult<BAOCAOLICHSUTONKHO> GetLichSuTonKho(KaraokeEntities kara, int KhoID, DateTime dtFrom, DateTime dtTo) { var Parameter_KhoID = new System.Data.SqlClient.SqlParameter("@KhoID", System.Data.SqlDbType.Int); Parameter_KhoID.Value = KhoID; var Parameter_DateFrom = new System.Data.SqlClient.SqlParameter("@DateFrom", System.Data.SqlDbType.DateTime); Parameter_DateFrom.Value = dtFrom; var Parameter_DateTo = new System.Data.SqlClient.SqlParameter("@DateTo", System.Data.SqlDbType.DateTime); Parameter_DateTo.Value = dtTo; return kara.ExecuteStoreQuery<BAOCAOLICHSUTONKHO>("SP_BAOCAOLICHSUTONKHO @KhoID, @DateFrom, @DateTo", Parameter_KhoID, Parameter_DateFrom, Parameter_DateTo); }
public static IQueryable <BOMenuGia> GetAllByKichThuocMonVaLoaiGia(KaraokeEntities kara, MENUKICHTHUOCMON ktm, IQueryable <MENULOAIGIA> loaiGia) { return(from a in loaiGia join b in GetAll(kara) on a.LoaiGiaID equals b.LoaiGiaID where b.KichThuocMonID == ktm.KichThuocMonID select new BOMenuGia { LoaiGia = a, MenuGia = b }); }
public static IQueryable <BOTonKho> GetTonKhoByKho(KaraokeEntities kara, KHO kho) { return(from a in kara.TONKHOes join b in kara.MENUMONs on a.MonID equals b.MonID where a.KhoID == kho.KhoID && a.SoLuongTon > 0 select new BOTonKho { TonKho = a, TenMon = b.TenDai }); }
public static IQueryable<BOMenuGia> GetAllByKichThuocMonVaLoaiGia(KaraokeEntities kara,MENUKICHTHUOCMON ktm,IQueryable<MENULOAIGIA> loaiGia) { return from a in loaiGia join b in GetAll(kara) on a.LoaiGiaID equals b.LoaiGiaID where b.KichThuocMonID==ktm.KichThuocMonID select new BOMenuGia { LoaiGia = a, MenuGia = b }; }
public static CAIDATMAYINHOADON GetQueryNoTracking(KaraokeEntities kara) { CAIDATMAYINHOADON item = FrameworkRepository<CAIDATMAYINHOADON>.QueryNoTracking(kara.CAIDATMAYINHOADONs).FirstOrDefault(); if (item == null) { item = new CAIDATMAYINHOADON(); item.HeaderTextString1 = ""; item.HeaderTextString2 = ""; item.HeaderTextString3 = ""; item.HeaderTextString4 = ""; item.HeaderTextFontSize1 = 12; item.HeaderTextFontSize2 = 12; item.HeaderTextFontSize3 = 12; item.HeaderTextFontSize4 = 12; item.HeaderTextFontStyle1 = (int)System.Drawing.FontStyle.Regular; item.HeaderTextFontStyle2 = (int)System.Drawing.FontStyle.Regular; item.HeaderTextFontStyle3 = (int)System.Drawing.FontStyle.Regular; item.HeaderTextFontStyle4 = (int)System.Drawing.FontStyle.Regular; item.HeaderTextFontWeights1 = (int)SomeEnum.FontWeights.Normal; item.HeaderTextFontWeights2 = (int)SomeEnum.FontWeights.Normal; item.HeaderTextFontWeights3 = (int)SomeEnum.FontWeights.Normal; item.HeaderTextFontWeights4 = (int)SomeEnum.FontWeights.Normal; item.FooterTextString1 = ""; item.FooterTextString2 = ""; item.FooterTextString3 = ""; item.FooterTextString4 = ""; item.FooterTextFontSize1 = 12; item.FooterTextFontSize2 = 12; item.FooterTextFontSize3 = 12; item.FooterTextFontSize4 = 12; item.FooterTextFontStyle1 = (int)System.Drawing.FontStyle.Regular; item.FooterTextFontStyle2 = (int)System.Drawing.FontStyle.Regular; item.FooterTextFontStyle3 = (int)System.Drawing.FontStyle.Regular; item.FooterTextFontStyle4 = (int)System.Drawing.FontStyle.Regular; item.FooterTextFontWeights1 = (int)SomeEnum.FontWeights.Normal; item.FooterTextFontWeights2 = (int)SomeEnum.FontWeights.Normal; item.FooterTextFontWeights3 = (int)SomeEnum.FontWeights.Normal; item.FooterTextFontWeights4 = (int)SomeEnum.FontWeights.Normal; item.SumanyFontSize = 12; item.SumanyFontStyle = (int)System.Drawing.FontStyle.Regular; item.SumanyFontWeights = (int)SomeEnum.FontWeights.Normal; item.SumanyFontSizeBig = 12; item.SumanyFontStyleBig = (int)System.Drawing.FontStyle.Regular; item.SumanyFontWeightsBig = (int)SomeEnum.FontWeights.Normal; item.TitleTextFontSize = 12; item.TitleTextFontStyle = (int)System.Drawing.FontStyle.Regular; item.TitleTextFontWeights = (int)SomeEnum.FontWeights.Normal; } return item; }
public static CAIDATMAYINHOADON GetQueryNoTracking(KaraokeEntities kara) { CAIDATMAYINHOADON item = FrameworkRepository <CAIDATMAYINHOADON> .QueryNoTracking(kara.CAIDATMAYINHOADONs).FirstOrDefault(); if (item == null) { item = new CAIDATMAYINHOADON(); item.HeaderTextString1 = ""; item.HeaderTextString2 = ""; item.HeaderTextString3 = ""; item.HeaderTextString4 = ""; item.HeaderTextFontSize1 = 12; item.HeaderTextFontSize2 = 12; item.HeaderTextFontSize3 = 12; item.HeaderTextFontSize4 = 12; item.HeaderTextFontStyle1 = (int)System.Drawing.FontStyle.Regular; item.HeaderTextFontStyle2 = (int)System.Drawing.FontStyle.Regular; item.HeaderTextFontStyle3 = (int)System.Drawing.FontStyle.Regular; item.HeaderTextFontStyle4 = (int)System.Drawing.FontStyle.Regular; item.HeaderTextFontWeights1 = (int)SomeEnum.FontWeights.Normal; item.HeaderTextFontWeights2 = (int)SomeEnum.FontWeights.Normal; item.HeaderTextFontWeights3 = (int)SomeEnum.FontWeights.Normal; item.HeaderTextFontWeights4 = (int)SomeEnum.FontWeights.Normal; item.FooterTextString1 = ""; item.FooterTextString2 = ""; item.FooterTextString3 = ""; item.FooterTextString4 = ""; item.FooterTextFontSize1 = 12; item.FooterTextFontSize2 = 12; item.FooterTextFontSize3 = 12; item.FooterTextFontSize4 = 12; item.FooterTextFontStyle1 = (int)System.Drawing.FontStyle.Regular; item.FooterTextFontStyle2 = (int)System.Drawing.FontStyle.Regular; item.FooterTextFontStyle3 = (int)System.Drawing.FontStyle.Regular; item.FooterTextFontStyle4 = (int)System.Drawing.FontStyle.Regular; item.FooterTextFontWeights1 = (int)SomeEnum.FontWeights.Normal; item.FooterTextFontWeights2 = (int)SomeEnum.FontWeights.Normal; item.FooterTextFontWeights3 = (int)SomeEnum.FontWeights.Normal; item.FooterTextFontWeights4 = (int)SomeEnum.FontWeights.Normal; item.SumanyFontSize = 12; item.SumanyFontStyle = (int)System.Drawing.FontStyle.Regular; item.SumanyFontWeights = (int)SomeEnum.FontWeights.Normal; item.SumanyFontSizeBig = 12; item.SumanyFontStyleBig = (int)System.Drawing.FontStyle.Regular; item.SumanyFontWeightsBig = (int)SomeEnum.FontWeights.Normal; item.TitleTextFontSize = 12; item.TitleTextFontStyle = (int)System.Drawing.FontStyle.Regular; item.TitleTextFontWeights = (int)SomeEnum.FontWeights.Normal; } return(item); }
public static BOMenuKichThuocMon GetKTMByBarcode(string barcode, KaraokeEntities kara) { var ktm = (from a in kara.MENUKICHTHUOCMONs join b in kara.MENUMONs on a.MonID equals b.MonID where b.MaVach == barcode select new BOMenuKichThuocMon { MenuKichThuocMon = a, MenuMon = b }).FirstOrDefault(); return(ktm); }
public static NHANVIEN CheckLogin(KaraokeEntities kara,string user, string pass) { if (!String.IsNullOrEmpty(user) && !String.IsNullOrEmpty(pass)) { var Parameter_TenDangNhap = new System.Data.SqlClient.SqlParameter("@TenDangNhap", System.Data.SqlDbType.VarChar, 50); Parameter_TenDangNhap.Value = user; var Parameter_MatKhau = new System.Data.SqlClient.SqlParameter("@MatKhau", System.Data.SqlDbType.VarChar, 255); Parameter_MatKhau.Value = pass; NHANVIEN nv = kara.ExecuteStoreQuery<NHANVIEN>("SP_Login_NhanVien @TenDangNhap, @MatKhau", Parameter_TenDangNhap, Parameter_MatKhau).FirstOrDefault(); return nv; } return null; }
public static NHANVIEN CheckLogin(KaraokeEntities kara, string user, string pass) { if (!String.IsNullOrEmpty(user) && !String.IsNullOrEmpty(pass)) { var Parameter_TenDangNhap = new System.Data.SqlClient.SqlParameter("@TenDangNhap", System.Data.SqlDbType.VarChar, 50); Parameter_TenDangNhap.Value = user; var Parameter_MatKhau = new System.Data.SqlClient.SqlParameter("@MatKhau", System.Data.SqlDbType.VarChar, 255); Parameter_MatKhau.Value = pass; NHANVIEN nv = kara.ExecuteStoreQuery <NHANVIEN>("SP_Login_NhanVien @TenDangNhap, @MatKhau", Parameter_TenDangNhap, Parameter_MatKhau).FirstOrDefault(); return(nv); } return(null); }
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 static IQueryable<BAOCAONGAYTONG> GetBaoCaoNgayTong(KaraokeEntities kara,DateTime dtFrom, DateTime dtTo) { //return from x in kara.BAOCAONGAYTONGs // where dtFrom.CompareTo(x.NgayBan.Value) <= 0 && dtTo.CompareTo(x.NgayBan.Value) >= 0 // select x; var paraFrom = new System.Data.SqlClient.SqlParameter("@NgayBatDau", System.Data.SqlDbType.DateTime); paraFrom.Value = dtFrom; var paraTo = new System.Data.SqlClient.SqlParameter("@NgayKetThuc", System.Data.SqlDbType.DateTime); paraTo.Value = dtTo; var sql = kara.ExecuteStoreQuery<BAOCAONGAYTONG>("SP_REPORT_BAOCAONGAYTONG @NgayBatDau,@NgayKetThuc", paraFrom, paraTo); return sql.AsQueryable<BAOCAONGAYTONG>(); }
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 static BOThuChi GetThuChiByID(int thuchiID, KaraokeEntities kara) { return((from t in kara.THUCHIs join l in kara.LOAITHUCHIs on t.LoaiThuChiID equals l.LoaiThuChiID join n in kara.NHANVIENs on t.NhanVienID equals n.NhanVienID into listNV from a in listNV.DefaultIfEmpty() where t.ID == thuchiID select new BOThuChi { ThuChi = t, LoaiThuChi = l, NhanVien = a }).FirstOrDefault()); }
public static IQueryable <BOBaoCaoLichSuBanHang> GetLichSuBanHang(KaraokeEntities kara, DateTime dtFrom, DateTime dtTo) { return(from a in kara.BANHANGs //join b in mKaraokeEntities.BANs on a.BanID equals b.BanID //join c in mKaraokeEntities.TRANGTHAIs on a.TrangThaiID equals c.TrangThaiID where dtFrom.CompareTo(a.NgayBan.Value) <= 0 && dtTo.CompareTo(a.NgayBan.Value) >= 0 select new BOBaoCaoLichSuBanHang { TenBan = a.BAN.TenBan, NgayBan = a.NgayBan, SoTien = a.TongTien, TrangThai = a.TRANGTHAI.TenTrangThai }); }
public static IQueryable<BOBaoCaoLichSuBanHang> GetLichSuBanHang(KaraokeEntities kara, DateTime dtFrom, DateTime dtTo) { return from a in kara.BANHANGs //join b in mKaraokeEntities.BANs on a.BanID equals b.BanID //join c in mKaraokeEntities.TRANGTHAIs on a.TrangThaiID equals c.TrangThaiID where dtFrom.CompareTo(a.NgayBan.Value) <= 0 && dtTo.CompareTo(a.NgayBan.Value) >= 0 select new BOBaoCaoLichSuBanHang { TenBan = a.BAN.TenBan, NgayBan = a.NgayBan, SoTien = a.TongTien, TrangThai = a.TRANGTHAI.TenTrangThai }; }
public static BOThuChi GetThuChiByID(int thuchiID, KaraokeEntities kara) { return (from t in kara.THUCHIs join l in kara.LOAITHUCHIs on t.LoaiThuChiID equals l.LoaiThuChiID join n in kara.NHANVIENs on t.NhanVienID equals n.NhanVienID into listNV from a in listNV.DefaultIfEmpty() where t.ID == thuchiID select new BOThuChi { ThuChi = t, LoaiThuChi = l, NhanVien = a }).FirstOrDefault(); }
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; }
public static IQueryable<BOBanHang> GetAllCompleted(KaraokeEntities kara,DateTime date) { return from a in FrameworkRepository<BANHANG>.QueryNoTracking(kara.BANHANGs).Where( b => b.TrangThaiID == 4 && b.NgayBan.Value.Day==date.Day && b.NgayBan.Value.Month==date.Month&& b.NgayBan.Value.Year==date.Year ) join b in kara.BANs on a.BanID equals b.BanID select new BOBanHang { BAN=b, BANHANG=a }; }
public static IQueryable <BAOCAONGAYTONG> GetBaoCaoNgayTong(KaraokeEntities kara, DateTime dtFrom, DateTime dtTo) { //return from x in kara.BAOCAONGAYTONGs // where dtFrom.CompareTo(x.NgayBan.Value) <= 0 && dtTo.CompareTo(x.NgayBan.Value) >= 0 // select x; var paraFrom = new System.Data.SqlClient.SqlParameter("@NgayBatDau", System.Data.SqlDbType.DateTime); paraFrom.Value = dtFrom; var paraTo = new System.Data.SqlClient.SqlParameter("@NgayKetThuc", System.Data.SqlDbType.DateTime); paraTo.Value = dtTo; var sql = kara.ExecuteStoreQuery <BAOCAONGAYTONG>("SP_REPORT_BAOCAONGAYTONG @NgayBatDau,@NgayKetThuc", paraFrom, paraTo); return(sql.AsQueryable <BAOCAONGAYTONG>()); }
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); }
public static IQueryable <BOBanHang> GetAllCompleted(KaraokeEntities kara, DateTime date) { return(from a in FrameworkRepository <BANHANG> .QueryNoTracking(kara.BANHANGs).Where( b => b.TrangThaiID == 4 && b.NgayBan.Value.Day == date.Day && b.NgayBan.Value.Month == date.Month && b.NgayBan.Value.Year == date.Year ) join b in kara.BANs on a.BanID equals b.BanID select new BOBanHang { BAN = b, BANHANG = a }); }
public static IQueryable<BOMenuKhuyenMai> GetAllByKichThuocMon(KaraokeEntities kara, MENUKICHTHUOCMON ktm) { var query = from a in kara.MENUKHUYENMAIs.Where(o => o.KichThuocMonID == ktm.KichThuocMonID&&o.Visual==true && o.Deleted==false) join b in kara.MENUKICHTHUOCMONs on a.KichThuocMonTang equals b.KichThuocMonID join c in kara.MENUMONs on b.MonID equals c.MonID select new BOMenuKhuyenMai { MenuKhuyenMai = a, KichThuocMonTang = new BOMenuKichThuocMon { MenuKichThuocMon=b, MenuMon=c } }; return query; }
public static IQueryable <BOMenuKhuyenMai> GetAllByKichThuocMon(KaraokeEntities kara, MENUKICHTHUOCMON ktm) { var query = from a in kara.MENUKHUYENMAIs.Where(o => o.KichThuocMonID == ktm.KichThuocMonID && o.Visual == true && o.Deleted == false) join b in kara.MENUKICHTHUOCMONs on a.KichThuocMonTang equals b.KichThuocMonID join c in kara.MENUMONs on b.MonID equals c.MonID select new BOMenuKhuyenMai { MenuKhuyenMai = a, KichThuocMonTang = new BOMenuKichThuocMon { MenuKichThuocMon = b, MenuMon = c } }; return(query); }
public static void NhapKhoTong(KaraokeEntities kara, BOChiTietNhapKho chitiet, BONhapKho nhapkho) { int soluongNhap = chitiet.ChiTietNhapKho.SoLuongNhap * chitiet.MenuKichThuocMon.KichThuocLoaiBan; TONKHO tonkho = new TONKHO(); tonkho.KhoID = nhapkho.NhapKho.KhoID; tonkho.MonID = chitiet.MenuKichThuocMon.MenuKichThuocMon.MonID; tonkho.SoLuongNhap = soluongNhap; tonkho.SoLuongTon = soluongNhap; tonkho.NgayNhap = DateTime.Now; tonkho.NgaySanXuat = chitiet.ChiTietNhapKho.NgaySanXuat; tonkho.NgayHetHan = chitiet.ChiTietNhapKho.NgayHetHan; tonkho.GiaNhap = chitiet.ChiTietNhapKho.GiaNhap; tonkho.GiaBan = chitiet.ChiTietNhapKho.GiaBan; tonkho.LoaiPhatSinhID = 1; tonkho.Visual = true; kara.TONKHOes.AddObject(tonkho); }
public static BOThongTinCongTy GetQueryNoTracking(KaraokeEntities kara) { BOThongTinCongTy item = (from x in FrameworkRepository<CAIDATTHONGTINCONGTY>.QueryNoTracking(kara.CAIDATTHONGTINCONGTies) select new BOThongTinCongTy { TenCongTy=x.TenCongTy, DiaChi=x.DiaChi, DienThoai=x.DienThoaiBan, Hinh = x.Logo }).FirstOrDefault(); if (item == null) { item = new BOThongTinCongTy(); item.TenCongTy = ""; item.DienThoai = ""; item.DiaChi = ""; } return item; }
public static IQueryable<BONhapKho> GetAllByDate(KaraokeEntities kara, DateTime dt) { return from nk in kara.NHAPKHOes join k in kara.KHOes on nk.KhoID equals k.KhoID join nv in kara.NHANVIENs on nk.NhanVienID equals nv.NhanVienID join ncc in kara.NHACUNGCAPs on nk.NhaCungCapID equals ncc.NhaCungCapID where nk.ThoiGian.Value.Day==dt.Day && nk.ThoiGian.Value.Month==dt.Month && nk.ThoiGian.Value.Year==dt.Year select new BONhapKho { NhapKho = nk, Kho = k, NhanVien = nv, NhaCungCap = ncc }; }
public static IQueryable <BONhapKho> GetAllByDate(KaraokeEntities kara, DateTime dt) { return (from nk in kara.NHAPKHOes join k in kara.KHOes on nk.KhoID equals k.KhoID join nv in kara.NHANVIENs on nk.NhanVienID equals nv.NhanVienID join ncc in kara.NHACUNGCAPs on nk.NhaCungCapID equals ncc.NhaCungCapID where nk.ThoiGian.Value.Day == dt.Day && nk.ThoiGian.Value.Month == dt.Month && nk.ThoiGian.Value.Year == dt.Year select new BONhapKho { NhapKho = nk, Kho = k, NhanVien = nv, NhaCungCap = ncc }); }
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); }
public static CAIDATMAYINBEP GetQueryNoTracking(KaraokeEntities kara) { CAIDATMAYINBEP item = FrameworkRepository<CAIDATMAYINBEP>.QueryNoTracking(kara.CAIDATMAYINBEPs).FirstOrDefault(); if (item == null) { item = new CAIDATMAYINBEP(); item.TitleTextFontSize = 12; item.TitleTextFontStyle = (int)System.Drawing.FontStyle.Regular; item.TitleTextFontWeights = (int)SomeEnum.FontWeights.Normal; item.InfoTextFontSize = 12; item.InfoTextFontStyle = (int)System.Drawing.FontStyle.Regular; item.InfoTextFontWeights = (int)SomeEnum.FontWeights.Normal; item.ItemTextFontSize = 12; item.ItemTextFontStyle = (int)System.Drawing.FontStyle.Regular; item.ItemTextFontWeights = (int)SomeEnum.FontWeights.Normal; item.SumTextFontSize = 12; item.SumTextFontStyle = (int)System.Drawing.FontStyle.Regular; item.SumTextFontWeights = (int)SomeEnum.FontWeights.Normal; } return item; }
public static IQueryable<MENULOAIGIA> GetQueryNoTracking(KaraokeEntities karaokeEntities) { return karaokeEntities.MENULOAIGIAs.Where(s => s.Deleted == false); }
public static IQueryable<MENULOAIGIA> GetAllVisual(KaraokeEntities kara) { return kara.MENULOAIGIAs.Where(o => o.Deleted == false && o.Visual == true); }
public BOMenuLoaiGia(Data.Transit transit) { mTransit = transit; mKaraokeEntities = new KaraokeEntities(); }
public static IQueryable<MENULOAIGIA> GetAllLoaiGiaRun(KaraokeEntities kara,BAN ban) { var lichBieuDinhKy = Data.BOLichBieuDinhKy.GetAllVisualRun(kara,ban); var lichBieuKhongDinhKy = Data.BOLichBieuKhongDinhKy.GetAllVisualRun(kara,ban); return (from a in lichBieuDinhKy select a.MenuLoaiGia).Union(from b in lichBieuKhongDinhKy select b.MenuLoaiGia).Distinct(); }
public BOChuyenBan(Transit transit) { mKaraokeEntities = new KaraokeEntities(); mTransit = transit; }