private void изменитьЗаписьToolStripMenuItem_Click(object sender, EventArgs e) { var row = dgv.SelectedCells[0].OwningRow.Cells; newTroop f = new newTroop(); f.title.Text = (sender as ToolStripMenuItem).Text; f.id = row[0].Value.ToString(); f.name = row[1].Value.ToString(); f.sex = row[2].Value.ToString(); f.age = Convert.ToDecimal(row[3].Value); f.famStat = row[4].Value.ToString(); if (row[5].Value.ToString() == "0") { f.haveKids = false; } else { f.haveKids = true; } f.duty = row[6].Value.ToString(); f.uchStep = row[7].Value.ToString(); f.oklad = Convert.ToDecimal(row[8].Value); f.ShowDialog(); Update(); }
private void добавитьЗаписьToolStripMenuItem_Click(object sender, EventArgs e) { newTroop f = new newTroop(); f.title.Text = (sender as ToolStripMenuItem).Text; f.ShowDialog(); Update(); }