Esempio n. 1
0
        public bool Insert(AirtimeBilling.Core.Entities.Note entity)
        {
            if (entity == null)
                throw new ArgumentNullException("No Note supplied.");

            if (entity.Id != null )
                throw new ArgumentNullException("Note Id is not null");

            try {
                using (var db = DbFactory.GetDataContext()) {
                    var note = new Note();

                    note.PopulateFromEntity(entity);
                    db.Notes.InsertOnSubmit(note);
                    db.SubmitChanges();

                    entity.Inserted(note.NoteId);
                    return true;
                }
            }
            catch (Exception ex) {
                LoggingUtility.LogException(ex);
                throw;
            }
        }