Beispiel #1
0
        public virtual ApiNoteServerResponseModel MapServerRequestToResponse(
            int id,
            ApiNoteServerRequestModel request)
        {
            var response = new ApiNoteServerResponseModel();

            response.SetProperties(id,
                                   request.CallId,
                                   request.DateCreated,
                                   request.NoteText,
                                   request.OfficerId);
            return(response);
        }
Beispiel #2
0
        public virtual ApiNoteServerResponseModel MapEntityToModel(
            Note item)
        {
            var model = new ApiNoteServerResponseModel();

            model.SetProperties(item.Id,
                                item.CallId,
                                item.DateCreated,
                                item.NoteText,
                                item.OfficerId);
            if (item.CallIdNavigation != null)
            {
                var callIdModel = new ApiCallServerResponseModel();
                callIdModel.SetProperties(
                    item.CallIdNavigation.Id,
                    item.CallIdNavigation.AddressId,
                    item.CallIdNavigation.CallDispositionId,
                    item.CallIdNavigation.CallStatusId,
                    item.CallIdNavigation.CallString,
                    item.CallIdNavigation.CallTypeId,
                    item.CallIdNavigation.DateCleared,
                    item.CallIdNavigation.DateCreated,
                    item.CallIdNavigation.DateDispatched,
                    item.CallIdNavigation.QuickCallNumber);

                model.SetCallIdNavigation(callIdModel);
            }

            if (item.OfficerIdNavigation != null)
            {
                var officerIdModel = new ApiOfficerServerResponseModel();
                officerIdModel.SetProperties(
                    item.OfficerIdNavigation.Id,
                    item.OfficerIdNavigation.Badge,
                    item.OfficerIdNavigation.Email,
                    item.OfficerIdNavigation.FirstName,
                    item.OfficerIdNavigation.LastName,
                    item.OfficerIdNavigation.Password);

                model.SetOfficerIdNavigation(officerIdModel);
            }

            return(model);
        }