Ejemplo n.º 1
0
 public StartupViewModel(
     ILoginFactory loginFactory,
     IApplicationService applicationService,
     IDefaultValueService defaultValueService)
 {
     _loginFactory        = loginFactory;
     _applicationService  = applicationService;
     _defaultValueService = defaultValueService;
 }
Ejemplo n.º 2
0
 public StartupViewModel(
     ILoginFactory loginFactory,
     IApplicationService applicationService,
     IAccountsService accountsService)
 {
     _loginFactory       = loginFactory;
     _applicationService = applicationService;
     _accountsService    = accountsService;
 }
Ejemplo n.º 3
0
 public StartupViewModel(
     ILoginFactory loginFactory             = null,
     IApplicationService applicationService = null,
     IAccountsService accountsService       = null)
 {
     _loginFactory       = loginFactory ?? GetService <ILoginFactory>();
     _applicationService = applicationService ?? GetService <IApplicationService>();
     _accountsService    = accountsService ?? GetService <IAccountsService>();
 }
Ejemplo n.º 4
0
        public ActionResult Index(UserModel model)
        {
            if (ModelState.IsValid)
            {
                //Utilized factory pattern
                LoginFactory factory = new ConcreteLoginFactory();

                ILoginFactory formlogin   = factory.GetLogin("form");
                var           userDetails = formlogin.Login(model);

                if (userDetails.ID > 0)
                {
                    // if user exists set auth values in cookie
                    FormsAuthentication.SetAuthCookie(userDetails.UserName, false);
                    Session["UserID"] = userDetails.ID;
                    return(RedirectToAction("Index", "Notes"));
                }
                else
                {
                    ModelState.AddModelError("", "invalid Username or Password");
                }
            }
            return(View());
        }
Ejemplo n.º 5
0
 public LoginViewModel(ILoginFactory loginFactory)
 {
     _loginFactory = loginFactory;
     Title = "Login";
 }
Ejemplo n.º 6
0
 public LoginViewModel(ILoginFactory loginFactory)
 {
     _loginFactory = loginFactory;
     Title         = "Login";
 }
Ejemplo n.º 7
0
 public LoginViewModel(ILoginFactory loginFactory, IFeaturesService featuresService)
 {
     _loginFactory = loginFactory;
     _featuresService = featuresService;
 }
Ejemplo n.º 8
0
        public StartupViewModel(ILoginFactory loginFactory, IApplicationService applicationService)
		{
			_loginFactory = loginFactory;
			_applicationService = applicationService;
		}
Ejemplo n.º 9
0
 public AccountsViewModel(IAccountsService accountsService, ILoginFactory loginFactory, IApplicationService applicationService) 
     : base(accountsService)
 {
     _loginFactory = loginFactory;
     _applicationService = applicationService;
 }
Ejemplo n.º 10
0
 public AddAccountViewModel(IApplicationService application, ILoginFactory loginFactory)
 {
     _application  = application;
     _loginFactory = loginFactory;
 }
Ejemplo n.º 11
0
 public AccountsViewModel(IAccountsService accountsService, ILoginFactory loginFactory, IApplicationService applicationService)
     : base(accountsService)
 {
     _loginFactory       = loginFactory;
     _applicationService = applicationService;
 }
Ejemplo n.º 12
0
 public AddAccountViewModel(IApplicationService application, ILoginFactory loginFactory)
 {
     _application = application;
     _loginFactory = loginFactory;
 }
Ejemplo n.º 13
0
 public AddAccountViewModel(IApplicationService application, ILoginFactory loginFactory)
 {
     _application  = application;
     _loginFactory = loginFactory;
     LoginCommand  = ReactiveUI.ReactiveCommand.CreateFromTask(Login);
 }
Ejemplo n.º 14
0
 public LoginViewModel(ILoginFactory loginFactory, IFeaturesService featuresService)
 {
     _loginFactory    = loginFactory;
     _featuresService = featuresService;
 }