public static CalenderDto ToCalanderDto(Calander calander) { CalenderDto calanderDto = new CalenderDto() { Id = calander.Id, End = calander.DateEnd, Start = calander.DateStart.GetValueOrDefault(), KindId = calander.KindId.GetValueOrDefault(), //KinderGardenId = calander.KinderGardenId.GetValueOrDefault(), //ProfessionalId = calander.ProfessionalId.GetValueOrDefault(), //ChildID = calander.ChildId.GetValueOrDefault(), Title = calander.NameMeeting }; return(calanderDto); }
public static Calander ToCalanderDal(CalenderDto calanderDto) { Calander calander = new Calander() { Id = calanderDto.Id, DateStart = calanderDto.Start, DateEnd = calanderDto.End, //KindId = calanderDto.KindId, //KinderGardenId = calanderDto.KinderGardenId, //ProfessionalId = calanderDto.ProfessionalId, //ChildId = calanderDto.ChildID, NameMeeting = calanderDto.Title, }; return(calander); }
public CalenderDto GetMonth(int officeid, int month, int?year) { if (year == null) { year = DateTime.Today.Year; } var floors = _context.Floors.Where(x => x.OfficeID == officeid).ToList(); CalenderDto Cdto = new CalenderDto(); Cdto.Days = new List <DayDto>(); DateTime d = new DateTime(year.GetValueOrDefault(), month, 1); Cdto.Month = d.ToString("MMMM", CultureInfo.InvariantCulture); for (int i = 1; i < DateTime.DaysInMonth(year.GetValueOrDefault(), month); i++) { var dd = CreateDayDto(officeid, year.GetValueOrDefault(), month, i); Cdto.Days.Add(dd); } return(Cdto); }