Example #1
0
        public void LogLogInAction(LogInAction action)
        {
            LogDS logDS = new LogDS();

            LogDS.LogInActionLogRow log = logDS.LogInActionLog.NewLogInActionLogRow();
            log.ClientIP = action.ClientIP;
            log.UserName = action.UserName;
            log.Success  = action.Success;
            if (log.Success)
            {
                log.StuffId   = action.StuffId;
                log.StuffName = action.StuffName;
            }
            log.LogInTime = action.LogInTime;
            logDS.LogInActionLog.AddLogInActionLogRow(log);
            this.LogInActionLogTA.Update(logDS.LogInActionLog);
        }
Example #2
0
        public bool LogInUser(string clientIP, string userName, string password)
        {
            bool result = false;

            LogInAction action = new LogInAction();

            action.UserName  = userName;
            action.ClientIP  = clientIP;
            action.LogInTime = DateTime.Now;

            AuthorizationDS.StuffUserDataTable table = this.StuffUserAdapter.GetDataByUserName(userName);
            if (table.Count > 0)
            {
                action.StuffName = table[0].StuffName;
                action.StuffId   = table[0].StuffId;

                if (table[0].UserPassword.Equals(password))
                {
                    if (table[0].IsLatestLogInTimeNull())
                    {
                        table[0].SetLaterLogInTimeNull();
                    }
                    else
                    {
                        table[0].LaterLogInTime = table[0].LatestLogInTime;
                    }
                    table[0].LatestLogInTime = DateTime.Now;
                    this.StuffUserAdapter.Update(table);
                    action.Success = true;
                    result         = true;
                }
            }
            if (result == false)
            {
                action.Success = false;
            }
            SysLog.LogLogInAction(action);
            return(result);
        }
Example #3
0
 public static void LogLogInAction(LogInAction action)
 {
     SysTrace.TraceData(TraceEventType.Information, (int)LogType.LogIn, action);
 }
Example #4
0
        public bool LogInUser(string clientIP, string userName, string password)
        {
            bool result = false;

            LogInAction action = new LogInAction();
            action.UserName = userName;
            action.ClientIP = clientIP;
            action.LogInTime = DateTime.Now;

            AuthorizationDS.StuffUserDataTable table = this.StuffUserAdapter.GetDataByUserName(userName);
            if (table.Count > 0) {
                action.StuffName = table[0].StuffName;
                action.StuffId = table[0].StuffId;

                if (table[0].UserPassword.Equals(password)) {
                    if (table[0].IsLatestLogInTimeNull()) {
                        table[0].SetLaterLogInTimeNull();
                    } else {
                        table[0].LaterLogInTime = table[0].LatestLogInTime;
                    }
                    table[0].LatestLogInTime = DateTime.Now;
                    this.StuffUserAdapter.Update(table);
                    action.Success = true;
                    result = true;
                }
            }
            if (result == false) {
                action.Success = false;
            }
            SysLog.LogLogInAction(action);
            return result;
        }
Example #5
0
 public void LogLogInAction(LogInAction action)
 {
     LogDS logDS = new LogDS();
     LogDS.LogInActionLogRow log = logDS.LogInActionLog.NewLogInActionLogRow();
     log.ClientIP = action.ClientIP;
     log.UserName = action.UserName;
     log.Success = action.Success;
     if (log.Success) {
         log.StuffId = action.StuffId;
         log.StuffName = action.StuffName;
     }
     log.LogInTime = action.LogInTime;
     logDS.LogInActionLog.AddLogInActionLogRow(log);
     this.LogInActionLogTA.Update(logDS.LogInActionLog);
 }
Example #6
0
 public static void LogLogInAction(LogInAction action)
 {
     SysTrace.TraceData(TraceEventType.Information, (int)LogType.LogIn, action);
 }