override public void Subscribe(Subscription Sub)
    {
        base.Subscribe(Sub);
        TopicMap NewMap;

        //Search through all mappings
        foreach (TopicMap tm in TopicMapping)
        {
            if (Sub.MatchesTopic(tm.Topic))
            {
                tm.Subscribers.Add(Sub);

                //Send last data recived
                if (tm.LastDataPoint != null)
                {
                    Sub.TimeDataUpdate(tm.LastDataPoint);
                }

                return;
            }
        }

        NewMap       = new TopicMap();
        NewMap.Topic = Sub.Topic;
        NewMap.Subscribers.Add(Sub);
        NewMap.Subscribed = SubscribeTopic(Sub.Topic);
        TopicMapping.Add(NewMap);
    }
예제 #2
0
        public TopicMap BuildFromRow(DataRow row)
        {
            var returnRecord = TopicMap.BuildTopicMapFromRow(row);

            returnRecord = this.BuildExtraFromRow <TopicMap>(returnRecord, row);
            return(returnRecord);
        }
예제 #3
0
        public TopicMap Insert(TopicMap record)
        {
            DataRow row = this.dataSet.ttbltopicMap.NewttbltopicMapRow();

            this.UpdateToRow(ref row, record);
            this.ExtraUpdateToRow(ref row, record);
            this.dataSet.ttbltopicMap.AddttbltopicMapRow((pdstopicMapDataSet.ttbltopicMapRow)row);
            this.SaveChanges();
            return(this.dataSet.ttbltopicMap.Rows.Count > 0 ? this.BuildFromRow(this.dataSet.ttbltopicMap.Rows[0]) : null);
        }
예제 #4
0
        public TopicMap GetByRowId(string rowId, string fldList)
        {
            var      row      = this.GetRowByRowId(rowId, fldList);
            TopicMap topicMap = null;

            if (row != null)
            {
                topicMap = this.BuildFromRow(row);
            }
            return(topicMap);
        }
예제 #5
0
        protected TopicMap Fetch(string where, int batchsize, string fldList)
        {
            this.FetchWhere(where, batchsize, fldList);
            var      row      = this.dataSet.ttbltopicMap.AsEnumerable().SingleOrDefault();
            TopicMap topicMap = null;

            if (row != null)
            {
                topicMap = this.BuildFromRow(row);
            }
            return(topicMap);
        }
예제 #6
0
        protected override void ApplicationStartup(TinyIoCContainer container, IPipelines pipelines)
        {
            var category = new CategoryMap();
            var author   = new AuthorMap();
            var topic    = new TopicMap();

            _cryptographyConfiguration = new CryptographyConfiguration(
                new AesEncryptionProvider(new PassphraseKeyGenerator("SuperSecretPass", new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 })),
                new DefaultHmacProvider(new PassphraseKeyGenerator("UberSuperSecure", new byte[] { 1, 2, 3, 4, 5, 6, 7, 8 })));

            base.ApplicationStartup(container, pipelines);
        }
예제 #7
0
        public void Delete(TopicMap record)
        {
            var row = this.GetRowByRowId(record.rowID, string.Empty);

            if (row == null)
            {
                row = this.dataSet.ttbltopicMap.NewttbltopicMapRow();
                TopicMap.BuildMinimalRow(ref row, record);
                this.dataSet.ttbltopicMap.AddttbltopicMapRow((pdstopicMapDataSet.ttbltopicMapRow)row);
            }
            row.Delete();
            this.SaveChanges();
        }
예제 #8
0
 protected override void OnModelCreating(ModelBuilder builder)
 {
     UserMap.Configure(builder);
     PersonMap.Configure(builder);
     PersonCheckListItemMap.Configure(builder);
     PersonCheckListMap.Configure(builder);
     QuizMap.Configure(builder);
     QuestionMap.Configure(builder);
     AnswerMap.Configure(builder);
     TopicCategoryMap.Configure(builder);
     TopicMap.Configure(builder);
     SupportingScriptureMap.Configure(builder);
     PersonAnswerMap.Configure(builder);
 }
예제 #9
0
        public TopicMap Update(TopicMap record)
        {
            var row = this.GetRowByRowId(record.rowID, string.Empty);

            if (row != null)
            {
                this.UpdateToRow(ref row, record);
                this.ExtraUpdateToRow(ref row, record);
                this.SaveChanges();
                return(this.dataSet.ttbltopicMap.Rows.Count > 0 ? this.BuildFromRow(this.dataSet.ttbltopicMap.Rows[0]) : null);
            }
            ErrorReportingHelper.ReportErrors("global.update.doesnotexist", 421);
            return(null);
        }
예제 #10
0
 public void Delete(TopicMap record)
 {
     this.repository.Delete(record);
 }
예제 #11
0
 public TopicMap Update(TopicMap record)
 {
     return(this.repository.Update(record));
 }
예제 #12
0
 public TopicMap Insert(TopicMap record)
 {
     return(this.repository.Insert(record));
 }
예제 #13
0
 public void Delete(TopicMap record)
 {
     this.adapter.Delete(record);
 }
예제 #14
0
 public TopicMap Update(TopicMap record)
 {
     return(this.adapter.Update(record));
 }
예제 #15
0
 public TopicMap Insert(TopicMap record)
 {
     return(this.adapter.Insert(record));
 }
예제 #16
0
 public void UpdateToRow(ref DataRow row, TopicMap record)
 {
     TopicMap.UpdateRowFromTopicMap(ref row, record);
     this.ExtraUpdateToRow(ref row, record);
 }