Exemple #1
0
        private void button_Edit_Click(object sender, EventArgs e)
        {
            try
            {
                string selected = "";
                foreach (ListViewItem item in listViewAccident.SelectedItems)
                {
                    selected = item.Text;
                }

                if (selected == "")
                {
                    MessageBox.Show("Выберете что изменять");
                    return;
                }
                //находим по времени происшествие
                foreach (var var in AccidentObj.AccidentList)
                {
                    if (var.DataTime == selected)
                    {
                        AccidentObj.ObjAccident = var;
                    }
                }
                Button = "Edit";
                AddAccidentForm newForm = new AddAccidentForm();
                newForm.Show();
            }
            catch (Exception e1)
            {
                myException = new MyException(e1);
            }
        }
Exemple #2
0
        private void button_Add_Click(object sender, EventArgs e)
        {
            Button = "Add";
            AddAccidentForm newForm = new AddAccidentForm();

            newForm.Show();
        }