Esempio n. 1
0
        public virtual ApiUnitOfficerServerResponseModel MapEntityToModel(
            UnitOfficer item)
        {
            var model = new ApiUnitOfficerServerResponseModel();

            model.SetProperties(item.Id,
                                item.OfficerId,
                                item.UnitId);
            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);
            }

            if (item.UnitIdNavigation != null)
            {
                var unitIdModel = new ApiUnitServerResponseModel();
                unitIdModel.SetProperties(
                    item.UnitIdNavigation.Id,
                    item.UnitIdNavigation.CallSign);

                model.SetUnitIdNavigation(unitIdModel);
            }

            return(model);
        }
        public virtual ApiUnitServerResponseModel MapServerRequestToResponse(
            int id,
            ApiUnitServerRequestModel request)
        {
            var response = new ApiUnitServerResponseModel();

            response.SetProperties(id,
                                   request.CallSign);
            return(response);
        }
Esempio n. 3
0
        public virtual ApiUnitServerResponseModel MapEntityToModel(
            Unit item)
        {
            var model = new ApiUnitServerResponseModel();

            model.SetProperties(item.Id,
                                item.CallSign);

            return(model);
        }
Esempio n. 4
0
        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);
        }