Inheritance: System.MarshalByRefObject
Example #1
0
 public UserActivity logActivity(UserActivity userActivity)
 {
     if(TM_UserData.Current.firebase_Log_Activities())
     {
         var submitData = new API_Firebase.SubmitData(userActivity, API_Firebase.Submit_Type.ADD);
         apiFirebase.submit(submitData);
     }
     return userActivity;
 }
Example #2
0
 public UserActivity LogUserActivity(TMUser tmUser , UserActivity userActivity)
 {
     if (tmUser.notNull() && tmUser.ID != Guid.Empty)
     {
         tmUser.UserActivities.Add(userActivity);
         tmUser.saveTmUser();
     }
     ActivitiesLog.Add(userActivity);
     return userActivity;
 }
 public static List<UserActivity> add_Activity(this List<UserActivity> userActivities, UserActivity userActivity)
 {
     try
     {
         userActivities.Add(userActivity);
     }
     catch(Exception ex)
     {
         ex.log("[List<UserActivity>][add_UserActivity]");
     }
     return userActivities;
 }
Example #4
0
 public static UserActivity logUserActivity(this TMUser tmUser , string action, string detail)
 {
     var userActivites = UserActivities.Current;
     if (userActivites.notNull())
     {
         var userActivity = new UserActivity
             {
                 Action    = action,
                 Detail    = detail,
                 Who       = tmUser.notNull() ? tmUser.UserName :"******",
                 When      = DateTime.Now.ToFileTimeUtc(),
                 IPAddress = HttpContextFactory.Request.UserHostAddress
             };
         return userActivites.LogUserActivity(tmUser , userActivity);
     }
     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;
        }
Example #6
0
 public static UserActivity logUserActivity(this TMUser tmUser , string action, string detail)
 {
     try
     {
         var userActivites = UserActivities.Current;
         if (userActivites.notNull())
         {
             var userActivity = new UserActivity
                 {
                     Action    = action,
                     Detail    = detail,
                     Who       = tmUser.notNull() ? tmUser.UserName :"******",
                     When      = DateTime.Now.ToFileTimeUtc(),
                     IPAddress = HttpContextFactory.Context.ipAddress()
                 };
             return userActivites.LogUserActivity(tmUser , userActivity);
         }
     }
     catch (Exception ex)
     {
         ex.log("[logUserActivity]");
     }
     return null;
 }
 public static List <UserActivity> add_Activity(this List <UserActivity> userActivities, UserActivity userActivity)
 {
     try
     {
         userActivities.Add(userActivity);
     }
     catch (Exception ex)
     {
         ex.log("[List<UserActivity>][add_UserActivity]");
     }
     return(userActivities);
 }
        /*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);
        }
Example #9
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);
 }