예제 #1
0
        private void SuspectTable_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                DataGridViewRow cell = this.SuspectTable.Rows[e.RowIndex];
            }
            catch (ArgumentOutOfRangeException ex)
            {
                return;
            }
            DataGridViewRow             cells = this.SuspectTable.Rows[e.RowIndex];
            Inform                      form  = new Inform(suspects.ElementAt(Convert.ToInt32(cells.Cells[cells.Cells.Count - 1].Value)));
            Dictionary <string, string> Dict  = suspects.ElementAt(Convert.ToInt32(cells.Cells[cells.Cells.Count - 1].Value)).ReturnData();

            for (int i = 0; i < form.Controls.Count; i++)
            {
                foreach (KeyValuePair <string, string> comparer in Dict)
                {
                    if (form.Controls[i].Text.Equals(comparer.Key))
                    {
                        form.Controls[i].Text = comparer.Value;
                    }
                    if (form.Controls[i].Name.Equals(comparer.Key) && form.Controls[i].Name.Equals("Photo"))
                    {
                        PictureBox box = new PictureBox();
                        box = (PictureBox)form.Controls[i];
                        Bitmap Img = new Bitmap(comparer.Value);
                        box.Image    = Img;
                        box.SizeMode = PictureBoxSizeMode.StretchImage;
                    }
                    if (comparer.Key.Equals("Status") && form.Controls[i].Name.Equals("InterpolAction"))
                    {
                        PictureBox box = new PictureBox();
                        box = (PictureBox)form.Controls[i];
                        Bitmap Img;
                        if (comparer.Value == "In Jail")
                        {
                            Img          = new Bitmap(@"Images\busted.png");
                            box.SizeMode = PictureBoxSizeMode.Zoom;
                        }
                        else
                        {
                            Img          = new Bitmap(@"Images\LOGO_WANTED_V3_TORCIDO_ROJO.png");
                            box.SizeMode = PictureBoxSizeMode.StretchImage;
                        }
                        box.Image = Img;
                    }
                }
            }
            if (form.ShowDialog() != DialogResult.None)
            {
                this.chart1.Series[0].Points.Clear();
                FindStatistic(comboBox1.Text);
            }
        }
예제 #2
0
 private void find(SuspectCollection Collect, DataGridView Table, string Text)
 {
     Char[]   splitters  = { ';' };
     string[] findparams = Text.Split(splitters);
     Table.Rows.Clear();
     for (int i = 0; i < Collect.Count; i++)
     {
         if (Collect.ElementAt(i).MatchesQuery(findparams))
         {
             object[] array = Collect.ElementAt(i).HumanDataToArrayForDataBase();
             array[array.Length - 1] = i;
             Table.Rows.Add(array);
         }
     }
 }
예제 #3
0
 public static void PutActiveIntoTable(DataGridView Table, SuspectCollection Suspects)
 {
     Table.Rows.Clear();
     for (int i = 0; i < Suspects.Count; i++)
     {
         object[] array = Suspects.ElementAt(i).HumanDataToArrayForDataBase();
         array[array.Length - 1] = i;
         Table.Rows.Add(array);
     }
 }