Example #1
0
        private void buttonEdit_Click(object sender, EventArgs e)
        {
            string fio = "";

            try
            {
                fio = dataGridView1.SelectedRows[0].Cells[0].Value.ToString();
            }
            catch {}

            Soldier soldier = soldiers.Where(s => s.FIO == fio).FirstOrDefault();

            if (soldier == null)
            {
                MessageBox.Show("Select Soldier!");
                return;
            }
            else
            {
                edittingSolder = soldier;
                FormAddEditSoldier formAddEditSoldier = new FormAddEditSoldier(this, soldier);
                formAddEditSoldier.ShowDialog();
            }
        }
Example #2
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            FormAddEditSoldier formAddEdit = new FormAddEditSoldier(this);

            formAddEdit.ShowDialog();
        }