Beispiel #1
0
 public override string ToString()
 {
     if (MatchId == -1)
     {
         return("--==   " + DateTimeStart.ToString("dd-MM-yyyy") + "   ==--");            // This string is a date label for the listbox
     }
     return(DateTimeStart.ToString("HH:mm") + " -- " + DateTimeStop.ToString("HH:mm"));
 }
        public DateTime GenerateDateTimeZdarzenia(DateTime DateEnd, int IloscZdarzen)
        {
            int hours     = Math.Abs((DateEnd.Hour - DateTimeStart.Hour) * 60);
            int minutes   = Math.Abs(DateEnd.Minute - DateTimeStart.Minute);
            int dependecy = ((hours + minutes) / IloscZdarzen);

            if (dependecy < 1)
            {
                dependecy = 2;
            }
            DateTimeStart = DateTimeStart.AddMinutes(Random.Next(1, dependecy));
            return(DateTimeStart);
        }
Beispiel #3
0
        public override void ClearValues()
        {
            int iPrev = 0,iDel = 0,iCur = 0;

            if (!(TableRecieved == null))
            {
                iPrev = TableRecieved.Rows.Count;
                string strSel =
                    @"DATETIME<'" + DateTimeStart.ToString(@"yyyy/MM/dd HH:mm:ss.fff") + @"' OR DATETIME>='" + DateTimeStart.AddSeconds(TimeSpanPeriod.TotalSeconds).ToString(@"yyyy/MM/dd HH:mm:ss.fff") + @"'"
                    //@"DATETIME BETWEEN '" + m_dtStart.ToString(@"yyyy/MM/dd HH:mm:ss") + @"' AND '" + m_dtStart.AddSeconds(m_tmSpanPeriod.Seconds).ToString(@"yyyy/MM/dd HH:mm:ss") + @"'"
                ;

                DataRow[] rowsDel = null;
                try { rowsDel = TableRecieved.Select(strSel); }
                catch (Exception e)
                {
                    Logging.Logg().Exception(e,Logging.INDEX_MESSAGE.NOT_SET,@"HBiyskTMOra::ClearValues () - ...");
                }

                if (!(rowsDel == null))
                {
                    iDel = rowsDel.Length;
                    if (rowsDel.Length > 0)
                    {
                        foreach (DataRow r in rowsDel)
                        {
                            TableRecieved.Rows.Remove(r);
                        }
                        //??? Обязательно ли...
                        TableRecieved.AcceptChanges();
                    }
                    else
                    {
                        ;
                    }
                }
                else
                {
                    ;
                }

                iCur = TableRecieved.Rows.Count;

                Console.WriteLine(@"Обновление рез-та [ID=" + m_IdGroupSignalsCurrent + @"]: " + @"(было=" + iPrev + @", удалено=" + iDel + @", осталось=" + iCur + @")");
            }
            else
            {
                ;
            }
        }
Beispiel #4
0
        public override string ToString()
        {
            string newLine = "\r\n";

            return("BEGIN:VCALENDAR" + newLine +
                   "VERSION:2.0" + newLine +
                   "PRODID:-//" + companyName + "//" + applicationName + "//EN" + newLine +
                   "METHOD:PUBLISH" + newLine +
                   "BEGIN:VEVENT" + newLine +
                   "SUMMARY:" + Summary + newLine +
                   "UID:" + Guid.NewGuid() + newLine +
                   "DTSTART:" + DateTimeStart.ToUniversalTime().ToString(dateFormat) + newLine +
                   "DTEND:" + DateTimeEnd.ToUniversalTime().ToString(dateFormat) + newLine +
                   "DTSTAMP:" + DateTime.Now.ToUniversalTime().ToString(dateFormat) + newLine +
                   "LOCATION:" + Location + newLine +
                   "DESCRIPTION:" + Description + newLine +
                   "END:VEVENT" + newLine +
                   "END:VCALENDAR" + newLine);
        }