public VoipCallWrapper(VoipCall call, ContactWrapper contact = null) { Id = call.Id; From = call.From; To = call.To; Status = call.Status; AnsweredBy = EmployeeWraper.Get(call.AnsweredBy); DialDate = new ApiDateTime(call.DialDate); DialDuration = call.DialDuration; Cost = call.TotalPrice; Contact = contact; History = call.History.Select(h => new VoipCallHistoryWrapper(h)); }
public VoipCallWrapper(VoipCall call, ContactWrapper contact = null) { Id = call.Id; From = call.From; To = call.To; Status = call.Status; AnsweredBy = EmployeeWraper.Get(call.AnsweredBy); DialDate = new ApiDateTime(call.DialDate); DialDuration = call.DialDuration; Cost = call.Price + call.ChildCalls.Sum(r => r.Price) + call.VoipRecord.Price; Contact = contact; RecordUrl = call.VoipRecord.Uri; RecordDuration = call.VoipRecord.Duration; if (call.ChildCalls.Any()) { Calls = call.ChildCalls.Select(childCall => new VoipCallWrapper(childCall)); } }
public ContactBaseWithEmailWrapper(ContactWrapper contactWrapper) : base(contactWrapper.ID) { this.AccessList = contactWrapper.AccessList; this.CanEdit = contactWrapper.CanEdit; this.DisplayName = contactWrapper.DisplayName; this.IsCompany = contactWrapper.IsCompany; this.IsPrivate = contactWrapper.IsPrivate; this.IsShared = contactWrapper.IsShared; this.MediumFotoUrl = contactWrapper.MediumFotoUrl; this.SmallFotoUrl = contactWrapper.SmallFotoUrl; if (contactWrapper.CommonData != null && contactWrapper.CommonData.Count() != 0) { this.Email = contactWrapper.CommonData.Where(item => item.InfoType == ContactInfoType.Email && item.IsPrimary == true).FirstOrDefault(); } else { this.Email = null; } }
public ContactBaseWithEmailWrapper(ContactWrapper contactWrapper) : base(contactWrapper.ID) { AccessList = contactWrapper.AccessList; CanEdit = contactWrapper.CanEdit; DisplayName = contactWrapper.DisplayName; IsCompany = contactWrapper.IsCompany; IsPrivate = contactWrapper.IsPrivate; IsShared = contactWrapper.IsShared; ShareType = contactWrapper.ShareType; MediumFotoUrl = contactWrapper.MediumFotoUrl; SmallFotoUrl = contactWrapper.SmallFotoUrl; if (contactWrapper.CommonData != null && contactWrapper.CommonData.Count() != 0) { Email = contactWrapper.CommonData.FirstOrDefault(item => item.InfoType == ContactInfoType.Email && item.IsPrimary); } else { Email = null; } }
private static ContactWrapper GetContactWithFotos(ContactWrapper contact) { contact.SmallFotoUrl = ContactPhotoManager.GetSmallSizePhoto(contact.ID, contact.IsCompany); contact.MediumFotoUrl = ContactPhotoManager.GetMediumSizePhoto(contact.ID, contact.IsCompany); return contact; }