Example #1
0
        public int LoadSoPhieuNhapKho()
        {
            var soPhieuKiemKho = from phieunhapkho in _phieuNhapKhoRepo.GetAll()
                                 orderby phieunhapkho.SoPhieuNhap descending
                                 select phieunhapkho.SoPhieuNhap;

            int a = _phieuNhapKhoRepo.GetAll().Count();

            if (a == 0)
            {
                return(1);
            }
            return(soPhieuKiemKho.First() + 1);
        }
        public List <Object> LoadSoPhieuNhapKho()
        {
            var list = from pc in _phieuChiRepo.GetAll()
                       select new
            {
                pc.MaPhieuNhap
            }.MaPhieuNhap;

            var pn = _phieuNhapKhoRepo.GetAll();

            var result = from n in pn
                         where !list.Contains(n.SoPhieuNhap) && n.TrangThai.Equals(true)
                         select new SelectListItem
            {
                Text  = n.SoPhieuNhap.ToString(),
                Value = n.SoPhieuNhap.ToString(),
            };

            return(new List <Object>(result));
        }