Ejemplo n.º 1
0
        public async Task <ActionResult> ExcludedRooms(int CentroId, int?OficinaId)
        {
            GetExcludedRoomsResponse response = new GetExcludedRoomsResponse();

            try
            {
                string token         = GetNewAccessToken(CentroId);
                string nombreFiltrar = GetRoomFiltrar(CentroId, OficinaId);
                var    roomLists     = await _graphService.findRoomLists(token);

                GraphModel model = new GraphModel();

                model.Salas = new List <Sala>();

                foreach (var item in roomLists.Salas)
                {
                    if (item.Name.Contains(nombreFiltrar))
                    {
                        model.Salas.Add(item);
                    }
                }
                var listaSalas = await _graphService.FindRooms(token, model.Salas[0].Email);

                response = _graphService.GetExcludedRooms(CentroId, OficinaId, listaSalas);
                ViewBag.ExcludedRoomsList = response.ExcludedRoomsList;
                response.IsValid          = true;
            }
            catch (Exception ex)
            {
                response.IsValid      = false;
                response.ErrorMessage = ex.Message;
            }


            return(View(response.ExcludedRoomsList));
        }