Exemple #1
0
        public FilterPage()
        {
            InitializeComponent();

            // Hold view model reference to make changes dynamically
            BindingContext = viewModel = new FiltersViewModel();
        }
 /// <summary>
 ///		Elimina un filtro de la vista
 /// </summary>
 private void DeleteFilter()
 {
     if (SelectedItem != null)
     {
         FiltersViewModel.Remove(SelectedItem);
     }
 }
Exemple #3
0
        public TaskStateColumnViewModel(TaskState taskState,
                                        IQueryService <TaskState> taskStateQueryService,
                                        FiltersViewModel filtersViewModel, int number,
                                        bool isOpened, bool canMoveLeft, bool canMoveRight)
        {
            _taskStateQueryService = taskStateQueryService;
            _filtersViewModel      = filtersViewModel;
            _isOpened = isOpened;

            var brushConverter = new BrushConverter();

            TaskStateColor = (Brush)brushConverter.ConvertFromString(taskState.Color);
            TaskState      = taskState;

            _addTaskCommand         = new RelayCommand(OnAddTaskCommand);
            _showColumnCommand      = new RelayCommand(OnShowColumnCommand);
            _hideColumnCommand      = new RelayCommand(OnHideColumnCommand);
            _moveColumnLeftCommand  = new RelayCommand(OnMoveColumnLeftCommand);
            _moveColumnRightCommand = new RelayCommand(OnMoveColumRightCommand);
            _deleteTaskStateCommand = new RelayCommand(OnDeleteTaskStateCommand);

            CanMoveLeft  = canMoveLeft;
            CanMoveRight = canMoveRight;

            Tasks = new ObservableCollection <TaskDetailsViewModel>();
            Tasks.CollectionChanged          += (sender, args) => RaisePropertyChanged("CanBeDeleted");
            _filtersViewModel.FiltersUpdated += FiltersViewModelOnFiltersUpdated;
            SetBackground(number);
        }
