private void Add(object sender) { if (!FilterServiceList.Any(s => s.Selected) || !FilterHouseList.Any(s => s.Selected)) { return; } foreach (var houseId in FilterHouseList.Where(h => h.Selected).Select(h => h.Id)) { foreach (var serviceId in FilterServiceList.Where(h => h.Selected).Select(h => h.Id)) { _requestService.AddHouseAndTypesForWorker(_workerId, houseId, serviceId == 0 ? (int?)null : serviceId, Weigth); } } RefreshList(); }
private void AddHouse(object obj) { if (!FilterHouseList.Any(s => s.Selected)) { return; } foreach (var houseId in FilterHouseList.Where(h => h.Selected).Select(h => h.Id)) { try { _requestService.AddBindedToWorkerHouse(_workerId, houseId); } catch { } } RefreshList(); }