Exemplo n.º 1
0
        public IQueryable <BD02ViewModel_SM01DDL> Get()
        {
            List <BD02ViewModel_SM01DDL> model = new List <BD02ViewModel_SM01DDL>();
            var dbresult = db.Get().AsQueryable();

            //TotalRow = db.Get().ToList().Count;
            //var dbresult = db.Get().ToList().Skip((CurrPage - 1) * PageSize).Take(PageSize).ToList();
            foreach (var items in dbresult)
            {
                BD02ViewModel_SM01DDL _model = new BD02ViewModel_SM01DDL();
                _model.dept_id   = items.dept_id.Trim();
                _model.dept_name = items.dept_name.Trim();
                _model.dept_org  = items.dept_org.Trim();
                _model.dept_year = items.dept_year.Trim();
                model.Add(_model);
            }
            return(model.AsQueryable());
        }
Exemplo n.º 2
0
        public IQueryable <BD02ViewModel_SM01DDL> Get_Dept()//RabyHungAdd_2016-10-05
        {
            List <BD02ViewModel_SM01DDL> model = new List <BD02ViewModel_SM01DDL>();
            var dbresult = db.Get().AsQueryable();

            //TotalRow = db.Get().ToList().Count;
            //var dbresult = db.Get().ToList().Skip((CurrPage - 1) * PageSize).Take(PageSize).ToList();
            foreach (var items in dbresult)
            {
                BD02ViewModel_SM01DDL _model = new BD02ViewModel_SM01DDL();
                _model.dept_year = items.dept_year.Trim();
                _model.dept_org  = items.dept_org.Trim();
                _model.org_name  = db_BD01.Get().Where(x => x.org_id == _model.dept_org).ToList()[0].org_name.Trim(); //取得bd01_org資料表機關名稱,條件為:該表org_id等於model_view表的dept_org id
                _model.dept_id   = items.dept_id.Trim();
                _model.dept_name = items.dept_name.Trim();
                _model.dept_memo = items.dept_memo.Trim();
                model.Add(_model);
            }
            return(model.AsQueryable());
        }