public Category getValuesAsCategory(CategoryFilter cf) { string text = this.textBoxTitle.Text; List <Participant> participants = new List <Participant>(); foreach (DataGridViewRow row in (IEnumerable)this.dataGridViewParticipants.Rows) { if (row.Cells["FullName"].Value != null && row.Cells["Team"].Value != null) { int id = 0; if (row.Cells["id"].Value != null) { id = Convert.ToInt32(row.Cells["id"].Value.ToString()); } string name = row.Cells["FullName"].Value.ToString(); string team = row.Cells["Team"].Value.ToString(); Participant participant = new Participant(); participant.setName(name); participant.setTeam(team); if (id > 0) { participant.setId(id); } participants.Add(participant); } } return(new Category(text, participants, cf)); }
public CategoryFilter getInfo() { CategoryFilter categoryFilter = new CategoryFilter(); categoryFilter.ageMin = Convert.ToInt32(this.numericUpDownAgeMin.Value); categoryFilter.ageMax = Convert.ToInt32(this.numericUpDownAgeMax.Value); categoryFilter.weightMin = Convert.ToDouble(this.numericUpDownWeightMin.Value); categoryFilter.weightMax = Convert.ToDouble(this.numericUpDownWeightMax.Value); categoryFilter.kuMin = Convert.ToInt32(this.numericUpDownKuMin.Value); categoryFilter.kuMax = Convert.ToInt32(this.numericUpDownKuMax.Value); categoryFilter.sex = this.comboBoxSex.SelectedItem == null ? "F" : this.comboBoxSex.SelectedItem.ToString(); if (this.radioButtonTypeKata.Checked) { categoryFilter.type = CategoryType.Kata; } else if (this.radioButtonTypeKumite.Checked) { categoryFilter.type = CategoryType.Kumite; } else if (this.radioButtonTypeFukugo.Checked) { categoryFilter.type = CategoryType.Fukugo; } else if (this.radioButtonTypeIrigumi.Checked) { categoryFilter.type = CategoryType.Irigumi; } return(categoryFilter); }
public void addCategory(string name, CategoryFilter filter) { List <Participant> participants = new List <Participant>(); foreach (Team team in this.teams) { team.getParticipants().Shuffle <Participant>(); foreach (Participant participant in team.getParticipants()) { if (filter.participantMatch(participant)) { participant.setTeam(team.getName()); participants.Add(participant); } } } Category c = new Category(name, participants, filter); this.categories.Add(c); this.OnCategoryAdded(c); }
public void setFilter(CategoryFilter filter) { this.filter = filter; }
public Category(string name, CategoryFilter filter) { this.name = name; this.filter = filter; }
public Category(string name, List <Participant> participants, CategoryFilter filter) { this.name = name; this.participants = participants; this.filter = filter; }