Esempio n. 1
0
 public static bool UpdateIbStrategyMapping(IBStrategyMapping ibmap)
 {
     using (wvDB entity = new wvDB())
     {
         try
         {
             entity.Configuration.AutoDetectChangesEnabled = false;
             ibmap.LastUpdated = DateTime.Now;
             entity.IBStrategyMappings.AddOrUpdate(ibmap);
             entity.SaveChanges();
         }
         finally
         {
             entity.Configuration.AutoDetectChangesEnabled = true;
         }
         return(true);
     }
 }
Esempio n. 2
0
        internal static void InsertIbStrategyMapping(List <IBStrategyMapping> newmapping)
        {
            using (wvDB entity = new wvDB())
            {
                try
                {
                    entity.Configuration.AutoDetectChangesEnabled = false;

                    foreach (IBStrategyMapping ibmap in newmapping)
                    {
                        entity.IBStrategyMappings.Add(ibmap);
                    }
                    entity.SaveChanges();
                }
                finally
                {
                    entity.Configuration.AutoDetectChangesEnabled = true;
                }
            }
        }
Esempio n. 3
0
 public static bool UpdateIbStaticData(IEnumerable <IBStaticData> ibmaps)
 {
     using (wvDB entity = new wvDB())
     {
         try
         {
             foreach (var ibmap in ibmaps)
             {
                 entity.Configuration.AutoDetectChangesEnabled = false;
                 ibmap.LastUpdated = DateTime.Now;
                 entity.IBStaticDatas.AddOrUpdate(ibmap);
             }
             entity.SaveChanges();
         }
         finally
         {
             entity.Configuration.AutoDetectChangesEnabled = true;
         }
         return(true);
     }
 }