Example #1
0
 /// <summary>
 /// The enter the system.
 /// </summary>
 /// <param name="loginInfo">
 /// The login info.
 /// </param>
 /// <returns>
 /// The <see cref="User"/>.
 /// </returns>
 public User EnterTheSystem(LoginInfo loginInfo)
 {
     return this.GetUser(loginInfo.LoginName, loginInfo.Password);
 }
Example #2
0
        /// <summary>
        ///     The login.
        /// </summary>
        /// <exception cref="InvalidOperationException">
        /// </exception>
        public void Login()
        {
            try
            {
                // IFrontServiceClient coreServiceClient =
                // ServiceManager.GetInstance().GetManager("FrontService") as IFrontServiceClient;
                // MemberInfo user = coreServiceClient.SystemEnter(this.Login, this.Password);
                // ApplicationContext.GetInstance().AddValue("user", user);
                // ControlManager.GetInstance().Place("MainWindow", "mainRegion", "DashboardControl");
                ServiceManager.GetInstance().AddManager("UserManager", typeof(UserManager));

                var coreServiceClient = ServiceManager.GetInstance().GetManager("UserManager") as IFrontServiceClient;

                this.loginInfoUser = new LoginInfo { Password = this.Password, LoginName = this.LoginName };

                // User user = coreServiceClient.EnterTheSystem(this.loginInfoUser);
                var um = new UserManager();
                var user = um.EnterTheSystem(this.loginInfoUser);

                // ApplicationContext.GetInstance().AddValue("user", user);
                ControlManager.GetInstance().Place("MainWindow", "mainRegion", "DashboardControl");
                ControlManager.GetInstance().Place("DashboardControl", "mainRegion", "HomepageControl");
            }
            catch (ExceptionBase exception)
            {
                var message = exception.GetMessage();
                this.View.ShowError(message);
            }
        }