private void newToolStripMenuItem_Click(object sender, EventArgs e) { Adding AddForm = new Adding(SuspectTable, wholeCollection); if (AddForm.ShowDialog() != DialogResult.None) { loadList(); Methods.PutActiveIntoTable(SuspectTable, suspects); comboBox1.Text = "All Time"; this.chart1.Series[0].Points.Clear(); FindStatistic("All Time"); } }
private void button2_Click(object sender, EventArgs e) { string city = comboBox3.Text + '>' + textBox6.Text; string story = textBox3.Text; if (Methods.ifCheck(textBox3, textBox6)) { textBox6.BackColor = Color.FromArgb(255, 128, 128); textBox3.BackColor = Color.FromArgb(255, 128, 128); return; } string date = dateTimePicker2.Value.ToString("dd/MM/yyyy"); if (city == ">" || story == "" || date == "") { return; } checkForDateStory(dateTimePicker2.Value); dataGridView2.Rows.Add(city, story, date); this.story.Add(city + '#' + story + '=' + date); Methods.PutActiveIntoTable(table, suspect); }
private void Interpole_Load(object sender, EventArgs e) { SuspectTable.Rows.Clear(); Methods.PutActiveIntoTable(SuspectTable, suspects); FindStatistic("All Time"); }
private void mainToolStripMenuItem_Click(object sender, EventArgs e) { SuspectTable.Rows.Clear(); Methods.PutActiveIntoTable(SuspectTable, suspects); }
private void button4_Click(object sender, EventArgs e) { for (int i = this.Controls.Count - 1; i >= 0; i--) { if (this.Controls[i].GetType().Name.ToLower().Equals("textbox")) { if (this.Controls[i].GetType().Name.ToLower().Equals("textbox") && Methods.ifCheck((TextBox)this.Controls[i])) { this.Controls[i].BackColor = Color.FromArgb(255, 128, 128); return; } if (this.Controls[i].Text.Length == 0) { if (!this.Controls[i].Name.Equals("textBox3") && !this.Controls[i].Name.Equals("textBox6")) { this.Controls[i].BackColor = Color.FromArgb(255, 128, 128); return; } } } } if (crimes.Count == 0 && story.Count == 0) { MessageBox.Show("Suspect must have at least one crime and one fact"); return; } if (checkYears()) { return; } string[] pointers = { "name", "surname", "patro", "birth", "placeofb", "build", "hair", "eyes", "height", this.crimes.Count.ToString(), findLastCrime(), "wife", "children", findLastPos(), crimesToString(), "searchedin", "status", this.photo, storyToString() }; for (int i = 0; i < pointers.Length; i++) { for (int j = 0; j < this.Controls.Count; j++) { if (this.Controls[j].Name.Equals(pointers[i]) && this.Controls[j].GetType().Name.ToLower().Equals("textbox")) { pointers[i] = this.Controls[j].Text; } if (this.Controls[j].Name.Equals(pointers[i]) && this.Controls[j].GetType().Name.ToLower().Equals("combobox")) { pointers[i] = this.Controls[j].Text.Trim(); } if (this.Controls[j].Name.Equals(pointers[i]) && this.Controls[j].GetType().Name.ToLower().Equals("checkbox")) { pointers[i] = ((CheckBox)this.Controls[j]).Checked.ToString(); } if (this.Controls[j].Name.Equals(pointers[i]) && this.Controls[j].GetType().Name.ToLower().Equals("monthcalendar")) { pointers[i] = ((MonthCalendar)this.Controls[j]).SelectionRange.Start.ToString("dd/MM/yyyy"); } if (this.Controls[j].Name.Equals(pointers[i]) && this.Controls[j].GetType().Name.ToLower().Equals("numericupdown")) { pointers[i] = ((NumericUpDown)this.Controls[j]).Value.ToString(); } } } suspect.Add(new Suspect(String.Join("~", pointers))); Methods.PutActiveIntoTable(table, suspect); this.Close(); }