Пример #1
0
 /// reset the static variables for each Web Request call.
 public static void ResetStaticVariables()
 {
     UUserManager             = null;
     UErrorLog                = null;
     ULoginLog                = null;
     UMaintenanceLogonMessage = null;
 }
Пример #2
0
 public static ILoginLog GetFactory()
 {
     if (factory == null)
     {
         Type type = Type.GetType("Common." + SystemDefaultConfig.DatabaseProvider + "Repository.LoginLogDAL,Common." + SystemDefaultConfig.DatabaseProvider + "Repository", true);
         factory = (ILoginLog)Activator.CreateInstance(type);
     }
     return(factory);
 }
Пример #3
0
 public UserController(IUser _iuser, IRole _irole, IDepartment _idepartment, IMenu _imenu, ILoginLog _loginLog, IUserReportingHierarchy _iuserReportingHierarchy)
 {
     iuser                   = _iuser;
     irole                   = _irole;
     idepartment             = _idepartment;
     imenu                   = _imenu;
     iloginLog               = _loginLog;
     iuserReportingHierarchy = _iuserReportingHierarchy;
 }
Пример #4
0
 /// <summary>
 /// initialize variables that are initialized from classes specific to the server, eg. with access to OpenPetra database
 /// </summary>
 public static void InitializeStaticVariables(
     IUserManager AUserManager,
     IErrorLog AErrorLog,
     ILoginLog ALoginLog,
     IMaintenanceLogonMessage AMaintenanceLogonMessage)
 {
     UUserManager             = AUserManager;
     UErrorLog                = AErrorLog;
     ULoginLog                = ALoginLog;
     UMaintenanceLogonMessage = AMaintenanceLogonMessage;
 }
Пример #5
0
        public static void UpdateLogoutTime(string loginAccount)
        {
            if (string.IsNullOrWhiteSpace(loginAccount))
            {
                throw new ArgumentNullException("loginAccount");
            }

            ILoginLog factory = LoginLogFactory.GetFactory();

            factory.UpdateLogoutTime(loginAccount);
        }
Пример #6
0
        public static void Add(LoginLog model)
        {
            if (model == null)
            {
                throw new ArgumentNullException("model");
            }

            ILoginLog factory = LoginLogFactory.GetFactory();

            factory.Add(model);
        }
Пример #7
0
        public LoginLog() : base()
        {
            if (isMultiDatabase)
            {
                base.Init(this.GetType().FullName, System.Reflection.Assembly.GetExecutingAssembly().GetName().Name, dicmultiDatabase[this.GetType().Name].ToString());
            }
            else
            {
                base.Init(this.GetType().FullName, System.Reflection.Assembly.GetExecutingAssembly().GetName().Name);
            }

            baseDal.OnOperationLog += new OperationLogEventHandler(OperationLog.OnOperationLog);//如果需要记录操作日志,则实现这个事件

            dal = baseDal as ILoginLog;
        }
Пример #8
0
        public static LoginLogData ToModel(this ILoginLog log, bool withDetails = false)
        {
            if (log == null)
            {
                return(null);
            }
            var data = new LoginLogData()
            {
                EventType = log.EventType, LoginId = log.LoginId
            };

            if (withDetails)
            {
                data.Notes = log.Notes;
            }
            data.AssignCommon(log);
            return(data);
        }
Пример #9
0
 public LoginController(IUser _iuser, ILoginLog _iloginLog)
 {
     iuser     = _iuser;
     iLoginLog = _iloginLog;
 }
Пример #10
0
        public LoginLogInfo GetLastLoginInfo(string userId)
        {
            ILoginLog baseDal = base.baseDal as ILoginLog;

            return(baseDal.GetLastLoginInfo(userId));
        }
Пример #11
0
        public static Paging <LoginLog> QueryPage(LoginLogCondition condition, int pagesize, int pageindex, out int total)
        {
            ILoginLog factory = LoginLogFactory.GetFactory();

            return(factory.QueryPage(condition, pagesize, pageindex, out total));
        }