public void Delete(AttachmentDataCriteria criteria) { var data = MockDb.Attachments .Where(row => row.AttachmentId == criteria.AttachmentId) .Single(); MockDb.Attachments.Remove(data); }
public void Delete(AttachmentDataCriteria criteria) { var data = MockDb.Attachments .Where(row => row.AttachmentId == criteria.AttachmentId) .Single(); MockDb.Attachments.Remove(data); }
private void DataPortal_Delete(AttachmentDataCriteria criteria) { using (var dalManager = DataFactoryManager.GetManager()) { var dalFactory = dalManager.GetProvider <IAttachmentDataFactory>(); dalFactory.Delete(criteria); } }
public AttachmentData Fetch(AttachmentDataCriteria criteria) { var data = MockDb.Attachments .Where(row => row.AttachmentId == criteria.AttachmentId) .Single(); data = this.Fetch(data); return(data); }
public AttachmentData Fetch(AttachmentDataCriteria criteria) { var data = MockDb.Attachments .Where(row => row.AttachmentId == criteria.AttachmentId) .Single(); data = this.Fetch(data); return data; }
public void Delete(AttachmentDataCriteria criteria) { using (var ctx = Csla.Data.ObjectContextManager<ApplicationEntities> .GetManager(Database.ApplicationConnection, false)) { var attachment = this.Fetch(ctx, criteria) .Single(); ctx.ObjectContext.Attachments.DeleteObject(attachment); ctx.ObjectContext.SaveChanges(); } }
public void Delete(AttachmentDataCriteria criteria) { using (var ctx = Csla.Data.ObjectContextManager <ApplicationEntities> .GetManager(Database.ApplicationConnection, false)) { var attachment = this.Fetch(ctx, criteria) .Single(); ctx.ObjectContext.Attachments.DeleteObject(attachment); ctx.ObjectContext.SaveChanges(); } }
public AttachmentData Fetch(AttachmentDataCriteria criteria) { using (var ctx = Csla.Data.ObjectContextManager<ApplicationEntities> .GetManager(Database.ApplicationConnection, false)) { var attachment = this.Fetch(ctx, criteria) .Single(); var attachmentData = new AttachmentData(); this.Fetch(attachment, attachmentData); return attachmentData; } }
public AttachmentData Fetch(AttachmentDataCriteria criteria) { using (var ctx = Csla.Data.ObjectContextManager <ApplicationEntities> .GetManager(Database.ApplicationConnection, false)) { var attachment = this.Fetch(ctx, criteria) .Single(); var attachmentData = new AttachmentData(); this.Fetch(attachment, attachmentData); return(attachmentData); } }
public AttachmentData[] FetchInfoList(AttachmentDataCriteria criteria) { var query = MockDb.Attachments .AsQueryable(); var attachments = query.AsQueryable(); var data = new List <AttachmentData>(); foreach (var attachment in attachments) { data.Add(this.Fetch(attachment)); } return(data.ToArray()); }
private void DataPortal_Fetch(AttachmentDataCriteria criteria) { using (var dalManager = DataFactoryManager.GetManager()) { var dalFactory = dalManager.GetProvider <IAttachmentDataFactory>(); var data = dalFactory.Fetch(criteria); using (this.BypassPropertyChecks) { this.Fetch(data); } // this.ChildPropertyName = Csla.DataPortal.FetchChild<ChildPropertType>(data); } }
public AttachmentData[] FetchInfoList(AttachmentDataCriteria criteria) { var query = MockDb.Attachments .AsQueryable(); var attachments = query.AsQueryable(); var data = new List<AttachmentData>(); foreach (var attachment in attachments) { data.Add(this.Fetch(attachment)); } return data.ToArray(); }
private void DataPortal_Fetch(AttachmentDataCriteria criteria) { using (var dalManager = DataFactoryManager.GetManager()) { var dalFactory = dalManager.GetProvider <IAttachmentDataFactory>(); var data = dalFactory.FetchInfoList(criteria); this.RaiseListChangedEvents = false; this.IsReadOnly = false; this.AddRange(data.Select(row => Csla.DataPortal.FetchChild <AttachmentInfo>(row))); this.IsReadOnly = true; this.RaiseListChangedEvents = true; } }
private void DataPortal_Fetch(AttachmentDataCriteria criteria) { using (var dalManager = DataFactoryManager.GetManager()) { var dalFactory = dalManager.GetProvider<IAttachmentDataFactory>(); var data = dalFactory.FetchInfoList(criteria); this.RaiseListChangedEvents = false; this.IsReadOnly = false; this.AddRange(data.Select(row => Csla.DataPortal.FetchChild<AttachmentInfo>(row))); this.IsReadOnly = true; this.RaiseListChangedEvents = true; } }
public AttachmentData[] FetchLookupInfoList(AttachmentDataCriteria criteria) { using (var ctx = Csla.Data.ObjectContextManager <ApplicationEntities> .GetManager(Database.ApplicationConnection, false)) { var attachments = this.Fetch(ctx, criteria) .AsEnumerable(); var attachmentDataList = new List <AttachmentData>(); foreach (var attachment in attachments) { var attachmentData = new AttachmentData(); this.Fetch(attachment, attachmentData); attachmentDataList.Add(attachmentData); } return(attachmentDataList.ToArray()); } }
public AttachmentData[] FetchLookupInfoList(AttachmentDataCriteria criteria) { using (var ctx = Csla.Data.ObjectContextManager<ApplicationEntities> .GetManager(Database.ApplicationConnection, false)) { var attachments = this.Fetch(ctx, criteria) .AsEnumerable(); var attachmentDataList = new List<AttachmentData>(); foreach (var attachment in attachments) { var attachmentData = new AttachmentData(); this.Fetch(attachment, attachmentData); attachmentDataList.Add(attachmentData); } return attachmentDataList.ToArray(); } }
internal static AttachmentInfoList FetchAttachmentInfoList(AttachmentDataCriteria criteria) { return(Csla.DataPortal.Fetch <AttachmentInfoList>(criteria)); }
public static AttachmentInfoList AttachmentFetchInfoList(AttachmentDataCriteria criteria) { return AttachmentInfoList.FetchAttachmentInfoList(criteria); }
private void DataPortal_Fetch(AttachmentDataCriteria criteria) { using (var dalManager = DataFactoryManager.GetManager()) { var dalFactory = dalManager.GetProvider<IAttachmentDataFactory>(); var data = dalFactory.Fetch(criteria); using (this.BypassPropertyChecks) { this.Fetch(data); } // this.ChildPropertyName = Csla.DataPortal.FetchChild<ChildPropertType>(data); } }
internal static void DeleteAttachment(AttachmentDataCriteria criteria) { Csla.DataPortal.Delete<Attachment>(criteria); }
internal static AttachmentInfoList FetchAttachmentInfoList(AttachmentDataCriteria criteria) { return Csla.DataPortal.Fetch<AttachmentInfoList>(criteria); }
public static AttachmentInfoList AttachmentFetchInfoList(AttachmentDataCriteria criteria) { return(AttachmentInfoList.FetchAttachmentInfoList(criteria)); }
internal static void DeleteAttachment(AttachmentDataCriteria criteria) { Csla.DataPortal.Delete <Attachment>(criteria); }
private IQueryable<Attachment> Fetch( Csla.Data.ObjectContextManager<ApplicationEntities> ctx, AttachmentDataCriteria criteria) { IQueryable<Attachment> query = ctx.ObjectContext.Attachments .Include("CreatedByUser") .Include("ModifiedByUser"); if (criteria.AttachmentId != null) { query = query.Where(row => row.AttachmentId == criteria.AttachmentId); } if (criteria.FileType != null) { query = query.Where(row => row.FileType == criteria.FileType); } if (criteria.IsArchived != null) { query = query.Where(row => row.IsArchived == criteria.IsArchived); } if (criteria.Name != null) { query = query.Where(row => row.Name == criteria.Name); } if (criteria.SourceId != null) { query = query.Where(row => criteria.SourceId.Contains(row.SourceId)); } if (criteria.SourceTypeId != null) { query = query.Where(row => row.SourceTypeId == criteria.SourceTypeId); } if (criteria.CreatedBy != null) { query = query.Where(row => row.CreatedBy == criteria.CreatedBy); } if (criteria.CreatedDate != null && criteria.CreatedDate.DateFrom.Date != DateTime.MinValue.Date) { query = query.Where(row => row.CreatedDate >= criteria.CreatedDate.DateFrom); } if (criteria.CreatedDate != null && (criteria.CreatedDate.DateTo.Date != DateTime.MaxValue.Date)) { query = query.Where(row => row.CreatedDate <= criteria.CreatedDate.DateTo); } if (criteria.ModifiedBy != null) { query = query.Where(row => row.ModifiedBy == criteria.ModifiedBy); } if (criteria.ModifiedDate != null && criteria.ModifiedDate.DateFrom.Date != DateTime.MinValue.Date) { query = query.Where(row => row.ModifiedDate >= criteria.ModifiedDate.DateFrom); } if (criteria.ModifiedDate != null && (criteria.ModifiedDate.DateTo.Date != DateTime.MaxValue.Date)) { query = query.Where(row => row.ModifiedDate <= criteria.ModifiedDate.DateTo); } if (criteria.Text != null) { query = query.Where(row => row.Name.Contains(criteria.Text)); } if (criteria.SortBy != null) { query = query.OrderBy(string.Format( "{0} {1}", criteria.SortBy, criteria.SortOrder == ListSortDirection.Ascending ? "ASC" : "DESC")); } if (criteria.SkipRecords != null) { query = query.Skip(criteria.SkipRecords.Value); } if (criteria.MaximumRecords != null) { query = query.Take(criteria.MaximumRecords.Value); } return query; }
private IQueryable <Attachment> Fetch( Csla.Data.ObjectContextManager <ApplicationEntities> ctx, AttachmentDataCriteria criteria) { IQueryable <Attachment> query = ctx.ObjectContext.Attachments .Include("CreatedByUser") .Include("ModifiedByUser"); if (criteria.AttachmentId != null) { query = query.Where(row => row.AttachmentId == criteria.AttachmentId); } if (criteria.FileType != null) { query = query.Where(row => row.FileType == criteria.FileType); } if (criteria.IsArchived != null) { query = query.Where(row => row.IsArchived == criteria.IsArchived); } if (criteria.Name != null) { query = query.Where(row => row.Name == criteria.Name); } if (criteria.SourceId != null) { query = query.Where(row => criteria.SourceId.Contains(row.SourceId)); } if (criteria.SourceTypeId != null) { query = query.Where(row => row.SourceTypeId == criteria.SourceTypeId); } if (criteria.CreatedBy != null) { query = query.Where(row => row.CreatedBy == criteria.CreatedBy); } if (criteria.CreatedDate != null && criteria.CreatedDate.DateFrom.Date != DateTime.MinValue.Date) { query = query.Where(row => row.CreatedDate >= criteria.CreatedDate.DateFrom); } if (criteria.CreatedDate != null && (criteria.CreatedDate.DateTo.Date != DateTime.MaxValue.Date)) { query = query.Where(row => row.CreatedDate <= criteria.CreatedDate.DateTo); } if (criteria.ModifiedBy != null) { query = query.Where(row => row.ModifiedBy == criteria.ModifiedBy); } if (criteria.ModifiedDate != null && criteria.ModifiedDate.DateFrom.Date != DateTime.MinValue.Date) { query = query.Where(row => row.ModifiedDate >= criteria.ModifiedDate.DateFrom); } if (criteria.ModifiedDate != null && (criteria.ModifiedDate.DateTo.Date != DateTime.MaxValue.Date)) { query = query.Where(row => row.ModifiedDate <= criteria.ModifiedDate.DateTo); } if (criteria.Text != null) { query = query.Where(row => row.Name.Contains(criteria.Text)); } if (criteria.SortBy != null) { query = query.OrderBy(string.Format( "{0} {1}", criteria.SortBy, criteria.SortOrder == ListSortDirection.Ascending ? "ASC" : "DESC")); } if (criteria.SkipRecords != null) { query = query.Skip(criteria.SkipRecords.Value); } if (criteria.MaximumRecords != null) { query = query.Take(criteria.MaximumRecords.Value); } return(query); }
private void DataPortal_Delete(AttachmentDataCriteria criteria) { using (var dalManager = DataFactoryManager.GetManager()) { var dalFactory = dalManager.GetProvider<IAttachmentDataFactory>(); dalFactory.Delete(criteria); } }