Exemple #1
0
        public static List <THONGTINSIM> LoadNotUsedTTS()
        {
            QLCDTEntities db     = new QLCDTEntities();
            var           result = (
                from t in db.THONGTINSIMs
                where !(
                    from w in db.HDDKs
                    select w.IDSIM
                    ).Contains(t.IDSIM)
                select new
            {
                IDSIM = t.IDSIM,
                SDT = t.SDT,
                TINHTRANG = t.TINHTRANG
            }).ToList();
            List <THONGTINSIM> listReturn = new List <THONGTINSIM>();

            foreach (var item in result)
            {
                THONGTINSIM kh_list = new THONGTINSIM();

                kh_list.IDSIM     = item.IDSIM;
                kh_list.SDT       = item.SDT;
                kh_list.TINHTRANG = item.TINHTRANG;

                listReturn.Add(kh_list);
            }

            return(listReturn);
        }
Exemple #2
0
        public static List <HDDK> LoadHDDK()
        {
            QLCDTEntities db     = new QLCDTEntities();
            var           result = (
                from t in db.HDDKs
                select new
            {
                ID = t.ID,
                IDSIM = t.IDSIM,
                IDKH = t.IDKH,
                CUOCDK = t.CUOCDK,
                KHACHHANG = t.KHACHHANG,
                NGAYBD = t.NGAYBD,
                NGAYKT = t.NGAYKT
            }).ToList();
            List <HDDK> listReturn = new List <HDDK>();

            foreach (var item in result)
            {
                HDDK kh_list = new HDDK();

                kh_list.ID        = item.ID;
                kh_list.IDSIM     = item.IDSIM;
                kh_list.IDKH      = item.IDKH;
                kh_list.CUOCDK    = item.CUOCDK;
                kh_list.KHACHHANG = item.KHACHHANG;
                kh_list.NGAYBD    = item.NGAYBD;
                kh_list.NGAYKT    = item.NGAYKT;

                listReturn.Add(kh_list);
            }

            return(listReturn);
        }
Exemple #3
0
        public static List <HDTC> LoadThanhToan()
        {
            QLCDTEntities db     = new QLCDTEntities();
            var           result = (
                from t in db.HDTCs
                select new
            {
                ID = t.ID,
                IDSIM = t.IDSIM,
                KHACHHANG = t.KHACHHANG,
                THANG = t.THANG,
                NAM = t.NAM,
                TONGTIEN = t.TONGTIEN,
                THANHTOAN = t.THANHTOAN
            }).ToList();
            List <HDTC> listReturn = new List <HDTC>();

            foreach (var item in result)
            {
                HDTC kh_list = new HDTC();

                kh_list.ID        = item.ID;
                kh_list.IDSIM     = item.IDSIM;
                kh_list.KHACHHANG = item.KHACHHANG;
                kh_list.THANG     = item.THANG;
                kh_list.NAM       = item.NAM;
                kh_list.TONGTIEN  = item.TONGTIEN;
                kh_list.THANHTOAN = item.THANHTOAN;

                listReturn.Add(kh_list);
            }

            return(listReturn);
        }
Exemple #4
0
        public static List <CHITIETSD> LoadCTSD()
        {
            QLCDTEntities db     = new QLCDTEntities();
            var           result = (
                from t in db.CHITIETSDs
                select new
            {
                ID = t.ID,
                IDSIM = t.IDSIM,
                TGBD = t.TGBD,
                TGKT = t.TGKT,
                SOPHUTSD = t.SOPHUTSD,
                CUOCPHI = t.CUOCPHI
            }).ToList();
            List <CHITIETSD> listReturn = new List <CHITIETSD>();

            foreach (var item in result)
            {
                CHITIETSD kh_list = new CHITIETSD();

                kh_list.ID       = item.ID;
                kh_list.IDSIM    = item.IDSIM;
                kh_list.TGBD     = item.TGBD;
                kh_list.TGKT     = item.TGKT;
                kh_list.SOPHUTSD = item.SOPHUTSD;
                kh_list.CUOCPHI  = item.CUOCPHI;

                listReturn.Add(kh_list);
            }


            return(listReturn);
        }
Exemple #5
0
        public static List <GIACUOC> LoadGiaCuoc()
        {
            QLCDTEntities db     = new QLCDTEntities();
            var           result = (
                from t in db.GIACUOCs
                select new
            {
                ID = t.ID,
                TGBD = t.TGBD,
                TGKT = t.TGKT,
                GIACUOC = t.GIACUOC1
            }).ToList();
            List <GIACUOC> listReturn = new List <GIACUOC>();

            foreach (var item in result)
            {
                GIACUOC kh_list = new GIACUOC();

                kh_list.ID       = item.ID;
                kh_list.TGBD     = item.TGBD;
                kh_list.TGKT     = item.TGKT;
                kh_list.GIACUOC1 = item.GIACUOC;

                listReturn.Add(kh_list);
            }

            return(listReturn);
        }
Exemple #6
0
 public static void TinhHDTC(string thang, string nam)
 {
     using (QLCDTEntities DContext = new QLCDTEntities())
     {
         DContext.TINH_HDTC(int.Parse(thang), int.Parse(nam));
     }
 }
Exemple #7
0
 public static decimal TinhCuoc(string from, string to)
 {
     using (QLCDTEntities DContext = new QLCDTEntities())
     {
         return(DContext.Database.SqlQuery <decimal>("SELECT dbo.TINHCUOC(@p0, @p1)", from, to).FirstOrDefault());
     }
 }
Exemple #8
0
 public static double SoPhut(string from, string to)
 {
     using (QLCDTEntities DContext = new QLCDTEntities())
     {
         return(DContext.Database.SqlQuery <double>("SELECT dbo.SOPHUT(@p0, @p1)", from, to).FirstOrDefault());
     }
 }
Exemple #9
0
        public static List <KHACHHANG> LoadKH()
        {
            QLCDTEntities db     = new QLCDTEntities();
            var           result = (
                from khdb in db.KHACHHANGs
                select new
            {
                ID = khdb.ID,
                TENKH = khdb.TENKH,
                CMND = khdb.CMND,
                NGHENGHIEP = khdb.NGHENGHIEP,
                CHUCVU = khdb.CHUCVU,
                DIACHI = khdb.DIACHI,
                TINHTRANG = khdb.TINHTRANG,
                EMAIL = khdb.EMAIL
            }).ToList();
            List <KHACHHANG> listReturn = new List <KHACHHANG>();

            foreach (var item in result)
            {
                KHACHHANG kh_list = new KHACHHANG();

                kh_list.ID         = item.ID;
                kh_list.TENKH      = item.TENKH;
                kh_list.CMND       = item.CMND;
                kh_list.NGHENGHIEP = item.NGHENGHIEP;
                kh_list.CHUCVU     = item.CHUCVU;
                kh_list.DIACHI     = item.DIACHI;
                kh_list.TINHTRANG  = item.TINHTRANG;
                kh_list.EMAIL      = item.EMAIL;

                listReturn.Add(kh_list);
            }

            return(listReturn);
        }