private void button_ok_Click(object sender, EventArgs e) { try { var selectedName = MyComboBox.GetComboBoxValue(comboBox_all_admins); _manhattanInfo.CurrentAdmin = _administrators.Find(x => x.Name.Equals(selectedName)); } catch (Exception) { MessageBox.Show(@"Exception admins select"); } DialogResult = DialogResult.OK; Close(); }
private void comboBox_TypeTren_SelectedValueChanged(object sender, EventArgs e) { var combo = (ComboBox)sender; try { _typeWorkout = MyComboBox.GetComboBoxValue <TypeWorkout>(combo); } catch (Exception) { MessageBox.Show(@"Exception 2"); } UpdateCorrectFieldsEn(); }
private void UpdateCorrectFieldsEn() { // Выходим если не нужна корректировка if (!checkBox_Activated.Checked) { return; } comboBox_Tren.Enabled = false; comboBox_Personal.Enabled = false; comboBox_Aerob.Enabled = false; comboBox_freez.Enabled = false; if (radioButton_Abonement.Checked) { if (comboBox_TypeTren.SelectedItem != null) { _typeWorkout = MyComboBox.GetComboBoxValue <TypeWorkout>(comboBox_TypeTren); switch (_typeWorkout) { case TypeWorkout.Тренажерный_Зал: comboBox_Tren.Enabled = true; break; case TypeWorkout.Аэробный_Зал: comboBox_Aerob.Enabled = true; break; case TypeWorkout.Персональная: comboBox_Personal.Enabled = true; break; case TypeWorkout.МиниГруппа: comboBox_Personal.Enabled = true; break; } comboBox_freez.Enabled = true; } } if (radioButton_ClubCard.Checked) { comboBox_Personal.Enabled = true; comboBox_freez.Enabled = true; comboBox_Aerob.Enabled = true; } }
private void comboBox_Status_SelectedIndexChanged(object sender, EventArgs e) { if (comboBox_Status.SelectedItem.ToString().Equals(NotMatter)) // Если не важен статус выводим всех элементов { _reqStatuses = _personsAll.Values; } else { var status = MyComboBox.GetComboBoxValue <StatusPerson>(comboBox_Status); _reqStatuses = _personsAll.Where(x => x.Value?.Status == status).Select(x => x.Value); } var result = GetUpdatedRequestsAsync(); ShowPersons(result.Result); }
private void ProcessComboBox(ComboBox cmbox) { if (cmbox.SelectedItem == null) { return; } var gender = MyComboBox.GetComboBoxValue <Gender>(cmbox); if (gender == Gender.Неизвестен) { _dataStateOk.Gender = false; cmbox.BackColor = Color.Pink; } else { _dataStateOk.Gender = true; _dataStruct.Gender = gender; cmbox.BackColor = Color.PaleGreen; } }
private async void comboBox_LastVisit_SelectedIndexChanged(object sender, EventArgs e) { var lVisit = MyComboBox.GetComboBoxValue(comboBox_LastVisit); // Если последний визит не важен -выходим if (lVisit.Equals(_lastVisits[0])) { _reqLastVisit = _personsAll.Values; } else { var dataInPast = DateTime.Now.Subtract(new TimeSpan(30, 0, 0, 0)).Date;//Вычитаем 30 дней var fullJournal = DataBaseLevel.GetPersonsVisitDict(); var resultByCondition = fullJournal.Where(x => x.Value?.Last().DateTimeVisit.CompareTo(dataInPast) <= 0).Select(x => x.Key); var resultConverted = resultByCondition.Select(PersonObject.GetLink); _reqLastVisit = resultConverted.ToList(); } var result = await GetUpdatedRequestsAsync(); ShowPersons(result); }
private void comboBox_Names_SelectedIndexChanged(object sender, EventArgs e) { SelectedName = MyComboBox.GetComboBoxValue((ComboBox)sender); }
private void ComboBox_ClubCard_SelectedIndexChanged(object sender, EventArgs e) { var combo = (ComboBox)sender; _periodClubCard = MyComboBox.GetComboBoxValue <PeriodClubCard>(combo); }
private void ComboBox_Abonem_SelectedIndexChanged(object sender, EventArgs e) { var combo = (ComboBox)sender; _daysInAbon = MyComboBox.GetComboBoxValue <DaysInAbon>(combo); }
private void ComboBox_Pay_SelectedIndexChanged(object sender, EventArgs e) { var combo = (ComboBox)sender; _pay = MyComboBox.GetComboBoxValue <Pay>(combo); }
private void ComboBox_spa_SelectedIndexChanged(object sender, EventArgs e) { var combo = (ComboBox)sender; _spa = MyComboBox.GetComboBoxValue <SpaService>(combo); }
private void ComboBox_time_SelectedIndexChanged(object sender, EventArgs e) { var combo = (ComboBox)sender; _timeTren = MyComboBox.GetComboBoxValue <TimeForTr>(combo); }