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); }
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); }
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); }
public ViewClass Get(int id) { return(ViewClass.ToViewModel(_repository.Get(id))); }