public void AddUserRole(int PortalID, int UserId, int RoleId, System.DateTime EffectiveDate, System.DateTime ExpiryDate) { UserInfo objUser = UserController.GetUserById(PortalID, UserId); UserRoleInfo objUserRole = GetUserRole(PortalID, UserId, RoleId); Services.Log.EventLog.EventLogController objEventLog = new Services.Log.EventLog.EventLogController(); if (objUserRole == null) { objUserRole = new UserRoleInfo(); objUserRole.UserID = UserId; objUserRole.RoleID = RoleId; objUserRole.PortalID = PortalID; objUserRole.EffectiveDate = EffectiveDate; objUserRole.ExpiryDate = ExpiryDate; provider.AddUserToRole(PortalID, objUser, objUserRole); objEventLog.AddLog(objUserRole, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", Services.Log.EventLog.EventLogController.EventLogType.USER_ROLE_CREATED); } else { objUserRole.EffectiveDate = EffectiveDate; objUserRole.ExpiryDate = ExpiryDate; provider.UpdateUserRole(objUserRole); objEventLog.AddLog(objUserRole, PortalController.GetCurrentPortalSettings(), UserController.GetCurrentUserInfo().UserID, "", Services.Log.EventLog.EventLogController.EventLogType.USER_ROLE_UPDATED); } }
public abstract void RemoveUserFromRole(int portalId, UserInfo user, UserRoleInfo userRole);
public abstract void UpdateUserRole(UserRoleInfo userRole);
public abstract bool AddUserToRole(int portalId, UserInfo user, UserRoleInfo userRole);