예제 #1
0
        public RequestsDataSource()
        {
            var rqds = new RequestDataSource();
            _requestsList = rqds.Select();

            var rds = new RateDataSource();
            _rates = rds.SelectAll();
            _rates = (from r in _rates select r);
        }
        public ViewReportDataSource()
        {
            var entities = new List<EntitySet>(EntitySetRepository.GetEntitySets().AsEnumerable());

            var rqds = new RequestDataSource();
            var requestsList = rqds.Select();

            _entities = entities.ToDictionary(
                e => Helper.GenerateDatasetItemKey(e.ContainerAlias, e.EntitySetName),
                e => e);

            _requestsList = requestsList.ToDictionary(
                e => Helper.GenerateRequestKey(e.RowKey),
                e => e);
        }
예제 #3
0
        private static IEnumerable<Comment> CreateCommentEnumerator(IEnumerable<CommentEntry> comments)
        {
            var reqDS = new RequestDataSource();
            var requests = reqDS.Select().ToDictionary(t => t.RowKey, t => t.Subject);

            var entities = new Dictionary<String, String>();

            foreach(EntitySet e in EntitySetRepository.GetEntitySets())
                entities[e.ContainerAlias + e.EntitySetName] = e.Name;

            return (from comm in comments
                    select new Comment()
                    {
                        RowKey = comm.RowKey,
                        Author = comm.Username,
                        Body = comm.Comment,
                        ParentName = comm.DatasetId,
                        ParentType = comm.ParentType,
                        ParentContainer = comm.PartitionKey,
                        ParentDisplay = GetParentDisplayName(comm, requests, entities),
                        Posted = comm.PostedOn,
                        Status = comm.Status,
                        Subject = comm.Subject,
                        Type = comm.Type,
                        Email = comm.Email
                    }).OrderBy(t => t.Posted);
        }