Esempio n. 1
0
 /// <summary>
 /// New Note
 /// </summary>
 public void NewNote()
 {
     CurrentNote = new ContractNote(0, _contractId, DateTime.Now, UserId, "<Type Text Here>");
     ContractNotes.Add(CurrentNote);
     IndexText = (ContractNotes.IndexOf(_currentNote) + 1).ToString() + " of " + ContractNotes.Count.ToString();
     OnPropertyChanged("ContractNotes");
 }
Esempio n. 2
0
        /// <summary>
        /// Remove the active Note from the list
        /// </summary>
        public void Remove()
        {
            if (CurrentNote != null)
            {
                // If note as not just created - not residing in the database
                if (CurrentNote.ID != 0)
                {
                    IContractNoteRepository target = Billing.Data.BillingDataFactory.NewInstance().CreateContractNoteRepository();
                    target.Remove(CurrentNote);
                }
                ContractNotes.Remove(CurrentNote);

                if (ContractNotes.Count > 0)
                {
                    CurrentNote = ContractNotes[0];
                }
            }
            EnsureOneNote();
        }