private void gridMain_CellDoubleClick(object sender,ODGridClickEventArgs e) { FormJournalEntryEdit FormJ=new FormJournalEntryEdit(); FormJ.EntryCur=(JournalEntry)JournalList[e.Row]; FormJ.ShowDialog(); if(FormJ.EntryCur==null){//user deleted JournalList.RemoveAt(e.Row); } else if(FormJ.DialogResult==DialogResult.OK){ if(checkMemoSame.Checked) { for(int i=0;i<JournalList.Count;i++) { ((JournalEntry)JournalList[i]).Memo=FormJ.EntryCur.Memo; } } } FillCompound(); }
private void butAdd_Click(object sender,EventArgs e) { JournalEntry entry=new JournalEntry(); entry.TransactionNum=TransCur.TransactionNum; if(checkMemoSame.Checked && JournalList.Count>0){ entry.Memo=((JournalEntry)JournalList[0]).Memo; } //date gets set when closing. Everthing else gets set within following form. FormJournalEntryEdit FormJ=new FormJournalEntryEdit(); FormJ.IsNew=true; FormJ.EntryCur=entry; FormJ.ShowDialog(); if(FormJ.DialogResult==DialogResult.OK) { JournalList.Add(FormJ.EntryCur); if(checkMemoSame.Checked) { for(int i=0;i<JournalList.Count;i++) { ((JournalEntry)JournalList[i]).Memo=FormJ.EntryCur.Memo; } } } FillCompound(); }