Exemple #1
0
        public virtual ApiCallDispositionServerResponseModel MapEntityToModel(
            CallDisposition item)
        {
            var model = new ApiCallDispositionServerResponseModel();

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

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

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