private void pnl_MouseLeftButtonUp(object sender, MouseButtonEventArgs e, EntityReportDTO report) { if (ReportClicked != null) { ReportClicked(this, new ReportClickedArg() { ReportID = report.ID }); } }
internal EntityReport ToNewEntityReport(EntityReportDTO message) { var result = new EntityReport(); result.SecurityObject = new SecurityObject(); result.SecurityObject.Type = (int)DatabaseObjectCategory.Report; result.TableDrivedEntityID = message.TableDrivedEntityID; result.ReportType = (Int16)message.ReportType; result.Title = message.ReportTitle; return(result); }
public EntityReportDTO GetEntityReport(DR_Requester requester, int EntityReportID, bool withDetails) { //withSearchInfo این یجوریه! حذف بشه using (var projectContext = new DataAccess.MyProjectEntities()) { var dbItem = projectContext.EntityReport.First(x => x.ID == EntityReportID); if (DataIsAccessable(requester, dbItem)) { var nItem = new EntityReportDTO(); ToEntityReportDTO(dbItem, nItem, withDetails); return(nItem); } else { return(null); } } }
//private EntityReportDTO ToEntityReportDTO(EntityReport item) //{ // EntityReportDTO result = new EntityReportDTO(); // result.TableDrivedEntityID = item.TableDrivedEntityID; // result.ID = item.ID; // result.ReportType = (ReportType)item.ReportType; // result.ReportTitle = item.Title; // return result; //} internal void ToEntityReportDTO(EntityReport entityReport, EntityReportDTO entityReportDTO, bool withDetails) { entityReportDTO.ID = entityReport.ID; entityReportDTO.ReportType = (ReportType)entityReport.ReportType; entityReportDTO.TableDrivedEntityID = entityReport.TableDrivedEntityID; entityReportDTO.ReportTitle = entityReport.Title; if (entityReport.EntitySearchableReport != null) { entityReportDTO.SearchableReportType = (SearchableReportType)entityReport.EntitySearchableReport.SearchableReportType; if (withDetails == true) { if (entityReport.EntitySearchableReport.SearchRepository != null) { entityReportDTO.SearchRepository = new BizSearchRepository().ToSearchRepositoryDTO(entityReport.EntitySearchableReport.SearchRepository); } } } if (entityReport.EntityDataItemReport != null) { entityReportDTO.DataItemReportType = (DataItemReportType)entityReport.EntityDataItemReport.DataItemReportType; } }
public List <EntityReportDTO> GetEntityReports(DR_Requester requester, int entityID) { //var cachedItem = CacheManager.GetCacheManager().GetCachedItem(CacheItemType.Validation, entityID.ToString()); //if (cachedItem != null) // return (cachedItem as List<EntityReportDTO>); List <EntityReportDTO> result = new List <EntityReportDTO>(); using (var projectContext = new DataAccess.MyProjectEntities()) { var listEntityReport = projectContext.EntityReport.Where(x => x.TableDrivedEntityID == entityID); foreach (var dbItem in listEntityReport) { if (DataIsAccessable(requester, dbItem)) { var nItem = new EntityReportDTO(); ToEntityReportDTO(dbItem, nItem, false); result.Add(nItem); } } } //CacheManager.GetCacheManager().AddCacheItem(result, CacheItemType.Validation, entityID.ToString()); return(result); }
internal void ToUpdateEntityReport(EntityReport entityReport, EntityReportDTO message) { entityReport.Title = message.ReportTitle; }