final update
This commit is contained in:
36
Website/LOC.Website.Web/Controllers/ProfileController.cs
Normal file
36
Website/LOC.Website.Web/Controllers/ProfileController.cs
Normal file
@ -0,0 +1,36 @@
|
||||
namespace LOC.Website.Web.Controllers
|
||||
{
|
||||
using System.Web.Mvc;
|
||||
using Common;
|
||||
using Common.Models;
|
||||
using Core;
|
||||
using Core.Model.Account;
|
||||
|
||||
public class ProfileController : Controller
|
||||
{
|
||||
private readonly IAccountAdministrator _accountAdministrator;
|
||||
|
||||
public ProfileController(IAccountAdministrator accountAdministrator)
|
||||
{
|
||||
_accountAdministrator = accountAdministrator;
|
||||
}
|
||||
|
||||
[AcceptVerbs(HttpVerbs.Get)]
|
||||
public ActionResult Index(string name)
|
||||
{
|
||||
Account account = _accountAdministrator.GetAccountByName(name);
|
||||
|
||||
if (account != null)
|
||||
{
|
||||
return View(account);
|
||||
}
|
||||
|
||||
return RedirectToAction("Error");
|
||||
}
|
||||
|
||||
public ActionResult Error()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user