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); } }
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); }
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 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); } }
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); }
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); }
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"); }
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"); }
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)); }
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; }
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); }
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"); }
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); }
//[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; }
public FilterPage(CategoryItemsPage page) { InitializeComponent(); this.page = page; BindingContext = new FiltersViewModel(); }
public CancelFiltersCommand(FiltersViewModel viewModel) { this.viewModel = viewModel; this.viewModel.PropertyChanged += ViewModelOnPropertyChanged; }
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; }
public UpdateViewModel() { Items = new List <UpdateListItemViewModel>(); Filters = new FiltersViewModel(); Languages = new List <LanguageViewModel>(); }
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())); }