예제 #1
0
        public WorkerLoginResult Login(string stationName, string loginName, string password, WorkerFunction workerFunction, string connectionString)
        {
            LoadFromDbByLoginName(loginName);
            WorkerAuthenticator wa  = new WorkerAuthenticator(AuthenticationMode.UserPassword, connectionString);
            WorkerLoginResult   ret = wa.Login(loginName, password, string.Empty, stationName, workerFunction);

            if (ret == WorkerLoginResult.Ok)
            {
                UpdateLoginDateOnStation(Id, stationName, DateTime.Now);
            }
            return(ret);
        }
예제 #2
0
        public WorkerLoginResult Login(string stationName, string badgeCode, WorkerFunction workerFunction, string connectionString)
        {
            LoadFromDbByBadgeCode(badgeCode);
            WorkerAuthenticator wa  = new WorkerAuthenticator(AuthenticationMode.BadgeCode, connectionString);
            WorkerLoginResult   ret = wa.Login(string.Empty, string.Empty, badgeCode, stationName, workerFunction);

            if (ret == WorkerLoginResult.Ok)
            {
                LoadFromDbByBadgeCode(badgeCode);
                UpdateLoginDateOnStation(Id, stationName, DateTime.Now);
            }
            return(ret);
        }