private void btnUpdateEvent_Click(object sender, EventArgs e) { try { int rowIndex = dgvEventsLog.SelectedRows[0].Index; if (rowIndex == Constants.NONE) { return; } CriminalEventType type = (CriminalEventType)(dgvEventsLog.Rows[rowIndex].Cells[14].Value); Guid id = (Guid)(dgvEventsLog.Rows[rowIndex].Cells[10].Value); int houseNumber = (int)(dgvEventsLog.Rows[rowIndex].Cells[13].Value); DateTime time = (DateTime)(dgvEventsLog.Rows[rowIndex].Cells[11].Value); string street = dgvEventsLog.Rows[rowIndex].Cells[12].Value.ToString(); string family = dgvEventsLog.Rows[rowIndex].Cells[5].Value.ToString(); string description = dgvEventsLog.Rows[rowIndex].Cells[0].Value.ToString(); string whatWasStolen = dgvEventsLog.Rows[rowIndex].Cells[3].Value.ToString(); string arrivalDirection = dgvEventsLog.Rows[rowIndex].Cells[2].Value.ToString(); string whoArrivedAfterTheEvent = dgvEventsLog.Rows[rowIndex].Cells[1].Value.ToString(); CriminalEvent criminalEvent = new CriminalEvent(type, id, houseNumber, time, street, family, description, whatWasStolen, arrivalDirection, whoArrivedAfterTheEvent); frmAddUpdateCriminalRecord updateCriminalRecord = new frmAddUpdateCriminalRecord(criminalEvent); updateCriminalRecord.Save += AddUpdateCriminalRecord_Save; updateCriminalRecord.Show(); } catch (Exception ex) { Audit($"שגיאת עדכון אירוע: {ex.Message}", AuditSeverity.Critical); } }
public CriminalEvent(CriminalEventType type, Guid id, int houseNumber, DateTime time, string street, string family, string description, string whatWasStolen, string arrivalDirection, string whoArrivedAfterTheEvent) { Type = type; Id = id; HouseNumber = houseNumber; Time = time; Street = street; Family = family; Description = description; WhatWasStolen = whatWasStolen; ArrivalDirection = arrivalDirection; WhoArrivedAfterTheEvent = whoArrivedAfterTheEvent; }
public static string CriminalEventTypeTypeToText(CriminalEventType criminalEventType) { return(GetEnumDescription(criminalEventType)); }