コード例 #1
0
ファイル: LoginUI.cs プロジェクト: bloomj/BurritoPOS_CSharp
        /// <summary>
        /// 
        /// </summary>
        public LoginUI()
        {
            XmlConfigurator.Configure(new FileInfo("config/log4net.properties"));
            InitializeComponent();

            //will comment out after Spring.NET implementation
            //authSvc = (IAuthenticationSvc)factory.getService("IAuthenticationSvc");

            //Spring.NET
            XmlApplicationContext ctx = new XmlApplicationContext("config/spring.cfg.xml");
            authSvc = (IAuthenticationSvc)ctx.GetObject("authSvc");

            //authSvc = new AuthenticationSvcSocketImpl();

            this.AcceptButton = loginBtn;
        }
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        public LoginUI()
        {
            XmlConfigurator.Configure(new FileInfo("config/log4net.properties"));
            InitializeComponent();

            //will comment out after Spring.NET implementation
            //authSvc = (IAuthenticationSvc)factory.getService("IAuthenticationSvc");

            //Spring.NET
            XmlApplicationContext ctx = new XmlApplicationContext("config/spring.cfg.xml");

            authSvc = (IAuthenticationSvc)ctx.GetObject("authSvc");

            //authSvc = new AuthenticationSvcSocketImpl();

            this.AcceptButton = loginBtn;
        }
コード例 #3
0
 //method for validating user
 public Boolean ValidateUser(string username, string password)
 {
     try
     {
         //calls service here
         IAuthenticationSvc authSvc = (IAuthenticationSvc)GetService(typeof(IAuthenticationSvc).Name);
         return(authSvc.SendCredentials(username, password));
     }
     catch (ServiceLoadException e)
     {
         throw new AuthenticationException(e.Message);
     }
     catch (AuthenticationException e)
     {
         throw new AuthenticationException(e.Message);
     }
     catch (SocketException e)
     {
         throw new AuthenticationException(e.Message);
     }
 }
コード例 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UserController"/> class.
 /// </summary>
 /// <param name="container"></param>
 public UserController(IServiceProvider container) : base(container)
 {
     _userService       = _container.GetService <IUserService>();
     _authenticationSvc = container.GetService <IAuthenticationSvc>();
 }
コード例 #5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="authSvc"></param>
 public void setAuthenticationSvc(IAuthenticationSvc authSvc)
 {
     this.authSvc = authSvc;
 }
コード例 #6
0
        public Boolean ISValidCredentials(Credentials credential)
        {
            IAuthenticationSvc svc = (IAuthenticationSvc)GetService(typeof(IAuthenticationSvc).Name);

            return(svc.isValidCredentials(credential.Username, credential.Password));
        }
コード例 #7
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="container"></param>
 public LoginController(IServiceProvider container) : base(container)
 {
     _authenticationSvc = container.GetService <IAuthenticationSvc>();
 }
コード例 #8
0
ファイル: LoginUI.cs プロジェクト: bloomj/BurritoPOS_CSharp
 /// <summary>
 /// 
 /// </summary>
 /// <param name="authSvc"></param>
 public void setAuthenticationSvc(IAuthenticationSvc authSvc)
 {
     this.authSvc = authSvc;
 }