public AnomalyInfoViewModel GetElement(int id)
 {
     using (var _context = new DissertationDbContext())
     {
         return(ModelConvector.ToAnomalyInfo(_context.AnomalyInfos.SingleOrDefault(ai => ai.Id == id)));
     }
 }
Exemplo n.º 2
0
 public PointTrendViewModel GetElement(int id)
 {
     using (var _context = new DissertationDbContext())
     {
         return(ModelConvector.ToPointTrend(_context.PointTrends.SingleOrDefault(pt => pt.Id == id)));
     }
 }
Exemplo n.º 3
0
 public GranuleFTViewModel GetElement(int id)
 {
     using (var _context = new DissertationDbContext())
     {
         return(ModelConvector.ToGranuleFT(_context.GranuleFTs.SingleOrDefault(gft => gft.Id == id)));
     }
 }
 public DiagnosticTestViewModel GetElement(int id)
 {
     using (var _context = new DissertationDbContext())
     {
         return(ModelConvector.ToDiagnosticTest(_context.DiagnosticTests.SingleOrDefault(dt => dt.Id == id)));
     }
 }
 public SeriesDescriptionViewModel GetElement(int id)
 {
     using (var _context = new DissertationDbContext())
     {
         return(ModelConvector.ToSeriesDescription(_context.SeriesDescriptions.SingleOrDefault(sd => sd.Id == id)));
     }
 }
 public FuzzyTrendViewModel GetElement(int id)
 {
     using (var _context = new DissertationDbContext())
     {
         return(ModelConvector.ToFuzzyTrend(_context.FuzzyTrends.SingleOrDefault(ft => ft.Id == id)));
     }
 }
 public GranuleEntropyViewModel GetElement(int id)
 {
     using (var _context = new DissertationDbContext())
     {
         return(ModelConvector.ToGranuleEntropy(_context.GranuleEntropys.SingleOrDefault(ge => ge.Id == id)));
     }
 }
Exemplo n.º 8
0
 public FuzzyLabelViewModel GetElement(int id)
 {
     using (var _context = new DissertationDbContext())
     {
         return(ModelConvector.ToFuzzyLabel(_context.FuzzyLabels.SingleOrDefault(fl => fl.Id == id)));
     }
 }
Exemplo n.º 9
0
 public StatisticsByEntropyViewModel GetElement(int id)
 {
     using (var _context = new DissertationDbContext())
     {
         return(ModelConvector.ToStatisticsByEntropy(_context.StatisticsByEntropys.SingleOrDefault(sbe => sbe.Id == id)));
     }
 }
Exemplo n.º 10
0
 public void DeleteElements(int seriesId)
 {
     using (var _context = new DissertationDbContext())
     {
         _context.PointTrends.RemoveRange(_context.PointTrends.Where(pt => pt.SeriesDiscriptionId == seriesId));
         _context.SaveChanges();
     }
 }
Exemplo n.º 11
0
 public void DeleteElement(int id)
 {
     using (var _context = new DissertationDbContext())
     {
         _context.PointTrends.Remove(_context.PointTrends.Single(pt => pt.Id == id));
         _context.SaveChanges();
     }
 }
 public void DeleteElement(int id)
 {
     using (var _context = new DissertationDbContext())
     {
         _context.SeriesDescriptions.Remove(_context.SeriesDescriptions.SingleOrDefault(sd => sd.Id == id));
         _context.SaveChanges();
     }
 }
 public void DeleteElements(int seriesId)
 {
     using (var _context = new DissertationDbContext())
     {
         _context.DiagnosticTests.RemoveRange(_context.DiagnosticTests.Where(dt => dt.SeriesDiscriptionId == seriesId));
         _context.SaveChanges();
     }
 }
 public void DeleteElement(int id)
 {
     using (var _context = new DissertationDbContext())
     {
         _context.DiagnosticTests.Remove(_context.DiagnosticTests.Single(dt => dt.Id == id));
         _context.SaveChanges();
     }
 }
Exemplo n.º 15
0
 public void DeleteElement(int id)
 {
     using (var _context = new DissertationDbContext())
     {
         _context.FuzzyLabels.Remove(_context.FuzzyLabels.SingleOrDefault(fl => fl.Id == id));
         _context.SaveChanges();
     }
 }
Exemplo n.º 16
0
 public void DeleteElements(int seriesId)
 {
     using (var _context = new DissertationDbContext())
     {
         _context.FuzzyLabels.RemoveRange(_context.FuzzyLabels.Where(fl => fl.SeriesDiscriptionId == seriesId));
         _context.SaveChanges();
     }
 }
 public DiagnosticTestRecordViewModel GetElement(int id)
 {
     using (var _context = new DissertationDbContext())
     {
         return(ModelConvector.ToDiagnosticTestRecord(_context.DiagnosticTestRecords
                                                      .Include(dtr => dtr.AnomalyInfo)
                                                      .SingleOrDefault(dtr => dtr.Id == id)));
     }
 }
 public IEnumerable <SeriesDescriptionViewModel> GetElements(int parentId)
 {
     using (var _context = new DissertationDbContext())
     {
         return(_context.SeriesDescriptions
                .ToList()
                .Select(sd => ModelConvector.ToSeriesDescription(sd)));
     }
 }
 public IEnumerable <AnomalyInfoViewModel> GetElements(int parentId)
 {
     using (var _context = new DissertationDbContext())
     {
         return(_context.AnomalyInfos
                .Where(ai => ai.SeriesDiscriptionId == parentId)
                .ToList()
                .Select(ai => ModelConvector.ToAnomalyInfo(ai)));
     }
 }
