Beispiel #1
0
 public override string ToString()
 {
     return(string.Format("{0:S}[{1:S0}, TaskID={2:N0}, ServerID={3:N0}, ScheduleID={4:S}, Inserted={5:S}, LastUpdate={6:S}]",
                          this.GetType().FullName,
                          base.ToString(),
                          TaskID, ServerID,
                          ScheduleID.HasValue ? ScheduleID.Value.ToString() : "<null>",
                          Inserted.ToString(),
                          LastUpdate.ToString()));
 }
Beispiel #2
0
 public override string ToString()
 {
     if (this.Types != null)
     {
         return($"Types:{Types.Select(m => m.ClassifType().ToString() + " (" + m.ClassifProbability.ToString("P2") + ")").Aggregate((f, s) => f + "; " + s)}"
                + $" updated:{LastUpdate.ToString()}");
     }
     else
     {
         return($"Types:snull updated:{LastUpdate.ToString()}");
     }
     //return base.ToString();
 }
Beispiel #3
0
        /// <summary>
        /// For saving settings (NOT cache)
        /// </summary>
        /// <param name="doc"></param>
        /// <returns></returns>
        public XmlNode toXML(ref XmlDocument doc)
        {
            XmlElement repo = doc.CreateElement("repo");

            repo.SetAttribute("type", "remote");
            repo.SetAttribute("name", Name);
            repo.SetAttribute("website", Website);
            repo.SetAttribute("maintainer", Maintainer);
            repo.SetAttribute("lastUpdate", LastUpdate.ToString());

            repo.SetAttribute("url", URL);

            return(repo);
        }
Beispiel #4
0
 /// <summary>
 /// Converts the data to CSV
 /// </summary>
 /// <returns>String of CSV</returns>
 /// <remarks>Parsable by the constructor should you need to recreate the object from CSV</remarks>
 public override string ToLine()
 {
     return(string.Join("\t",
                        TransactionID,
                        BuybackType,
                        LastUpdate.ToString("yyyyMMdd"),
                        LastIDsUpdate?.ToString("yyyyMMdd"),
                        ISIN,
                        USDMarketCap,
                        CompanyID,
                        ICBIndustry,
                        ICBSuperSector,
                        ICBSector,
                        ICBSubSector,
                        ICBCode,
                        CompanyName,
                        PreviousResultsAnnouncementDate?.ToString("yyyyMMdd"),
                        NextResultsAnnouncementsDate?.ToString("yyyyMMdd"),
                        NextCloseBegin?.ToString("yyyyMMdd"),
                        LastCloseEnded?.ToString("yyyyMMdd"),
                        SecurityDescription,
                        TickerCountry,
                        TickerSymbol,
                        AnnouncementDate?.ToString("yyyyMMdd"),
                        TimeReleased?.ToString("yyyyMMdd HH:mm:ss"),
                        TimeProcessed?.ToString("yyyyMMdd HH:mm:ss"),
                        TimeReleasedUtc?.ToString("yyyyMMdd HH:mm:ss"),
                        TimeProcessedUtc?.ToString("yyyyMMdd HH:mm:ss"),
                        AnnouncedIn,
                        BuybackDate?.ToString("yyyyMMdd"),
                        BuybackVia,
                        BuybackBy,
                        HoldingType,
                        Currency,
                        Price,
                        TransactionAmount,
                        GBPValue,
                        EURValue,
                        USDValue,
                        NoteText,
                        BuybackPercentage,
                        VolumePercentage,
                        ConversionRate,
                        AmountAdjustedFactor,
                        PriceAdjustedFactor,
                        TreasuryHolding));
 }
