/*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); }