コード例 #1
0
 private void pnl_MouseLeftButtonUp(object sender, MouseButtonEventArgs e, EntityReportDTO report)
 {
     if (ReportClicked != null)
     {
         ReportClicked(this, new ReportClickedArg()
         {
             ReportID = report.ID
         });
     }
 }
コード例 #2
0
        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);
        }
コード例 #3
0
 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);
         }
     }
 }
コード例 #4
0
        //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;
            }
        }
コード例 #5
0
        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);
        }
コード例 #6
0
 internal void ToUpdateEntityReport(EntityReport entityReport, EntityReportDTO message)
 {
     entityReport.Title = message.ReportTitle;
 }