Esempio n. 1
0
 private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (Util.Confirm("Are you sure?"))
     {
         bool ors = _dtCtrl.DeleteAttendanceRecord(editRecordId);
         MessageBox.Show(ors ? "successful" : "error");
         if (ors)
         {
             LoadAttdanceLog();
         }
     }
 }
 private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (Util.Confirm("Are you sure you want to delete this record? This cannot be undone."))
     {
         if (_dtCtrl.DeleteAttendanceRecord(_curAttendanceLogRecord.ID))
         {
             MessageBox.Show("Record deleted.");
             LoadAttdanceLog();
         }
         else
         {
             MessageBox.Show("Record could not be deleted. Please try again.");
         }
     }
 }
Esempio n. 3
0
        private void DelRecord()
        {
            try
            {
                _startPoint = DateTime.Now.Ticks;

                SetState(1);
                int toBeDeleted = _attRecordList.Count;

                Invoke(new InitProgressCallBack(InitProgress), new object[] { toBeDeleted });
                Invoke(new SetTextCallBack(SetText), new object[] { txtProgress, "" });
                Invoke(new SetTextCallBack(SetText), new object[] { txtDuration, "" });

                int deleteing = 0;
                int deleted   = 0;

                for (int i = toBeDeleted - 1; i >= 0; i--)
                {
                    AttendanceRecord attRecord = _attRecordList[i];

                    deleteing++;
                    if (_dtCtrl.DeleteAttendanceRecord(attRecord.ID))
                    {
                        _attRecordList.RemoveAt(i);
                        deleted++;
                    }

                    string textProgress = "Deleting: " + deleteing + "/" + toBeDeleted + " (Deleted: " + deleted + ")";

                    Invoke(new AddProgressCallBack(AddProgress), new object[] { 1 });
                    Invoke(new SetTextCallBack(SetText), new object[] { txtProgress, textProgress });
                    Invoke(new SetTextCallBack(SetText), new object[] { txtDuration, GetDuration() });
                }

                MessageBox.Show(deleted + " records have been deleted");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            SetState(0);
        }
Esempio n. 4
0
 private void DelAttRecord()
 {
     _dtCtrl.DeleteAttendanceRecord(attRecord.ID);
 }