public ActionResult Index(int page = 1) { LanguageModelFactory languageModelFactory = new LanguageModelFactory(); LanguageIndexModel model = languageModelFactory.LoadIndex(page); return(View(model)); }
public LanguageIndexModel LoadIndex(int page) { LanguageIndexModel languageIndexModel = new LanguageIndexModel(); LanguageBusiness languageBusiness = new LanguageBusiness(); List <Language> languageList = languageBusiness.LanguageList(page); languageIndexModel.LanguageList = (from z in languageList select new LanguageItemModel { ID = z.ID, Name = z.Name, Code = z.Code, Publish = z.Publish }).ToList(); return(languageIndexModel); }