/// <summary> Конвертировать CallHistoryEntryModelManaged в ModelCallHistoryEntry </summary> private static ModelCallHistoryEntry ConvertCallHistoryEntryModelManagedToModelCallHistoryEntry(CallHistoryEntryModelManaged callHistoryEntryModelManaged) { return(new ModelCallHistoryEntry { Id = callHistoryEntryModelManaged.Id, StartTime = callHistoryEntryModelManaged.StartTime, DurationSec = callHistoryEntryModelManaged.DurationSec, ModelEnumHistoryAddressTypeObj = ModelEnumCallHistoryAddressType.GetModelEnum((int)callHistoryEntryModelManaged.AddressType), ModelEnumCallDirectionObj = ModelEnumCallDirection.GetModelEnum((int)callHistoryEntryModelManaged.Direction), ModelEnumVoipEncryptionObj = ModelEnumVoipEncryption.GetModelEnum((int)callHistoryEntryModelManaged.Encription), ModelEnumCallEndModeObj = ModelEnumCallEndMode.GetModelEnum((int)callHistoryEntryModelManaged.EndMode), ModelEnumCallHistorySourceTypeObj = ModelEnumCallHistorySourceType.GetModelEnum((int)callHistoryEntryModelManaged.HistorySource), ModelEnumCallHistoryStatusTypeObj = ModelEnumCallHistoryStatusType.GetModelEnum((int)callHistoryEntryModelManaged.HistoryStatus) }); }
/// <summary> Конвертировать CallModelManaged в ModelCall </summary> private static ModelCall ConvertCallModelManagedToModelCall(CallModelManaged callModelManaged) { var result = new ModelCall { Id = callModelManaged.Id, Duration = callModelManaged.Duration, Identity = callModelManaged.Identity, ModelContactObj = DataSourceContact.GetModelContactFromContactModelManaged(callModelManaged.Contact), ModelEnumCallDirectionObj = ModelEnumCallDirection.GetModelEnum((int)callModelManaged.Direction), ModelEnumCallAddressTypeObj = ModelEnumCallAddressType.GetModelEnum((int)callModelManaged.AddressType), ModelEnumVoipEncryptionObj = ModelEnumVoipEncryption.GetModelEnum((int)callModelManaged.Encription), ModelEnumCallStateObj = ModelEnumCallState.GetModelEnum((int)callModelManaged.State) }; return(result); }