public void Update(AcademicCalendar model)
 {
     if (model != null)
     {
         _academicCalendarRepository.Update(model);
     }
 }
        private void PopulateEditPeriods(string acyr)
        {
            ClearMessage(ltrlEditPeriodMsg);
            AcademicCalendarFacade acadCalFacade = new AcademicCalendarFacade();

            try
            {
                foreach (string sess in Helpers.MealPlanResources.sessions.Keys)
                {
                    AcademicCalendar acadCal = acadCalFacade.getAcadCalByAcadYr(acyr, sess, Helpers.MealPlanResources.prog);
                    if (acadCal != null)
                    {
                        MealPlanEditPeriod mpEditPeriod = new MealPlanEditPeriod(acadCal, sess);

                        TextBox tbxBegDate = (TextBox)this.FindControl("tbx" + sess + "BegDate");
                        TextBox tbxEndDate = (TextBox)this.FindControl("tbx" + sess + "EndDate");

                        tbxBegDate.Text = mpEditPeriod.BegDate.Value.ToShortDateString();
                        tbxEndDate.Text = mpEditPeriod.EndDate.Value.ToShortDateString();
                    }
                    else
                    {
                        ShowMessage(ltrlEditPeriodMsg, alert, "The system cannot find an academic calendar for the " + Helpers.MealPlanResources.sessions[sess] + " term.");
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);
                ShowMessage(ltrlEditPeriodMsg, alert, "The system encountered an error, please try again.");
            }
        }
 public void Insert(AcademicCalendar model)
 {
     if (model != null)
     {
         _academicCalendarRepository.Insert(model);
     }
 }
示例#4
0
        public IHttpActionResult Insert(AcademicCalendarViewModel model)
        {
            AcademicCalendar data = new AcademicCalendar
            {
                Id       = model.Id,
                Info     = model.Info,
                InfoDate = model.InfoDate
            };


            _academicCalendar.Insert(data);
            return(Ok(data));
        }
示例#5
0
        private bool TimeToSendEmail()
        {
            AcademicCalendarFacade acadCalFacade = new AcademicCalendarFacade();
            AcademicCalendar       acadCal       = acadCalFacade.getCurrentSession();

            if (acadCal != null)
            {
                MealPlanEditPeriod mpEditPeriod = new MealPlanEditPeriod(acadCal, acadCal.Session);
                if (mpEditPeriod.BegDate == DateTime.Today)
                {
                    return(true);
                }
            }

            return(false);
        }