示例#1
0
        public async Task <IActionResult> DeleteNote(int employeeId, [FromBody] CalendarEvent @event)
        {
            db.Calendars.Remove(CalendarExtensions.FromCalendarEvent(@event, employeeId));

            await db.SaveChangesAsync();

            return(NoContent());
        }
示例#2
0
        public async Task <IActionResult> AddNote(int employeeId, [FromBody] CalendarEvent @event)
        {
            var newNote = CalendarExtensions.FromCalendarEvent(@event, employeeId);

            db.Calendars.Add(newNote);
            await db.SaveChangesAsync();

            return(Ok(newNote.ToCalendarEvent()));
        }
示例#3
0
        public void ToHebrewMonthTest()
        {
            Assert.AreEqual(HebrewMonth.תשרי, CalendarExtensions.ToHebrewMonth(5555, 1));
            Assert.AreEqual(HebrewMonth.תשרי, CalendarExtensions.ToHebrewMonth(5768, 1));

            Assert.AreEqual(HebrewMonth.אלול, CalendarExtensions.ToHebrewMonth(5555, 12));
            Assert.AreEqual(HebrewMonth.אלול, CalendarExtensions.ToHebrewMonth(5768, 13));

            Assert.AreEqual(HebrewMonth.שבט, CalendarExtensions.ToHebrewMonth(5555, 5));
            Assert.AreEqual(HebrewMonth.שבט, CalendarExtensions.ToHebrewMonth(5768, 5));

            Assert.AreEqual(HebrewMonth.ניסן, CalendarExtensions.ToHebrewMonth(5555, 7));
            Assert.AreEqual(HebrewMonth.ניסן, CalendarExtensions.ToHebrewMonth(5768, 8));

            Assert.AreEqual(HebrewMonth.אדר2, CalendarExtensions.ToHebrewMonth(5555, 6));
            Assert.AreEqual(HebrewMonth.אדר2, CalendarExtensions.ToHebrewMonth(5555, 6));

            Assert.AreEqual(HebrewMonth.אדר1, CalendarExtensions.ToHebrewMonth(5768, 6));
            Assert.AreEqual(HebrewMonth.אדר2, CalendarExtensions.ToHebrewMonth(5768, 7));
        }