Exemple #4
0
        public IActionResult Index(FiltersViewModel filters, SortOrder sortOrder = SortOrder.UserNameAsc)
        {
            IQueryable <User> users = db.Users.Include(u => u.Company);

            if (!string.IsNullOrEmpty(filters.UserName))
            {
                users = users.Where(u => u.Name.Contains(filters.UserName));
            }

            int[] selectedCompanies = filters.SelectedCompanies;
            if (selectedCompanies != null && selectedCompanies.Count() > 0 && !selectedCompanies.Contains(0))
            {
                users = users.Where(u => selectedCompanies.Contains(u.Company.Id));
            }

            SortUserViewModel sortUserViewModel = new SortUserViewModel(users, sortOrder);
            var sortedUsers = sortUserViewModel.Sort().ToList();

            filters.Companies = new SelectList(db.Companies.ToList(), "Id", "Name");

            var viewModel = new HomeIndexViewModel();

            viewModel.SortUserViewModel = sortUserViewModel;
            viewModel.Filters           = filters;
            viewModel.Users             = sortedUsers;

            return(View(viewModel));
        }
        public ActionResult Index(BaseUserSessionViewModel baseUserSessionViewModel)
        {
            // Initialize
            questStatus status = null;

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Log Operation
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = LogOperation();
            if (!questStatusDef.IsSuccess(status))
            {
                baseUserSessionViewModel.questStatus = status;
                return(View("Index", baseUserSessionViewModel));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Authorize
            *---------------------------------------------------------------------------------------------------------------------------------*/
            status = Authorize(baseUserSessionViewModel._ctx);
            if (!questStatusDef.IsSuccess(status))
            {
                baseUserSessionViewModel.questStatus = status;
                return(View("Index", baseUserSessionViewModel));
            }

            /*----------------------------------------------------------------------------------------------------------------------------------
            * Return view.
            *---------------------------------------------------------------------------------------------------------------------------------*/
            FiltersViewModel filtersViewModel = new FiltersViewModel(this.UserSession, baseUserSessionViewModel);

            return(View(filtersViewModel));
        }
        public ServerListViewModel()
        {
            Title = "servers";

            FiltersViewModel = new FiltersViewModel();
            ListViewModel = new ListViewModel();

            FiltersViewModel.Filter.PublishFilter();
        }
        public ServerListViewModel()
        {
            Title = "servers";

            FiltersViewModel = new FiltersViewModel();
            ListViewModel    = new ListViewModel();

            FiltersViewModel.Filter.PublishFilter();
        }
Exemple #8
0
 public void PopulateFilterGroups()
 {
     //    var localGroups = await DatabaseHandler.Instance.GetFilterGroups();
     foreach (var localFilterGroup in LocalCache.Instance.LocalfilterGroups)
     {
         var newFilterVIewModel = new FiltersViewModel();
         newFilterVIewModel.SetFilterGroup(localFilterGroup);
         FiltersViewModels.Add(newFilterVIewModel);
     }
 }
Exemple #9
0
 public FilterItemViewModel(FiltersViewModel parent)
 {
     SetIcons();
     Parent     = parent;
     IconButton = new OptionButtonViewModel()
     {
         OnClick = new DelegateCommand(OnIconClick),
         Icon    = UncheckedIcon
     };
 }
        public async Task <IEnumerable <EventViewModel> > GetFilteredEvents(FiltersViewModel filters)
        {
            if (string.IsNullOrEmpty(filters.Status))
            {
                var openEvents = await GetFilteredEvents(filters.Sources, "open", filters.Days);

                var closedEvents = await GetFilteredEvents(filters.Sources, "closed", filters.Days);

                return(openEvents.Union(closedEvents).OrderBy(e => e.Id));
            }
            else
            {
                return(await GetFilteredEvents(filters.Sources, filters.Status, filters.Days));
            }
        }
        public FiltersViewModel GetFilters(string projectId)
        {
            var filtersViewModel = new FiltersViewModel();
            var filters          = ImportManager.GetFilters(projectId);

            if (filters.CurrentProject != null)
            {
                filtersViewModel.Project = new ProjectViewModel
                {
                    Id   = filters.CurrentProject.Id,
                    Name = filters.CurrentProject.Name
                };
            }

            filtersViewModel.Projects.Add(new ProjectViewModel
            {
                Id   = "0",
                Name = "Select project"
            });
            foreach (var project in filters.Projects)
            {
                filtersViewModel.Projects.Add(new ProjectViewModel
                {
                    Id   = project.Id,
                    Name = project.Name
                });
            }

            foreach (var status in filters.Statuses)
            {
                filtersViewModel.Statuses.Add(new StatusViewModel
                {
                    Id   = status.Id,
                    Name = status.Name
                });
            }

            foreach (var template in filters.Templates)
            {
                filtersViewModel.Templates.Add(new TemplateViewModel
                {
                    Id   = template.Id,
                    Name = template.Name
                });
            }

            return(filtersViewModel);
        }
Exemple #12
0
        public static LocalFilterGroup ToLocalFilterGroup(this FiltersViewModel filtersViewModel)
        {
            LocalFilterGroup localFilterGroup = new LocalFilterGroup();

            localFilterGroup.Id               = filtersViewModel.GroupId;
            localFilterGroup.Name             = filtersViewModel.GroupName;
            localFilterGroup.IsActive         = filtersViewModel.IsChecked;
            localFilterGroup.Filters          = new List <LocalFilter>();
            localFilterGroup.StartDate        = filtersViewModel.IntervalFilterItemViewModel.StartDate;
            localFilterGroup.EndDate          = filtersViewModel.IntervalFilterItemViewModel.EndDate;
            localFilterGroup.IsIntervalActive = filtersViewModel.IntervalFilterItemViewModel.IsChecked;
            foreach (var filterItemViewModel in filtersViewModel.FilterItemList)
            {
                localFilterGroup.Filters.Add(filterItemViewModel.ToLocalFilter());
            }
            return(localFilterGroup);
        }
Exemple #13
0
        public Form_Recorrido_Index()
            : base(title: "Recorridos")
        {
            _OnClickAdd = () => Program.Navigation.PopUpPage(new Form_Recorrido_Add(
                                                                 onAddSuccess: (c) => this.OnAddOrEditSuccess()));

            _OnClickEdit = (id) => Program.Navigation.PopUpPage(new Form_Recorrido_Edit(
                                                                    onEditSuccess: (c) => this.OnAddOrEditSuccess(),
                                                                    idRecorrido: id));

            _OnClickDelete = (id) => HandleDelete(id);

            Filters = new FiltersViewModel(
                PuertoDAO.GetAll().Select(x => new KeyValuePair <int, string>(x.Cod_Puerto, x.Nombre)).ToList(),
                exactFilter: "Cód. de Recorrido",
                likeFilter: "Puerto Desde/Hasta *",
                dropdownFilter: "Puerto Desde/Hasta");
        }
Exemple #14
0
        public Form_Rol_Index()
            : base(title: "Roles")
        {
            _OnClickAdd = () => Program.Navigation.PopUpPage(new Form_Rol_Add(
                                                                 onAddSuccess: (c) => this.OnAddOrEditSuccess()));

            _OnClickEdit = (id) => Program.Navigation.PopUpPage(new Form_Rol_Edit(
                                                                    onEditSuccess: (c) => this.OnAddOrEditSuccess(),
                                                                    idRol: id));

            _OnClickDelete = (id) => BajaRol(id);

            Filters = new FiltersViewModel(
                dropdownOptions: PermisoDAO.GetAll().Select(x => new KeyValuePair <int, string>(x.Cod_Permiso, x.Nombre)).ToList(),
                exactFilter: "Cód. de Rol",
                likeFilter: "Nombre de Rol",
                dropdownFilter: "Permisos");
        }
Exemple #15
0
        public Form_RutaDeViaje_Index()
            : base(showEditButton: false, showDeleteButton: false, title: "Rutas de viaje")
        {
            _OnClickAdd = () => Program.Navigation.PopUpPage(new Form_RutaDeViaje_Add(
                                                                 onAddSuccess: (c) => this.OnAddOrEditSuccess()));

            //_OnClickEdit = (id) => Program.Navigation.PopUpPage(new Form_RutaDeViaje_Edit(
            //        onEditSuccess: (c) => this.OnAddOrEditSuccess(),
            //        idRecorrido: id));

            //_OnClickDelete = (id) => System.Windows.Forms.MessageBox.Show("Borrando el id: " + id);

            Filters = new FiltersViewModel(
                dropdownOptions: CruceroDAO.GetAll().Select(x => new KeyValuePair <int, string>(x.Cod_Crucero, x.Identificador)).ToList(),
                exactFilter: "Cód. de Ruta",
                likeFilter: "*",
                dropdownFilter: "Cruceros",
                filtro: new FilterButton("Entre Fechas", AbrirFiltroDeFechas));
        }
Exemple #16
0
        private async void OnRouteSelected(object sender, SelectionChangedEventArgs e)
        {
            // Route clicked; open preselected route in map view

            // Check if selection is null
            if (e.CurrentSelection.Count == 0)
            {
                return;
            }

            // Open map page
            RouteInfo      info     = e.CurrentSelection[0] as RouteInfo;
            List <Exhibit> exhibits = FiltersViewModel.GetFilteredExhibits(info.ArtistFilter, info.TimePeriodFilter,
                                                                           info.ArtStyleFilter);
            await Navigation.PushAsync(new MapPage(exhibits));

            // Deselect item
            routesCollView.SelectedItem = null;
        }
Exemple #17
0
        public Form_Crucero_Index()
            : base(title: "Cruceros")
        {
            _OnClickAdd = () => Program.Navigation.PopUpPage(new Form_Crucero_Add(
                                                                 onAddSuccess: (c) => this.OnAddOrEditSuccess()));

            _OnClickEdit = (id) => Program.Navigation.PopUpPage(new Form_Crucero_Edit(
                                                                    onEditSuccess: (c) => this.OnAddOrEditSuccess(),
                                                                    idCrucero: id));

            _OnClickDelete = (id) => BajaCrucero(id);

            _OnTableItemSelected = SeleccionarCrucero;

            Filters = new FiltersViewModel(
                FabricanteDAO.GetAll().Select(x => new KeyValuePair <int, string>(x.Cod_Fabricante, x.Detalle)).ToList(),
                exactFilter: "Cód. Crucero",
                likeFilter: "Modelo o Identificador *",
                dropdownFilter: "Fabricante",
                buttonA: new FilterButton("Mantenimiento", AbrirMantenimiento));
        }
        private FiltersViewModel GetFilters(UpdateFiltersModel filters)
        {
            var filtersViewModel = new FiltersViewModel();

            foreach (var project in filters.Projects)
            {
                filtersViewModel.Projects.Add(new ProjectViewModel
                {
                    Id   = project.Id,
                    Name = project.Name
                });
            }

            foreach (var status in filters.Statuses)
            {
                var project    = filters.Projects.FirstOrDefault(i => i.Id == status.ProjectId);
                var statusName = status.Name;
                if (project != null)
                {
                    statusName = statusName + " (" + project.Name + ")";
                }
                filtersViewModel.Statuses.Add(new StatusViewModel
                {
                    Id   = status.Id,
                    Name = statusName
                });
            }

            foreach (var template in filters.Templates)
            {
                filtersViewModel.Templates.Add(new TemplateViewModel
                {
                    Id   = template.Id,
                    Name = template.Name
                });
            }


            return(filtersViewModel);
        }
Exemple #19
0
        public Form_Puerto_Index()
            : base(title: "Puertos")
        {
            _OnClickAdd = () => Program.Navigation.PopUpPage(new Form_Puerto_Add(
                                                                 onSuccess: OnAddOrEditSuccess));

            _OnClickEdit = (id) => Program.Navigation.PopUpPage(new Form_Puerto_Edit(
                                                                    onEditSuccess: () => this.OnAddOrEditSuccess(),
                                                                    id: id));

            _OnClickDelete = (id) => HandleDelete(id);

            Filters = new FiltersViewModel(
                dropdownOptions: new List <KeyValuePair <int, string> >()
            {
                new KeyValuePair <int, string>(2, " Activo "),
                new KeyValuePair <int, string>(1, " Inactivo ")
            },
                exactFilter: "Cód. de Puerto",
                likeFilter: "Cód o Nombre *",
                dropdownFilter: "Estado");
        }
Exemple #20
0
        public async Task <IActionResult> Product(int submenuId, int[] brandId, int[] storageId, int[] ramId, int[] colorId, int[] ssdId, int[] prosessorId, int[] opsystemId, int[] harddriveId, int[] stylejoinId)
        {
            FiltersViewModel model = new FiltersViewModel();

            ProductService productService = new ProductService();

            var products = await productService.GetProducts();

            List <ProductViewModel> productViews = new List <ProductViewModel>();

            model.ProductsVithoutPage = products;


            productViews = await GetProduct(submenuId, brandId, storageId, ramId, colorId, ssdId, prosessorId, opsystemId, harddriveId, stylejoinId);

            model.ProductsVithoutPage = productViews;

            if (brandId.Count() == 0 && storageId.Count() == 0 && ramId.Count() == 0 && colorId.Count() == 0 && ssdId.Count() == 0 && prosessorId.Count() == 0 && opsystemId.Count() == 0 && harddriveId.Count() == 0 && stylejoinId.Count() == 0)
            {
                model.ProductsVithoutPage = products.Where(x => x.Resource == submenuId).ToList();
            }

            return(PartialView("_ProductPartialView", model));
        }
        public TaskBoardViewModel(IQueryService <TaskState> taskStateQueryService,
                                  IQueryService <Task> taskQueryService,
                                  IRepositoryService repositoryService,
                                  FiltersViewModel filtersViewModel)
        {
            _taskStateQueryService = taskStateQueryService;
            _taskQueryService      = taskQueryService;
            _repositoryService     = repositoryService;
            _filtersViewModel      = filtersViewModel;

            _taskQueryService.ElementAdded   += TaskQueryServiceOnElementAdded;
            _taskQueryService.ElementUpdated += TaskQueryServiceOnElementUpdated;
            _taskQueryService.ElementDeleted += TaskQueryServiceOnElementDeleted;

            _taskStateQueryService.ElementAdded     += TaskStateQueryServiceOnElementChanged;
            _taskStateQueryService.ElementUpdated   += TaskStateQueryServiceOnElementChanged;
            _taskStateQueryService.ElementDeleted   += TaskStateQueryServiceOnElementChanged;
            _taskStateQueryService.ElementsReloaded += OnElementsReloaded;
            _taskQueryService.ElementsReloaded      += OnElementsReloaded;

            TaskStateColumns = new ObservableCollection <TaskStateColumnViewModel>();
            Messenger.Default.Register <MoveTaskToTaskStateMessage>(this, OnMoveTaskToTaskStateMessage);
            Messenger.Default.Register <DeleteTaskStateMessage>(this, OnDeleteTaskStateMessage);
        }
Exemple #22
0
        //[WebMethod(enableSession: true)]
        //[ScriptMethod(ResponseFormat = ResponseFormat.Json, UseHttpGet = true)]
        public FiltersViewModel GetFilters(string projectId)
        {
            //object resultObject = null;

            //try
            //{

            var filtersViewModel = new FiltersViewModel();
            var filters          = ImportManager.GetFilters(projectId);

            if (filters.CurrentProject != null)
            {
                filtersViewModel.Project = new ProjectViewModel
                {
                    Id   = filters.CurrentProject.Id,
                    Name = filters.CurrentProject.Name
                };
            }

            filtersViewModel.Projects.Add(new ProjectViewModel
            {
                Id   = "0",
                Name = "Select project"
            });
            foreach (var project in filters.Projects)
            {
                filtersViewModel.Projects.Add(new ProjectViewModel
                {
                    Id   = project.Id,
                    Name = project.Name
                });
            }

            foreach (var status in filters.Statuses)
            {
                filtersViewModel.Statuses.Add(new StatusViewModel
                {
                    Id   = status.Id,
                    Name = status.Name
                });
            }

            foreach (var template in filters.Templates)
            {
                filtersViewModel.Templates.Add(new TemplateViewModel
                {
                    Id   = template.Id,
                    Name = template.Name
                });
            }

            //resultObject = filtersViewModel;
            //}
            //finally
            //{
            //    Context.Response.Clear();
            //    Context.Response.ContentType = "application/json";
            //    JavaScriptSerializer js = new JavaScriptSerializer();
            //    Context.Response.Write(js.Serialize(resultObject));
            //}
            return(filtersViewModel);
        }
 public ApplyFiltersCommand(FiltersViewModel viewModel)
 {
     this.viewModel             = viewModel;
     viewModel.PropertyChanged += ViewModelOnPropertyChanged;
 }
 public DisplayOptionsViewModel(DentalRecordsScreeViewModel parent)
 {
     FiltersViewModel = new FiltersViewModel(this);
     Parent           = parent;
 }
Exemple #25
0
 public FilterPage(CategoryItemsPage page)
 {
     InitializeComponent();
     this.page      = page;
     BindingContext = new FiltersViewModel();
 }
 public CancelFiltersCommand(FiltersViewModel viewModel)
 {
     this.viewModel = viewModel;
     this.viewModel.PropertyChanged += ViewModelOnPropertyChanged;
 }
Exemple #27
0
        public FilterListBoxItem(FiltersViewModel filters, FilterModel filter, FilterParametersViewModel viewModel)
        {
            Filter = filter;

            // load images
            var imgDelete = new Image
            {
                Source = App.GetResourceImage(App.ResourceIcon.Cancel)
            };

            var imgVisible = new Image
            {
                Source = App.GetResourceImage(App.ResourceIcon.Eye)
            };

            var imgArrow = new Image
            {
                Source = App.GetResourceImage(App.ResourceIcon.ListMove),
                Margin = new Thickness(0.0, 0.0, 5.0, 0.0)
            };

            var btnDelete = new Button
            {
                Height  = 16,
                Width   = 16,
                Content = imgDelete,
                Margin  = new Thickness(0.0, 0.0, 5.0, 0.0),
                ToolTip = "remove filter"
            };

            var btnVisible = new Button
            {
                Height  = 16,
                Width   = 16,
                Content = imgVisible,
                Margin  = new Thickness(0.0, 0.0, 5.0, 0.0),
                ToolTip = "toggle filter usage"
            };

            btnVisible.Click += (sender, args) =>
            {
                viewModel.IsVisible = !viewModel.IsVisible;
                imgVisible.Source   = App.GetResourceImage(viewModel.IsVisible ? App.ResourceIcon.Eye : App.ResourceIcon.EyeClosed);
            };

            var text = new TextBlock {
                Text = filter.Name
            };

            // grid with remove, arrow, name
            var grid = new Grid();

            grid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1.0, GridUnitType.Auto)
            });
            grid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1.0, GridUnitType.Auto)
            });
            grid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1.0, GridUnitType.Auto)
            });
            grid.ColumnDefinitions.Add(new ColumnDefinition {
                Width = new GridLength(1.0, GridUnitType.Star)
            });

            Grid.SetColumn(btnDelete, 0);
            grid.Children.Add(btnDelete);
            Grid.SetColumn(btnVisible, 1);
            grid.Children.Add(btnVisible);
            Grid.SetColumn(imgArrow, 2);
            grid.Children.Add(imgArrow);
            Grid.SetColumn(text, 3);
            grid.Children.Add(text);

            // add callbacks
            Content = grid;
            ToolTip = filter.Name;
            HorizontalContentAlignment = HorizontalAlignment.Stretch;

            btnDelete.Click += (sender, args) => filters.RemoveFilter(filter);
        }
 public FilterItemViewModel(FiltersViewModel parent)
 {
     Parent = parent;
 }
Exemple #29
0
 public UpdateViewModel()
 {
     Items     = new List <UpdateListItemViewModel>();
     Filters   = new FiltersViewModel();
     Languages = new List <LanguageViewModel>();
 }
Exemple #30
0
 public AddFilterCommand(Models.Models models, FiltersViewModel viewModel)
 {
     this.viewModel = viewModel;
     this.models    = models;
 }
 /// <summary>
 ///		Añade un filtro a la lista
 /// </summary>
 private void NewFilter()
 {
     FiltersViewModel.Add(new ListItemReportColumnFilterViewModel(this, new FilterRequestModel()));
 }