Example #1
0
        public void SetEntity(EntityBase entity)
        {
            EntityId = entity.Id.Value;
            EntityType = entity.GetEntityName();

            PopulateNotes();
        }
Example #2
0
        public IList<Activity> FindActivitiesByEntity(EntityBase entity)
        {
            if (entity != null)
            {
                if (string.IsNullOrEmpty(entity.GetEntityName())) throw new Exception("A table name must be supplied");
                if (entity.Id == null) throw new Exception("Cannot get Activity Log of unsaved entities");

                return FindActivitiesByWhereClause(string.Format("TableName = '{0}' AND KeyId = {1}", entity.GetEntityName(), entity.Id.Value));
            }
            return new List<Activity>();
        }
Example #3
0
        public IList<AirtimeBilling.Core.Entities.Note> GetNotesFor(EntityBase entity)
        {
            using (var db = DbFactory.GetDataContext()) {

                var notes =
                    db.Notes.Where(n => n.Type == entity.GetEntityName() && n.EntityId == entity.Id)
                            .OrderByDescending(n => n.NoteDate);

                return notes.Select(note => note.CreateEntity()).ToList();
            }
        }
Example #4
0
 public IList<Note> GetNotesFor(EntityBase entity)
 {
     return _noteRepository.GetNotesFor(entity);
 }
Example #5
0
 private void WriteActivity(EntityBase entity, string message)
 {
     LoggingUtility.WriteActivity(entity.GetEntityName(), entity.Id.Value, message);
 }