void HandleTransactionListDoubleClick(object sender, EventArgs e) { // Edit an existing transaction entry if (EventList.SelectedItem != null) { string IDOfRowForTransaction = EventList.SelectedValue.ToString (); TransactionWorkLog foundNote = (TransactionWorkLog)LayoutDetails.Instance.TransactionsList.GetExisting (new database.ColumnConstant[2] {TransactionsTable.TYPE, TransactionsTable.ID}, new string[2] { TransactionsTable.T_USER.ToString (), IDOfRowForTransaction.ToString () }); if (foundNote != null) { int Words = foundNote.Words; int Minutes = foundNote.Minutes; string Category =foundNote.Category; string Notes = foundNote.Notes; AddEditWorkForm AddEdit = new AddEditWorkForm (Words, Minutes, Category, Notes); if (AddEdit.ShowDialog () == DialogResult.OK) { // TransactionWorkLog Work = new TransactionWorkLog(oldDate, this._GUID, AddEdit.Note, AddEdit.Words, AddEdit.Minutes, AddEdit.CategoryText); // if in add mode we Add a new entry //LayoutDetails.Instance.TransactionsList.UpdateEvent(new TransactionWorkLog(DateTime.Now, _GUID, AddEdit.Note, AddEdit.Words, AddEdit.Minutes, AddEdit.CategoryText)); foundNote.Words = AddEdit.Words; foundNote.Minutes = AddEdit.Minutes; foundNote.Notes = AddEdit.Note; foundNote.Category = AddEdit.CategoryText; LayoutDetails.Instance.TransactionsList.UpdateEvent (foundNote); UpdateScreen (); ExportIfNeeded (foundNote.Minutes); } } else { NewMessage.Show (Loc.Instance.GetStringFmt ("Unusual Error... unable to retrieve this transaction. ID = {0}", IDOfRowForTransaction)); } } }
void AddEntry() { AddEditWorkForm AddEdit = new AddEditWorkForm (); if (AddEdit.ShowDialog () == DialogResult.OK) { if (CurrentDate != null) { // if in add mode we Add a new entry LayoutDetails.Instance.TransactionsList.AddEvent(new TransactionWorkLog(CurrentDate(), _GUID, AddEdit.Note, AddEdit.Words, AddEdit.Minutes, AddEdit.CategoryText)); ExportIfNeeded (AddEdit.Minutes); } else { NewMessage.Show ("A date was not passed into the AddEntry method."); } UpdateScreen (); } }