Ejemplo n.º 1
0
        public string GetLastUpdatedAltCoinTraderPage(System.Web.SessionState.HttpSessionState session)
        {
            //go and get the data for the required sources.
            BusLayer.Currency currencyHelper = new BusLayer.Currency();
            DataLayer.TrnSourceUpdate.TrnSourceUpdateRow krakenSourceRow        = currencyHelper.GetLastTrnSourceUpdateRowForSource((int)BusLayer.Handler.CurrencySource.Sources.Kraken);
            DataLayer.TrnSourceUpdate.TrnSourceUpdateRow altcointraderSourceRow = currencyHelper.GetLastTrnSourceUpdateRowForSource((int)BusLayer.Handler.CurrencySource.Sources.Altcointrader);

            string returnString = krakenSourceRow.CreateDate.ToString("MM/dd/yyyy HH:mm:ss") + "|" + altcointraderSourceRow.CreateDate.ToString("MM/dd/yyyy HH:mm:ss");

            return(serializer.Serialize(new HandlerResponse(0, "Success", returnString)));
        }
        private void OnTimedEvent(object source, ElapsedEventArgs e)
        {
            try
            {
                currentSourceGuid = Guid.NewGuid();
                //log that we are about to start this source import
                DataLayer.TrnSourceUpdate.TrnSourceUpdateDataTable sourceTable = new DataLayer.TrnSourceUpdate.TrnSourceUpdateDataTable();
                DataLayer.TrnSourceUpdate.TrnSourceUpdateRow       sourceRow   = sourceTable.NewTrnSourceUpdateRow();

                sourceRow.TrnSourceUpdateGuid = currentSourceGuid;
                sourceRow.PrmCurrencySourceId = (int)BusLayer.Handler.CurrencySource.Sources.Altcointrader;
                sourceRow.CreateDate          = DateTime.Now;

                sourceTable.AddTrnSourceUpdateRow(sourceRow);

                localCurrencyHelper.UpdateSourceRow(sourceTable);

                try
                {
                    //your code
                    GetData();


                    sourceRow.Completed  = true;
                    sourceRow.CreateDate = DateTime.Now;

                    localCurrencyHelper.UpdateSourceRow(sourceRow);
                }
                catch (Exception ex)
                {
                    sourceRow.Completed       = true;
                    sourceRow.CreateDate      = DateTime.Now;
                    sourceRow.Failed          = true;
                    sourceRow.ErrorMessage    = ex.Message;
                    sourceRow.ErrorStackTrace = ex.InnerException.StackTrace;

                    localCurrencyHelper.UpdateSourceRow(sourceRow);
                }
            }
            catch (Exception ex)
            {
                string f**k = "me";
            }
        }
Ejemplo n.º 3
0
 public void UpdateSourceRow(DataLayer.TrnSourceUpdate.TrnSourceUpdateRow newRow)
 {
     TrnSourceUpdateTableAdapter.Update(newRow);
 }