private void EditFleet() { if (adgvFleetList.Rows.Count == 0) { return; } FrmFleet form = new FrmFleet(); form.fleetId = adgvFleetList.CurrentRow.Cells["FLEET_ID"].Value.ToString(); form.fleetText = adgvFleetList.CurrentRow.Cells["FLEET_TEXT"].Value.ToString(); form.recordID = Convert.ToInt32(adgvFleetList.CurrentRow.Cells["ID"].Value); var rslt = form.ShowDialog(); if (form.dataChanged) { dataChanged = true; int col = adgvFleetList.CurrentCell.ColumnIndex; int row = adgvFleetList.CurrentCell.RowIndex; if (DS.Tables.Contains("FLEET_LIST")) { DS.Tables["FLEET_LIST"].Clear(); } fleetAdapter.Fill(DS, "FLEET_LIST"); adgvFleetList.CurrentCell = adgvFleetList[col, row]; } }
private void btnNew_Click(object sender, EventArgs e) { FrmFleet form = new FrmFleet(); form.fleetId = ""; form.fleetText = ""; form.recordID = 0; var rslt = form.ShowDialog(); if (form.recordID > 0) { dataChanged = true; if (DS.Tables.Contains("FLEET_LIST")) { DS.Tables["FLEET_LIST"].Clear(); } fleetAdapter.Fill(DS, "FLEET_LIST"); MainForm.LocateAdvGridRecord(form.fleetId, "FLEET_ID", 1, adgvFleetList); } }