public static void UpdatetoMinuteImport() { AlsiDBDataContext dc = new AlsiDBDataContext(); dc.Connection.ConnectionString = GlobalObjects.CustomConnectionString; dc.ClearImportTable(); decimal progress = 0; decimal totProgress = GlobalObjects.Points.Count; foreach (Price price in GlobalObjects.Points) { int open = (int)price.Open; int high = (int)price.High; int low = (int)price.Low; int close = (int)price.Close; int volume = (int)price.Volume; ImportMinute c = new ImportMinute { Stamp = price.TimeStamp, O = open, H = high, L = low, C = close, V = volume, Instrument = price.InstrumentName }; dc.ImportMinutes.InsertOnSubmit(c); dc.SubmitChanges(); progress++; int p = Convert.ToInt16(100 * (progress / totProgress)); } GlobalObjects.Points.Clear(); dc.UpadteImport(); dc.CleanUp(); }
partial void UpdateImportMinute(ImportMinute instance);
partial void DeleteImportMinute(ImportMinute instance);
partial void InsertImportMinute(ImportMinute instance);