/// <summary>
        /// Create a new Calendars object.
        /// </summary>
        /// <param name="id">Initial value of the Id property.</param>
        /// <param name="startTime">Initial value of the StartTime property.</param>
        /// <param name="endTime">Initial value of the EndTime property.</param>
        public static Calendars CreateCalendars(global::System.Int32 id, global::System.DateTime startTime, global::System.DateTime endTime)
        {
            Calendars calendars = new Calendars();

            calendars.Id        = id;
            calendars.StartTime = startTime;
            calendars.EndTime   = endTime;
            return(calendars);
        }
Example #2
0
        public virtual void ProcessData(DataTable data)
        {
            var holidays = cal.getPublicHolidaysForYear(DateTime.Today.Year.ToString(), "RU", "");

            foreach (var holiday in holidays.publicHolidays)
            {
                Calendars newCal = new Calendars();
                newCal.StartTime   = new DateTime(holiday.date.year, holiday.date.month, holiday.date.day);
                newCal.EndTime     = newCal.StartTime.AddDays(1).AddMilliseconds(1);
                newCal.LocalName   = holiday.localName;
                newCal.EnglishName = holiday.englishName;
                newCal.IsWorkDay   = 2; //public holiday
            }
            CalendarsModel.SaveChanges(System.Data.Objects.SaveOptions.AcceptAllChangesAfterSave);
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the Calendars EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToCalendars(Calendars calendars)
 {
     base.AddObject("Calendars", calendars);
 }