Beispiel #1
0
 /// <summary>
 /// Deletes exacly one Symbol by id in Symbols table,
 /// deletes all the entries of the symbol in CompositesOf table
 /// </summary>
 /// <param name="id"></param>
 /// <returns>true false depending on success</returns>
 public bool DeleteExact(int id)
 {
     using (var db = new BlissBaseContext(testing))
     {
         Symbols sym = db.Symbols.Find(id);
         try
         {
             // Deletes the relations where the symbol is a component of
             // a composite symbol
             var compOf = new CompositeOfDAL();
             compOf.DeleteBySymbolID(id);
             // Sets the symbol as a standard type (Deletes it from
             // SymbolTypes table)
             var type = new SymbolTypeDAL();
             type.SetStandardForSymID(id);
             // Deletes the symbol from Symbols table
             db.Symbols.Remove(sym);
             db.SaveChanges();
         }
         catch (Exception e)
         {
             Debug.WriteLine("Exception when remowing symbol: " + id);
             Debug.WriteLine(e.StackTrace);
             return false;
         }
     }
     return true;
 }
 public bool UpdateTypeForSymID(int symId, TypeCodes code)
 {
     var SymbolTypeDAL = new SymbolTypeDAL(testing);
     return SymbolTypeDAL.UpdateTypeForSymID(symId, code);
 }
 public bool SetStandardForSymID(int symId)
 {
     var SymbolTypeDAL = new SymbolTypeDAL(testing);
     return SymbolTypeDAL.SetStandardForSymID(symId);
 }
 public bool SetLanguageForSymID(int symId, TypeCodes code)
 {
     var SymbolTypeDAL = new SymbolTypeDAL(testing);
     return SymbolTypeDAL.SetLanguageForSymID(symId, code);
 }
 public SymbolType GetExactBySymID(int symId)
 {
     var SymbolTypeDAL = new SymbolTypeDAL(testing);
     return SymbolTypeDAL.GetExactBySymID(symId);
 }
 public List<SymbolType> GetAllNonStandard()
 {
     var SymbolTypeDAL = new SymbolTypeDAL(testing);
     return SymbolTypeDAL.GetAllNonStandard();
 }