HomeController.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.Mvc;
  6. using GreenTree.Nachtragsmanagement.Services.Test;
  7. using GreenTree.Nachtragsmanagement.Web.Framework;
  8. using GreenTree.Nachtragsmanagement.Web.Models.Test;
  9. using GreenTree.Nachtragsmanagement.Web.Models.User;
  10. using Newtonsoft.Json;
  11. namespace GreenTree.Nachtragsmanagement.Web.Controllers
  12. {
  13. public class HomeController : Controller
  14. {
  15. private readonly IDbRelationService _dbRelationService;
  16. public HomeController(
  17. IDbRelationService dbRelationService)
  18. {
  19. _dbRelationService = dbRelationService;
  20. }
  21. // GET: Home
  22. public ActionResult Index()
  23. {
  24. var relations = _dbRelationService.GetRelations(3, DbRelationFormat.Json);
  25. var model = new DbRelationModel
  26. {
  27. UserJson = relations[0],
  28. DeviationJson = relations[1],
  29. SiteJson = relations[2],
  30. AppendixJson = relations[3]
  31. };
  32. return View("~/Views/Home/Index.cshtml", model);
  33. }
  34. }
  35. }