|
|
@ -1,15 +1,37 @@ |
|
|
|
using System.Web.Mvc; |
|
|
|
using Microsoft.AspNet.Identity.EntityFramework; |
|
|
|
using Sevomin.Models; |
|
|
|
using Sevomin.Models.Helpers; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using System.Web.Mvc; |
|
|
|
|
|
|
|
namespace Sevomin.WebFrontend.Controllers |
|
|
|
{ |
|
|
|
public class HomeController : BaseController |
|
|
|
{ |
|
|
|
public ActionResult Index() |
|
|
|
public HomeController() |
|
|
|
: this(new SevominUserManager(new UserStore<User>(SevominDbContext.Current))) |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
public HomeController(SevominUserManager userManager) |
|
|
|
{ |
|
|
|
UserManager = userManager; |
|
|
|
} |
|
|
|
|
|
|
|
public SevominUserManager UserManager { get; private set; } |
|
|
|
|
|
|
|
public async Task<ActionResult> Index() |
|
|
|
{ |
|
|
|
if (!Request.IsAuthenticated) |
|
|
|
return View("Intro"); |
|
|
|
else |
|
|
|
return View("Intro"); |
|
|
|
{ |
|
|
|
User user = await UserManager.FindByNameAsync(User.Identity.Name); |
|
|
|
if(user is Avalin) |
|
|
|
return View("AvalinIndex"); |
|
|
|
else |
|
|
|
return View("DovominIndex"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |