Exemplo n.º 1
0
        public async Task logModifiedAssignmentStatus(Client requestingClient, string assignmentNickname, AssignmentStatus oldStatus, AssignmentStatus newStatus)
        {
            string logMessage = $@"{requestingClient.nickname} made a request to change the assignment status for {assignmentNickname} from '{oldStatus.assignmentStatusName}' to '{newStatus.assignmentStatusName}'";
            await repository.CreateNewLogEntry(makeLogTemplateObject(await getCategoryByName(LoggingConstants.MODIFIED_ASSIGNMENT_STATUS_CATEGORY), logMessage));

            await saveLogs();
        }
Exemplo n.º 2
0
        public async Task logCreatedNewAssignments(BaseClient requestingClient, Client sendingClient, List <string> listNewAssignmentNicknames)
        {
            string logMessage = $"{requestingClient.nickname} made a request to add the following assignments to {sendingClient.nickname}: ";

            foreach (string assignmentNickname in listNewAssignmentNicknames.Take(4))
            {
                logMessage += assignmentNickname;
                if (!listNewAssignmentNicknames.Take(4).ToList().IndexOf(assignmentNickname).Equals(listNewAssignmentNicknames.Take(4).ToList().Count - 1))
                {
                    logMessage += ", ";
                }
                else if (listNewAssignmentNicknames.Count > 4)
                {
                    logMessage += ", and more";
                }
            }

            await repository.CreateNewLogEntry(makeLogTemplateObject(await getCategoryByName(LoggingConstants.CREATED_ASSIGNMENT_CATEGORY), logMessage));

            await saveLogs();
        }
Exemplo n.º 3
0
        public async Task logCreatedNewClient(BaseClient requestingClient, Client newClient)
        {
            await repository.CreateNewLogEntry(makeLogTemplateObject(await getCategoryByName(LoggingConstants.CREATED_NEW_CLIENT_CATEGORY), $"{requestingClient.nickname} requested to make a new client object with email: {newClient.email}"));

            await saveLogs();
        }
Exemplo n.º 4
0
        public async Task logModifiedClientStatus(BaseClient requestingClient, Client affectedClientWithNewStatus, Status oldStatus)
        {
            await repository.CreateNewLogEntry(makeLogTemplateObject(await getCategoryByName(LoggingConstants.MODIFIED_CLIENT_STATUS_CATEGORY), $"{requestingClient.nickname} requested to modify {affectedClientWithNewStatus.nickname}'s status from '{oldStatus.statusDescription}' to '{affectedClientWithNewStatus.clientStatus.statusDescription}'"));

            await saveLogs();
        }
Exemplo n.º 5
0
        public async Task logModifiedClient(BaseClient requestingClient, Client modifiedClient)
        {
            await repository.CreateNewLogEntry(makeLogTemplateObject(await getCategoryByName(LoggingConstants.GET_ALL_HISTORY_CATEGORY), $"{requestingClient.nickname} modified a client's data for {modifiedClient.nickname}"));

            await saveLogs();
        }
Exemplo n.º 6
0
        public async Task logGetSpecificClient(BaseClient requestingClient, Client requestedClient)
        {
            await repository.CreateNewLogEntry(makeLogTemplateObject(await getCategoryByName(LoggingConstants.GET_SPECIFIC_CLIENT_CATEGORY), requestingClient.nickname + " made a request to retrieve the client information for " + requestedClient.nickname));

            await saveLogs();
        }