private async Task GetGenre()
        {
            try
            {
                RunningOperation = true;
                var response = await APIHelper.GetGenreMovieList();

                if (response.Error != null)
                {
                    await _dialogService.DisplayAlertAsync("ArcTouch - Movies", response.Error.Message, "Cancel");
                }
                else
                {
                    foreach (var item in response.Response.genres)
                    {
                        Genders.Add(item);
                    }
                }
                RunningOperation = false;
            }
            catch (Exception ex)
            {
                await _dialogService.DisplayAlertAsync("ArcTouch - Movies", ex.Message, "Cancel");
            }
            finally
            {
                RunningOperation = false;
            }
        }
Exemplo n.º 2
0
        private async Task LoadGenders()
        {
            var genders = await _genderService.GetGendersAsync();

            Device.BeginInvokeOnMainThread(() =>
            {
                Genders.Clear();
                foreach (Gender g in genders)
                {
                    Genders.Add(g);
                }
            });
        }
        private async Task LoadGendersLookupAsync()
        {
            Genders.Clear();
            Genders.Add(new NullLookupItem {
                DisplayMember = "Выбрать пол"
            });
            var lookup = await _genderLookUpDataService.GetGenderLookUpAsync();

            foreach (var lookupItem in lookup)
            {
                Genders.Add(lookupItem);
            }
        }
Exemplo n.º 4
0
        public AffordanceTaggingSetPresenter([NotNull] ApplicationPresenter applicationPresenter,
                                             [NotNull] AffordanceTaggingSetView view,
                                             [NotNull] AffordanceTaggingSet aff) : base(view, "ThisAffordanceTaggingSet.HeaderString", aff, applicationPresenter)
        {
            _affordanceTaggingSet = aff;
            foreach (var entry in aff.Entries)
            {
                entry.AllTags = aff.Tags;
            }

            RefreshStatistics();
            RefreshRefStatistics();
            Genders.Add(PermittedGender.Male);
            Genders.Add(PermittedGender.Female);
        }
