public IEnumerable <LineDto> GetLines() { lock (obj) { return(lineManager.GetLineDtos().ToList()); } }
public IEnumerable <LineDto> GetLines() { try { List <LineDto> lines; lock (obj) { lineManager = GetContainer().Resolve <ILineManager>(); lines = lineManager.GetLineDtos().ToList(); return(lines); } } catch (Exception ex) { Debug.WriteLine(ex.Message); return(null); } }
public double CalculateTotalMinutesWithFamily(int lineId) { lock (obj) { LineDto line = lineManager.GetLineDto(lineId); List <string> lines = lineManager.GetLineDtos().Where(l => l.ClientId == line.ClientId).Select(l => l.Number).ToList(); List <CallsDto> calls = callManager.GetCallsDtos(lineId).ToList(); double minutesWithFamily = 0; foreach (var item in calls) { foreach (var i in lines) { if (item.DestinationNumber == i) { minutesWithFamily += item.Duration; } } } return(minutesWithFamily); } }