Exemplo n.º 20
0
 public IEnumerable <FuzzyLabelViewModel> GetElements(int parentId)
 {
     using (var _context = new DissertationDbContext())
     {
         return(_context.FuzzyLabels
                .Where(fl => fl.SeriesDiscriptionId == parentId)
                .ToList()
                .Select(fl => ModelConvector.ToFuzzyLabel(fl)));
     }
 }
 public IEnumerable <DiagnosticTestViewModel> GetElements(int parentId)
 {
     using (var _context = new DissertationDbContext())
     {
         return(_context.DiagnosticTests
                .Where(dt => dt.SeriesDiscriptionId == parentId)
                .ToList()
                .Select(dt => ModelConvector.ToDiagnosticTest(dt)));
     }
 }
 public IEnumerable <GranuleEntropyViewModel> GetElements(int parentId)
 {
     using (var _context = new DissertationDbContext())
     {
         return(_context.GranuleEntropys
                .Where(ge => ge.DiagnosticTestId == parentId)
                .ToList()
                .Select(ge => ModelConvector.ToGranuleEntropy(ge)));
     }
 }
Exemplo n.º 23
0
 public IEnumerable <StatisticsByEntropyViewModel> GetElements(int parentId)
 {
     using (var _context = new DissertationDbContext())
     {
         return(_context.StatisticsByEntropys
                .Where(sbe => sbe.SeriesDiscriptionId == parentId)
                .ToList()
                .Select(sbe => ModelConvector.ToStatisticsByEntropy(sbe)));
     }
 }
Exemplo n.º 24
0
 public RuleTrendViewModel GetElement(int id)
 {
     using (var _context = new DissertationDbContext())
     {
         return(ModelConvector.ToRuleTrend(_context.RuleTrends
                                           .Include(rt => rt.FuzzyTrend)
                                           .Include(rt => rt.FuzzyLabelFrom)
                                           .Include(rt => rt.FuzzyLabelTo)
                                           .SingleOrDefault(rt => rt.Id == id)));
     }
 }
Exemplo n.º 25
0
 public IEnumerable <PointTrendViewModel> GetElements(int parentId)
 {
     using (var _context = new DissertationDbContext())
     {
         return(_context.PointTrends
                .Where(pt => pt.SeriesDiscriptionId == parentId)
                .ToList()
                .OrderBy(pt => pt.StartPoint)
                .Select(pt => ModelConvector.ToPointTrend(pt)));
     }
 }
 public IEnumerable <DiagnosticTestRecordViewModel> GetElements(int parentId)
 {
     using (var _context = new DissertationDbContext())
     {
         return(_context.DiagnosticTestRecords
                .Include(dtr => dtr.AnomalyInfo)
                .Where(dtr => dtr.DiagnosticTestId == parentId)
                .ToList()
                .Select(dtr => ModelConvector.ToDiagnosticTestRecord(dtr)));
     }
 }
Exemplo n.º 27
0
 public StatisticsByFuzzyViewModel GetElement(int id)
 {
     using (var _context = new DissertationDbContext())
     {
         return(ModelConvector.ToStatisticsByFuzzy(_context.StatisticsByFuzzys
                                                   .Include(sbf => sbf.EndStateFuzzyLabel)
                                                   .Include(sbf => sbf.EndStateFuzzyTrend)
                                                   .Include(sbf => sbf.StartStateFuzzyLabel)
                                                   .Include(sbf => sbf.StartStateFuzzyTrend)
                                                   .SingleOrDefault(sbf => sbf.Id == id)));
     }
 }
Exemplo n.º 28
0
 public IEnumerable <GranuleFuzzyViewModel> GetElements(int parentId)
 {
     using (var _context = new DissertationDbContext())
     {
         return(_context.GranuleFuzzys
                .Include(gf => gf.FuzzyLabel)
                .Include(gf => gf.FuzzyTrend)
                .Where(gf => gf.DiagnosticTestId == parentId)
                .ToList()
                .Select(gf => ModelConvector.ToGranuleFuzzy(gf)));
     }
 }
 public void InsertElement(FuzzyTrendBindingModel model)
 {
     using (var _context = new DissertationDbContext())
     {
         var list = _context.FuzzyTrends.Where(ft => ft.SeriesDiscriptionId == model.SeriesId);
         if (list.FirstOrDefault(ft => ft.TrendName == model.TrendName) != null)
         {
             throw new Exception("Уже есть нечеткая тенденция с таким названием!");
         }
         _context.FuzzyTrends.Add(ModelConvector.ToFuzzyTrend(model));
         _context.SaveChanges();
     }
 }
 public void InsertElement(SeriesDescriptionBindingModel model)
 {
     using (var _context = new DissertationDbContext())
     {
         var list = _context.SeriesDescriptions;
         if (list.SingleOrDefault(sd => sd.SeriesName == model.SeriesName) != null)
         {
             throw new Exception("Уже есть ряд с таким именем!");
         }
         _context.SeriesDescriptions.Add(ModelConvector.ToSeriesDescription(model));
         _context.SaveChanges();
     }
 }