Esempio n. 1
0
 private void btnAddEvent_Click(object sender, EventArgs e)
 {
     try
     {
         frmAddUpdateCriminalRecord addCriminalRecord = new frmAddUpdateCriminalRecord();
         addCriminalRecord.Save  += AddUpdateCriminalRecord_Save;
         addCriminalRecord.Audit += Search_Audit;
         addCriminalRecord.Show();
     }
     catch (Exception ex)
     {
         Audit($"שגיאת הוספת אירוע: {ex.Message}", AuditSeverity.Critical);
     }
 }
Esempio n. 2
0
        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);
            }
        }