예제 #1
0
        public virtual ApiCallStatusServerResponseModel MapEntityToModel(
            CallStatus item)
        {
            var model = new ApiCallStatusServerResponseModel();

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

            return(model);
        }
예제 #2
0
        public virtual ApiCallStatusServerResponseModel MapServerRequestToResponse(
            int id,
            ApiCallStatusServerRequestModel request)
        {
            var response = new ApiCallStatusServerResponseModel();

            response.SetProperties(id,
                                   request.Name);
            return(response);
        }
예제 #3
0
        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);
        }