public void SetEntity(EntityBase entity) { EntityId = entity.Id.Value; EntityType = entity.GetEntityName(); PopulateNotes(); }
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>(); }
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(); } }
public IList<Note> GetNotesFor(EntityBase entity) { return _noteRepository.GetNotesFor(entity); }
private void WriteActivity(EntityBase entity, string message) { LoggingUtility.WriteActivity(entity.GetEntityName(), entity.Id.Value, message); }