Inheritance: System.MarshalByRefObject
Esempio n. 1
0
 /*public static UserActivity logUserActivity  (this UserActivities userActivities, string who, string action, string detail)
  * {
  *  var userActivity = userActivities.newUserActivity(who,action,detail);
  *  return userActivities.logUserActivity(userActivity, null);
  * } */
 public static UserActivity logUserActivity(this UserActivities userActivities, UserActivity userActivity, TMUser tmUser)
 {
     if (userActivities.notNull() && userActivity.notNull())
     {
         userActivities.ActivitiesLog.Add(userActivity);
         userActivity.firebase_Log();
         if (tmUser.notNull() && tmUser.ID != Guid.Empty)
         {
             tmUser.UserActivities.Add(userActivity);
             tmUser.saveTmUser();
         }
     }
     return(userActivity);
 }
 public static UserActivity newUserActivity(this UserActivities userActivities, string who, string action, string detail)
 {
     if (userActivities.notNull())
     {
         return(new UserActivity
         {
             Action = action,
             Detail = detail,
             Who = who,
             When = DateTime.Now.ToFileTimeUtc(),
             When_JS = DateTime.Now.jsDate(),
             IPAddress = HttpContextFactory.Request.ipAddress()
         });
     }
     return(null);
 }
        /*public static UserActivity logUserActivity  (this UserActivities userActivities, string who, string action, string detail)
         * {
         *  var userActivity = userActivities.newUserActivity(who,action,detail);
         *  return userActivities.logUserActivity(userActivity, null);
         * } */
        public static UserActivity logUserActivity(this UserActivities userActivities, UserActivity userActivity, TMUser tmUser)
        {
            if (userActivities.notNull() && userActivity.notNull())
            {
                if (userActivities.logging_Enabled())
                {
                    userActivities.ActivitiesLog.add_Activity(userActivity);

                    userActivity.firebase_Log();
                    if (tmUser.notNull() && tmUser.ID != Guid.Empty)
                    {
                        tmUser.UserActivities.add_Activity(userActivity);

                        tmUser.event_User_Updated(); //tmUser.saveTmUser();
                    }
                }
            }
            return(userActivity);
        }
Esempio n. 4
0
 public void Setup()
 {
     userActivities = UserActivities.Current;
     userActivities.reset();
 }
Esempio n. 5
0
 static UserActivities()
 {
     Current = new UserActivities();
 }
Esempio n. 6
0
 public static UserActivities reset(this UserActivities userActivites)
 {
     userActivites.ActivitiesLog.clear();
     return(userActivites);
 }
Esempio n. 7
0
 static UserActivities()
 {
     Current = new UserActivities();
 }
 public static bool logging_Enabled(this UserActivities userActivities)
 {
     return(userActivities.logging_Disabled().isFalse());
 }
 public static bool logging_Disabled(this UserActivities userActivities)
 {
     return(TM_Server.Current.userActivities_Disable_Logging());
 }