public SaveExcludedRoomsResponse SaveExcludedRooms(ExcludedRoomsViewModel excludedRoomsViewModel) { SaveExcludedRoomsResponse response = new SaveExcludedRoomsResponse(); try { string salasExcluidas = ""; foreach (var sala in excludedRoomsViewModel.ExcludedRooms) { if (sala.excluded) { salasExcluidas = string.Concat(salasExcluidas, sala.name, ";"); } } BlackListSala blacklistSala; if (excludedRoomsViewModel.OficinaId == null) { blacklistSala = _blackListSalasRepository.GetOne(x => x.IsActivo && x.CentroId == excludedRoomsViewModel.CentroId && x.OficinaId == null); } else { blacklistSala = _blackListSalasRepository.GetOne(x => x.IsActivo && x.CentroId == excludedRoomsViewModel.CentroId && x.OficinaId == excludedRoomsViewModel.OficinaId); } if (blacklistSala == null) { blacklistSala = new BlackListSala() { CentroId = excludedRoomsViewModel.CentroId, OficinaId = excludedRoomsViewModel.OficinaId, IsActivo = true, Salas = salasExcluidas }; _blackListSalasRepository.Create(blacklistSala); } else { blacklistSala.Salas = salasExcluidas; _blackListSalasRepository.Update(blacklistSala); } response.IsValid = true; } catch (Exception ex) { response.IsValid = false; response.ErrorMessage = ex.Message; } return(response); }
public SaveExcludedRoomsResponse SaveExcludedRooms(ExcludedRoomsViewModel excludedRoomsViewModel) { throw new NotImplementedException(); }
public ActionResult SaveExcludedRooms(ExcludedRoomsViewModel model) { _graphService.SaveExcludedRooms(model); return(RedirectToAction("Volver", "Candidaturas")); }