Exemplo n.º 1
0
        /// <summary>
        /// 节点选择
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tlData_FocusedNodeChanged(object sender, DevExpress.XtraTreeList.FocusedNodeChangedEventArgs e)
        {
            if (e.Node == null)
            {
                return;
            }

            int type = Convert.ToInt32(e.Node["colType"]);

            if (type == 1)
            {
                CategorySelected?.Invoke(sender, e);
            }
            else if (type == 2)
            {
                DictSelected?.Invoke(sender, e);
            }
        }
        public override RecyclerView.ViewHolder OnCreateViewHolder(ViewGroup parent, int viewType)
        {
            var itemView = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.listItemCategory, parent, false);

            var holder = new CategoriesListHolder(itemView);

            holder.Clicked += (_, position) =>
            {
                NotifyItemChanged(SelectedPosition);
                SelectedPosition = position;
                NotifyItemChanged(position);

                var categoryId = position == 0 ? null : _categoryView[position - 1].Id;
                CategorySelected?.Invoke(this, categoryId);
            };

            return(holder);
        }
Exemplo n.º 3
0
        private async Task SaveFilterAsync()
        {
            var pop = await _dialogService.OpenLoadingPopup();

            SearchParameters parameter = new SearchParameters
            {
                JobTypeIds = string.Join(",", JobTypeSelected.Cast <LookupItem>().Select(r => r.Id.ToString())),
                //SalaryEstimateIds = _fieldSalaryEstimateIds,
                CategoryIds       = string.Join(",", CategorySelected.Cast <LookupItem>().Select(r => r.Id.ToString())),
                LocationIds       = string.Join(",", LocationSelected.Cast <LookupItem>().Select(r => r.Id.ToString())),
                PositionIds       = string.Join(",", PositionSelected.Cast <LookupItem>().Select(r => r.Id.ToString())),
                SkillsIds         = string.Join(",", SkillSelected.Cast <LookupItem>().Select(r => r.Id.ToString())),
                QualificationsIds = string.Join(",", QualificationSelected.Cast <LookupItem>().Select(r => r.Id.ToString())),
                TicketLicensesIds = string.Join(",", LicenceSelected.Cast <LookupItem>().Select(r => r.Id.ToString()))
            };
            Dictionary <string, object> obj = await _candidateExploreService.SaveSearchDefinition(parameter);

            try
            {
                if (obj["Success"].ToString() == "true")
                {
                    (CandidateMainViewModel.Current.ExplorePage as CandidateExploreViewModel).FilterParameters = parameter;
                    await _dialogService.PopupMessage("Save Search Difinition Successefully", "#52CD9F", "#FFFFFF");

                    await PopupNavigation.Instance.PopAllAsync();

                    await(CandidateMainViewModel.Current.ExplorePage as CandidateExploreViewModel).SearchAndPopulate();
                }
                else
                {
                    await _dialogService.PopupMessage("An error has occurred, please try again!!", "#CF6069", "#FFFFFF");
                }
            }
            catch
            {
                await _dialogService.PopupMessage("An error has occurred, please try again!!", "#CF6069", "#FFFFFF");

                await _dialogService.CloseLoadingPopup(pop);
            }
            await _dialogService.CloseLoadingPopup(pop);
        }
Exemplo n.º 4
0
        public void AddNewTransactions()
        {
            if (Device.RuntimePlatform == Device.macOS)
            {
                if (CategorySelected != null)
                {
                    var transaction = new TransactionDetail
                    {
                        Category = CategorySelected.ToString(),
                        Date     = Date,
                        Spent    = SpentOn,
                        Name     = ExpenseDescription
                    };

                    App.DataService.InsertTansaction(transaction);
                    Transactions.Add(transaction);
                    NavigationService.NavigatePopToRoot();
                }
            }
            else
            {
                if (!String.IsNullOrEmpty(SingleTransaction.ExpenseDescription))
                {
                    var newTransaction = SingleTransaction;
                    var transaction    = new TransactionDetail
                    {
                        Category = newTransaction.Category.ToString(),
                        Date     = newTransaction.Date,
                        Spent    = newTransaction.Spent,
                        Name     = newTransaction.ExpenseDescription
                    };
                    App.DataService.InsertTansaction(transaction);
                    Transactions.Add(transaction);
                    NavigationService.NavigatePopToRoot();
                }
            }
        }
Exemplo n.º 5
0
 private void OnCategorySelected()
 {
     CategorySelected?.Invoke(this, new SelectedItemEventArgs {
         Category = CurrentCategory
     });
 }