Пример #1
0
 public void AddResult(string Title, double Node, double Translate, double Stress, int index)
 {
     dbContext.Configuration.AutoDetectChangesEnabled = false;
     dbContext.RESULTS.Add(new DBDetailsSet.DBResults
     {
         Title     = Title,
         NodeId    = Node,
         Translate = Translate,
         Stress    = Stress
     });
     dbContext.Configuration.AutoDetectChangesEnabled = true;
     if (index % 100 == 0)
     {
         dbContext.SaveChanges();
     }
 }
Пример #2
0
 public async Task AddAnalysisAsync(string Title, int DBDetailID)
 {
     using (DBServerContext db = new DBServerContext())
     {
         db.Configuration.AutoDetectChangesEnabled = false;
         db.ANALYSIS.Add(new DBDetailsSet.DBDetail_Created.DBAnalysis
         {
             Title             = Title,
             Materials         = db.MATERIALS.Where(w => w.Analysis == null).ToList(),
             Loads             = db.LOADS.Where(w => w.Analysis == null).ToList(),
             Contraints        = db.CONTRAINTS.Where(w => w.Analysis == null).ToList(),
             Results           = db.RESULTS.Where(w => w.Analysis == null).ToList(),
             PropertyAndMeshes = db.PROPERTYANDMESHES.Where(w => w.Analysis == null).ToList(),
             MaxMinStress      = db.MAXMINSTRESS.Where(w => w.Analysis == null).ToList(),
             MaxMinTranslate   = db.MAXMINTRANSLATE.Where(w => w.Analysis == null).ToList()
         });
         db.Configuration.AutoDetectChangesEnabled = true;
         db.SaveChanges();
         db.CREATEDETAILS.Find(DBDetailID + 1).Analysis = db.ANALYSIS.Select(s => s).ToList()[db.ANALYSIS.Count() - 1];
         await db.SaveChangesAsync();
     }
 }