demo20230512/Areas/admin/Controllers/HomeController.cs
2023-05-12 10:20:28 +08:00

29 lines
857 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Resources.Helper;
using Weee.DAL;
using Weee.Models;
using Weee.Areas.Admin.ViewModels;
namespace Weee.Areas.Admin.Controllers
{
public class HomeController : AdminControllerBase
{
public HomeController(WeeeDataContext db) : base(db)
{
}
public ActionResult Index()
{
var viewModel = new HomeViewModel();
viewModel.NormalCompanies = db.NormalCompanies.OrderBy(x => x.RegisterDate).Take(5).ToList();
viewModel.CertificationCompanies = db.CertificationCompanies.OrderBy(x => x.RegisterDate).Take(5).ToList();
viewModel.Lcas = db.LCAs.OrderBy(x => x.CreatedDate).Take(5).ToList();
return View(viewModel);
}
}
}