Beispiel #5
0
        //public RecurringPayment IncludeObjects(IDataContext db)
        //{
        //    Log.Debug(TAG, nameof(IncludeObjects));

        //    this.Owner = db.Select<Owner, int>((o) => o.Id == this.OwnerId, (o) => o.Id).Result.FirstOrDefault();
        //    this.PaymentType = db.Select<PaymentType, int>((o) => o.Id == this.PaymentTypeId, (o) => o.Id).Result.FirstOrDefault();
        //    this.Category = db.Select<Category, int>((o) => o.Id == this.CategoryId, (o) => o.Id).Result.FirstOrDefault();
        //    this.Interval = db.Select<Interval, int>((o) => o.Id == this.IntervalId, (o) => o.Id).Result.FirstOrDefault();
        //    return this;
        //}

        public string ToString(string dateFormat)
        {
            //Log.Debug(TAG, nameof(ToString));

            return($"{nameof(Description)}: {Description}, \r"
                   + $"{nameof(Cost)}: {Cost}, \r"
                   + $"{ nameof(CategoryId)}: {CategoryId}, \r"
                   + $"{ nameof(Warranty)}: {Warranty}, \r"
                   + $"{ nameof(ApplicationUserId)}: {ApplicationUserId}, \r"
                   + $"{ nameof(PaymentTypeId)}: {PaymentTypeId}, \r"
                   + $"{ nameof(Earnings)}: {Earnings}, \r"
                   + $"{ nameof(DateCreated)}: {DateCreated.ToString(dateFormat)}\r"
                   + $"{ nameof(IntervalId)}: {IntervalId}, \r"
                   + $"{ nameof(EndDate)}: {EndDate?.ToString(dateFormat) ?? "infinity"}\r"
                   + $"{ nameof(LastUpdate)}: {LastUpdate.ToString(dateFormat)}\r"
                   + $"{ nameof(IsActive)}: {IsActive.ToString()}\r"
                   );
        }
 /// <summary>
 /// Converts the data to CSV
 /// </summary>
 /// <returns>String of CSV</returns>
 /// <remarks>Parsable by the constructor should you need to recreate the object from CSV</remarks>
 public override string ToLine()
 {
     return(string.Join("\t",
                        TransactionID,
                        BuybackType,
                        LastUpdate.ToString("yyyyMMdd"),
                        LastIDsUpdate?.ToString("yyyyMMdd"),
                        ISIN,
                        USDMarketCap,
                        CompanyID,
                        ICBIndustry,
                        ICBSuperSector,
                        ICBSector,
                        ICBSubSector,
                        ICBCode,
                        CompanyName,
                        PreviousResultsAnnouncementDate?.ToString("yyyyMMdd"),
                        NextResultsAnnouncementsDate?.ToString("yyyyMMdd"),
                        NextCloseBegin?.ToString("yyyyMMdd"),
                        LastCloseEnded?.ToString("yyyyMMdd"),
                        SecurityDescription,
                        TickerCountry,
                        TickerSymbol,
                        AnnouncementDate?.ToString("yyyyMMdd"),
                        TimeReleased?.ToString("yyyyMMdd HH:mm:ss"),
                        TimeProcessed?.ToString("yyyyMMdd HH:mm:ss"),
                        TimeReleasedUtc?.ToString("yyyyMMdd HH:mm:ss"),
                        TimeProcessedUtc?.ToString("yyyyMMdd HH:mm:ss"),
                        AnnouncedIn,
                        IntentionVia,
                        IntentionBy,
                        BuybackIntentionHoldingType,
                        IntentionAmount,
                        ValueCurrency,
                        IntentionValue,
                        IntentionPercentage,
                        IntentionAuthorisationStartDate?.ToString("yyyyMMdd"),
                        IntentionAuthorisationEndDate?.ToString("yyyyMMdd"),
                        PriceCurrency,
                        MinimumPrice,
                        MaximumPrice,
                        BuybackIntentionNoteText));
 }
Beispiel #7
0
 public void WriteToStream(MStreamWriter sw)
 {
     sw.Write(SetId);
     sw.Write(ChildrenBeatmaps.Count);
     foreach (var bm in ChildrenBeatmaps)
     {
         sw.Write(bm);
     }
     sw.Write((sbyte)RankedStatus);
     sw.Write(ApprovedDate?.ToString(), true);
     sw.Write(LastUpdate?.ToString(), true);
     sw.Write(LastChecked?.ToString(), true);
     sw.Write(Artist, true);
     sw.Write(Title, true);
     sw.Write(Creator, true);
     sw.Write(Source, true);
     sw.Write(Tags, true);
     sw.Write(HasVideo);
     sw.Write((sbyte)Genre);
     sw.Write((sbyte)Language);
     sw.Write(Favourites);
     sw.Write(Disabled);
 }
 public override string ToString()
 {
     return(string.Format("{0} - {1} - {2}", Symbol, LastTradePrice, LastUpdate.ToString("MM/dd/yyyy HH:mm:ss.fff")));
 }