Exemplo n.º 5
0
        public async Task Init()
        {
            var citiesList = await _cityService.GetAll <List <City> >(null);

            foreach (var city in citiesList)
            {
                Cities.Add(city);
            }

            var gendersList = await _genderService.GetAll <List <Gender> >(null);

            foreach (var gender in gendersList)
            {
                Genders.Add(gender);
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// Сохранить нового пользователя.
        /// </summary>
        public void CreateUser(string userName, string genderName, DateTime birthday, string budgetName)
        {
            if (string.IsNullOrWhiteSpace(genderName))
            {
                throw new ArgumentNullException(nameof(genderName));
            }
            if (string.IsNullOrWhiteSpace(budgetName))
            {
                throw new ArgumentNullException(nameof(budgetName));
            }
            if (birthday.Year < 1900 || birthday > DateTime.Now)
            {
                throw new ArgumentException(nameof(birthday));
            }
            if (Users.Contains(Users.SingleOrDefault(u => u.Name == userName)))
            {
                throw new ArgumentException(nameof(userName));
            }
            UserBudget budget = Budgets.SingleOrDefault(b => b.Name == budgetName);

            if (budget == null)
            {
                budget = new UserBudget(budgetName);
                Budgets.Add(budget);
                SaveBudgets();
            }
            Gender gender = Genders.SingleOrDefault(g => g.Name == genderName);

            if (gender == null)
            {
                gender = new Gender(genderName);
                Genders.Add(gender);
                SaveGenders();
            }

            var user = new User(userName, gender, birthday, budget.Id);

            Users.Add(user);
            SaveUsers();
        }
Exemplo n.º 7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="WorkbenchViewModel"/> class.
        /// </summary>
        public WorkbenchViewModel()
        {
            this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>();

            PluginContext.Host.UserConnected += (sender, e) => this.component = PluginContext.ComponentFactory.GetInstance <IPatientDataComponent>();

            this.Reputations = new ObservableCollection <ReputationDto>();
            this.Professions = new ObservableCollection <ProfessionDto>();
            this.Insurances  = new ObservableCollection <LightInsuranceDto>();
            this.Practices   = new ObservableCollection <LightPracticeDto>();
            this.Doctors     = new ObservableCollection <LightDoctorDto>();
            this.SearchTags  = new ObservableCollection <SearchTagDto>();

            this.Genders = new ObservableCollection <Tuple <string, Gender> >();
            Genders.Add(new Tuple <string, Gender>(Messages.Male, Gender.Male));
            Genders.Add(new Tuple <string, Gender>(Messages.Female, Gender.Female));

            this.sendPrivateMailCommand   = new RelayCommand(() => this.SendMail(this.SelectedPatient.PrivateMail), () => this.CanSendMail());
            this.sendProMailCommand       = new RelayCommand(() => SendMail(this.SelectedPatient.ProMail), () => this.CanSendMail());
            this.saveCommand              = new RelayCommand(() => this.Save(), () => this.CanSave());
            this.changeImageCommand       = new RelayCommand(() => this.ChangeImage(), () => this.CanChangeImage());
            this.deactivateCommand        = new RelayCommand(() => this.Deactivate(), () => this.CanDeactivate());
            this.setSelectedDoctorCommand = new RelayCommand(() => this.SetSelectedDoctor(), () => this.CanSetSelectedDoctor());
            this.refreshTagsCommand       = new RelayCommand(() => this.RefreshTags(), () => this.CanRefreshTags());

            PluginDataContext.Instance.DoctorBinded   += (sender, e) => this.Doctors.Add(e.Data);
            PluginDataContext.Instance.DoctorUnbinded += (sender, e) =>
            {
                var thisDoctor = (from d in this.Doctors
                                  where d.Id == e.Data.Id
                                  select d).FirstOrDefault();
                if (thisDoctor == null)
                {
                    return;
                }
                this.Doctors.Remove(thisDoctor);
            };
        }
Exemplo n.º 8
0
        //--------------------------------------------------------------------
        private void Form1_Load(object sender, EventArgs e)
        {
            Connection              = TryConnection();
            Connection.StateChange += (s, e) =>
            {
                DatabaseTitle.BackColor = Connection.State switch
                {
                    ConnectionState.Connecting => Color.FromArgb(255, 0, 0, 255),
                    ConnectionState.Open => Color.FromArgb(255, 0, 255, 0),
                    ConnectionState.Closed => Color.FromArgb(255, 255, 0, 0),

                    //ConnectionState.Executing => colorExecuting,
                    //ConnectionState.Fetching => colorFetching,
                    //ConnectionState.Broken => colorBroken,

                    _ => Color.FromArgb(255, 128, 128, 128)
                };
            };
            Connection.Open();

            DatabaseTitle.Text = Connection.Database.Substring((Connection.Database.LastIndexOf('\\') + 1), Connection.Database.Length - Connection.Database.LastIndexOf('\\') - 1);

            SqlCommand    cmd    = new(@"select Id, Name, Description from [Gender]", Connection);
            SqlDataReader reader = cmd.ExecuteReader();

            Genders = new();
            while (reader.Read())
            {
                Genders.Add(new Gender()
                {
                    Id          = reader.GetInt32(0),
                    Name        = reader.GetString(1),
                    Description = reader.GetString(2)
                });
            }
            reader.Close();
        }
Exemplo n.º 9
0
        protected void FillSearchCriterias()
        {
            SortAscending = false;
            Countries.Clear();
            Groups.Clear();
            Genders.Clear();
            CalendarPrivacy.Clear();
            MeasurementPrivacy.Clear();
            Photos.Clear();
            Plans.Clear();
            SearchStatus = string.Empty;
            SortOrders.Clear();

            foreach (var test in Country.Countries)
            {
                CheckListItem <Country> item = new CheckListItem <Country>(test.DisplayName, test);
                Countries.Add(item);
            }

            foreach (UserSearchGroup test in Enum.GetValues(typeof(UserSearchGroup)))
            {
                var item = new CheckListItem <UserSearchGroup>(EnumLocalizer.Default.Translate(test), test);
                Groups.Add(item);
            }

            foreach (Gender test in Enum.GetValues(typeof(Gender)))
            {
                var item = new CheckListItem <Gender>(EnumLocalizer.Default.Translate(test), test);
                Genders.Add(item);
            }

            foreach (PrivacyCriteria test in Enum.GetValues(typeof(PrivacyCriteria)))
            {
                var item = new CheckListItem <PrivacyCriteria>(EnumLocalizer.Default.Translate(test), test);
                CalendarPrivacy.Add(item);
            }
            foreach (PrivacyCriteria test in Enum.GetValues(typeof(PrivacyCriteria)))
            {
                var item = new CheckListItem <PrivacyCriteria>(EnumLocalizer.Default.Translate(test), test);
                MeasurementPrivacy.Add(item);
            }

            foreach (UsersSortOrder test in Enum.GetValues(typeof(UsersSortOrder)))
            {
                var item = new CheckListItem <UsersSortOrder>(EnumLocalizer.Default.Translate(test), test);
                SortOrders.Add(item);
            }

            foreach (PictureCriteria test in Enum.GetValues(typeof(PictureCriteria)))
            {
                var item = new CheckListItem <PictureCriteria>(EnumLocalizer.Default.Translate(test), test);
                Photos.Add(item);
            }
            foreach (UserPlanCriteria test in Enum.GetValues(typeof(UserPlanCriteria)))
            {
                var item = new CheckListItem <UserPlanCriteria>(EnumLocalizer.Default.Translate(test), test);
                Plans.Add(item);
            }


            SelectedCalendarPrivacy    = PrivacyCriteria.All;
            SelectedMeasurementPrivacy = PrivacyCriteria.All;
            SelectedPhoto     = PictureCriteria.All;
            SelectedPlan      = UserPlanCriteria.All;
            SelectedSortOrder = UsersSortOrder.ByLastLoginDate;
        }