Пример #1
0
        public void ConvertSignalComments()
        {
            List <Models.MetricComment> comments = new List <Models.MetricComment>();


            foreach (var row in CommentsTable)
            {
                if (row.EntityType == 1)
                {
                    Models.MetricComment comment = new Models.MetricComment();

                    if (comment.MetricTypeIDs == null)
                    {
                        comment.MetricTypeIDs = new List <int>();
                    }

                    comment.CommentText = row.Comment;
                    comment.SignalID    = row.Entity;
                    comment.MetricTypeIDs.Add(1);
                    comment.MetricTypeIDs.Add(2);
                    comment.TimeStamp = row.TimeStamp;

                    comments.Add(comment);
                }
            }
            db.MetricComments.AddRange(comments);
        }
Пример #2
0
        public void ConvertSignalComments()
        {
            Console.WriteLine("Starting Signal Comment converison.");
            List <Models.MetricComment> comments = new List <Models.MetricComment>();


            foreach (var row in CommentsTable)
            {
                if (row.EntityType == 1)
                {
                    Models.MetricComment comment = new Models.MetricComment();

                    if (comment.MetricTypeIDs == null)
                    {
                        comment.MetricTypeIDs = new List <int>();
                    }

                    comment.CommentText = row.Comment;
                    comment.SignalID    = row.Entity;
                    comment.MetricTypeIDs.Add(1);
                    comment.MetricTypeIDs.Add(2);
                    comment.TimeStamp = row.TimeStamp;

                    comments.Add(comment);
                }
            }
            db.MetricComments.AddRange(comments);
            Console.WriteLine("Saving signal comments");
            db.SaveChanges();
        }
Пример #3
0
        public List <Models.MetricType> GetMetricTypesByMetricComment(Models.MetricComment metricComment)
        {
            var metricTypes = (from r in db.MetricTypes
                               where metricComment.MetricTypeIDs.Contains(r.MetricID)
                               select r).ToList();

            return(metricTypes);
        }