Beispiel #9
0
        public void Save(Boolean SaveArticles = false)
        {
            String sqlInsertHosts = @"
                INSERT INTO Hosts (uri, zoom) 
                SELECT $uri, 100
                WHERE NOT EXISTS (
                    SELECT *
                    FROM Hosts 
                    WHERE uri = $uri
                );
            ";

            String sqlGetHost = @"
                SELECT host_id
                FROM Hosts 
                WHERE uri = $uri
            ";

            String sqlInsertFeeds = @"
                INSERT INTO Feeds (
                    uri, 
                    last_update, 
                    title, 
                    host_id
                ) 
                SELECT 
                    $uri,
                    $last_update,
                    $title,
                    $host_id
                WHERE NOT EXISTS (
                    SELECT *
                    FROM Feeds
                    WHERE uri = $uri
                );
            ";

            String sqlUpdateFeed = @"
                UPDATE Feeds
                SET last_update = $last_update,
                    title = $title
                WHERE uri = $uri;
            ";

            String sqlGetFeed = @"
                SELECT feed_id
                FROM Feeds 
                WHERE uri = $uri
            ";


            if (Host == null)
            {
                Host = Location.Host;
            }

            if (Title == null)
            {
                Title = Location.ToString();
            }

            using (SQLiteConnection m_dbConnection = new SQLiteConnection(Repository.ConnectionString))
            {
                m_dbConnection.Open();
                SQLiteTransaction tran = m_dbConnection.BeginTransaction();
                try
                {
                    SQLiteCommand command = new SQLiteCommand(sqlInsertHosts, m_dbConnection);
                    command.Parameters.AddWithValue("$uri", Host);
                    command.ExecuteNonQuery();

                    command = new SQLiteCommand(sqlGetHost, m_dbConnection);
                    command.Parameters.AddWithValue("$uri", Host);
                    var host_id = command.ExecuteScalar();

                    command = new SQLiteCommand(sqlInsertFeeds, m_dbConnection);
                    command.Parameters.AddWithValue("$uri", Location.ToString());
                    command.Parameters.AddWithValue("$last_update", LastUpdate.ToString("s"));
                    command.Parameters.AddWithValue("$title", Title);
                    command.Parameters.AddWithValue("$host_id", host_id);
                    int inserted = command.ExecuteNonQuery();

                    if (inserted <= 0)
                    {
                        command = new SQLiteCommand(sqlUpdateFeed, m_dbConnection);
                        command.Parameters.AddWithValue("$uri", Location.ToString());
                        command.Parameters.AddWithValue("$last_update", LastUpdate.ToString("s"));
                        command.Parameters.AddWithValue("$title", Title);
                        command.ExecuteNonQuery();
                    }

                    command = new SQLiteCommand(sqlGetFeed, m_dbConnection);
                    command.Parameters.AddWithValue("$uri", Location.ToString());
                    Id = (long)command.ExecuteScalar();
                    tran.Commit();
                }
                catch (Exception)
                {
                    tran.Rollback();
                    throw;
                }
            }

            if (SaveArticles)
            {
                foreach (Model.Article a in Articles)
                {
                    Article dataArt = new Article(a);
                    dataArt.Save();
                }
            }
        }
 public string Serialization()
 {
     return(Url + split + LastUpdate.ToString() + split + IsInit.ToString());
 }
Beispiel #11
0
 public static string Get()
 {
     return("Температура:" + (Model.main.temp - 273).ToString("F1") + '\n' + "Давление:" + Model.main.pressure.ToString("F1") + '\n' + "Получено:" + LastUpdate.ToString());
 }
Beispiel #12
0
 public String GetFormattedLastUpdate() => LastUpdate.ToString("dd.MM.yyyy HH:mm");