예제 #1
0
        public PageResult <ViewClass> GetClasses(int code, int page, int size, string[] args)
        {
            int                    count = 0;
            List <Class>           list  = _repository.GetClasses(code, page, size, out count, args);
            PageResult <ViewClass> pr    = new PageResult <ViewClass>(0, "", page, size, count);

            pr.Objects = (from c in list select ViewClass.ToViewModel(c)).ToList();
            return(pr);
        }
예제 #2
0
        public List <ViewClass> GetClassesByUid(string strId, int uid)
        {
            List <Class>     list  = _repository.GetClassesByUid(strId, uid);
            List <ViewClass> model = new List <ViewClass>();

            foreach (var item in list)
            {
                model.Add(ViewClass.ToViewModel(item));
            }
            return(model);
        }
예제 #3
0
        public List <ViewClass> GetClassesByZhuanYe(int uid, int teacherId, int centerId, int type)
        {
            List <Class>     list  = _repository.GetClassesByZhuanYe(uid, teacherId, centerId, type);
            List <ViewClass> model = new List <ViewClass>();

            foreach (var item in list)
            {
                model.Add(ViewClass.ToViewModel(item));
            }
            return(model);
        }
예제 #4
0
 public ViewClass Get(int id)
 {
     return(ViewClass.ToViewModel(_repository.Get(id)));
 }