/// <summary> /// Initializes a new instance of the <see cref="ContractNoteLogic"/> class. /// </summary> /// <param name="contractRepository">The contract repository.</param> public ContractNoteLogic(IContractNoteRepository contractRepository) { if (contractRepository != null) { _contractNotesRepository = contractRepository; } }
/// <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(); }
/// <summary> /// Initializes a new instance of the <see cref="ContractNoteLogic"/> class. /// </summary> /// <param name="connectionString">The connection string.</param> public ContractNoteLogic(string connectionString) { _contractNotesRepository = Factory.CreateInstance <IContractNoteRepository>(connectionString, true); }