public virtual ApiCallServerResponseModel MapServerRequestToResponse( int id, ApiCallServerRequestModel request) { var response = new ApiCallServerResponseModel(); response.SetProperties(id, request.AddressId, request.CallDispositionId, request.CallStatusId, request.CallString, request.CallTypeId, request.DateCleared, request.DateCreated, request.DateDispatched, request.QuickCallNumber); return(response); }
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); }
public virtual ApiCallAssignmentServerResponseModel MapEntityToModel( CallAssignment item) { var model = new ApiCallAssignmentServerResponseModel(); model.SetProperties(item.Id, item.CallId, item.UnitId); 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.UnitIdNavigation != null) { var unitIdModel = new ApiUnitServerResponseModel(); unitIdModel.SetProperties( item.UnitIdNavigation.Id, item.UnitIdNavigation.CallSign); model.SetUnitIdNavigation(unitIdModel); } return(model); }
public virtual ApiCallServerResponseModel MapEntityToModel( Call item) { var model = new ApiCallServerResponseModel(); model.SetProperties(item.Id, item.AddressId, item.CallDispositionId, item.CallStatusId, item.CallString, item.CallTypeId, item.DateCleared, item.DateCreated, item.DateDispatched, item.QuickCallNumber); if (item.AddressIdNavigation != null) { var addressIdModel = new ApiAddressServerResponseModel(); addressIdModel.SetProperties( item.AddressIdNavigation.Id, item.AddressIdNavigation.Address1, item.AddressIdNavigation.Address2, item.AddressIdNavigation.City, item.AddressIdNavigation.State, item.AddressIdNavigation.Zip); model.SetAddressIdNavigation(addressIdModel); } if (item.CallDispositionIdNavigation != null) { var callDispositionIdModel = new ApiCallDispositionServerResponseModel(); callDispositionIdModel.SetProperties( item.CallDispositionIdNavigation.Id, item.CallDispositionIdNavigation.Name); model.SetCallDispositionIdNavigation(callDispositionIdModel); } if (item.CallStatusIdNavigation != null) { var callStatusIdModel = new ApiCallStatusServerResponseModel(); callStatusIdModel.SetProperties( item.CallStatusIdNavigation.Id, item.CallStatusIdNavigation.Name); model.SetCallStatusIdNavigation(callStatusIdModel); } if (item.CallTypeIdNavigation != null) { var callTypeIdModel = new ApiCallTypeServerResponseModel(); callTypeIdModel.SetProperties( item.CallTypeIdNavigation.Id, item.CallTypeIdNavigation.Name); model.SetCallTypeIdNavigation(callTypeIdModel); } return(model); }