private void поступлениеToolStripMenuItem_Click_1(object sender, EventArgs e) { AddRecord addRecord = new AddRecord(true, path); var result = addRecord.ShowDialog(); if (result == DialogResult.OK) { databaseHandler.WriteToFile(addRecord.firstName, addRecord.lastName, addRecord.patronymic, addRecord.gender, addRecord.isMother, addRecord.dateOfBirth, addRecord.dateOfEntry, addRecord.dateOfRetirement, addRecord.placeOfLiving, addRecord.bedProfile, addRecord.department, addRecord.status); databaseHandler.FillDataGridView(); } }
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex == -1 || e.ColumnIndex == -1) { return; } int id = Convert.ToInt32(dataGridView1[0, e.RowIndex].Value); DBRecord record = databaseHandler.FindRecordById(id); if (record == null) { return; } AddRecord addRecord = new AddRecord(false, @"S:\Projects\PatientRegistry\PatientRegistry\", record); var result = addRecord.ShowDialog(); if (result == DialogResult.OK) { databaseHandler.ModifyRegistry(id, addRecord.firstName, addRecord.lastName, addRecord.patronymic, addRecord.gender, addRecord.isMother, addRecord.dateOfBirth, addRecord.dateOfEntry, addRecord.dateOfRetirement, addRecord.placeOfLiving, addRecord.bedProfile, addRecord.department, addRecord.status); databaseHandler.FillDataGridView(); } }