/// <summary>
        /// Used to call the stored procedure GetMealForDay
        /// </summary>
        /// <param name="user">Current user to get meals for</param>
        /// <param name="date">String format of day (YYYY-MM-DD)</param>
        /// 
        /// <example> /CalendarScreen/GetMealDay?user=tester&date=2015-10-30 </example>
        /// <returns>JSON object that passes back information that can be used 
        ///         to generate objects in the UI</returns>
        public ActionResult GetMealDay(string user, string date)
        {
            if (user == null || date == null)
            {
                return Json(null, JsonRequestBehavior.AllowGet);
            }
            SpeedyChefDataContext scdc = new SpeedyChefDataContext();
            IEnumerable<GetMealForDayResult> gmfdr = null;
            // Debugging purposes
            //System.Diagnostics.Debug.WriteLine(date);

            gmfdr = scdc.GetMealForDay(user, date);
            return Json(gmfdr, JsonRequestBehavior.AllowGet);
        }
Exemple #2
0
        /// <summary>
        /// Used to call the stored procedure GetMealForDay
        /// </summary>
        /// <param name="user">Current user to get meals for</param>
        /// <param name="date">String format of day (YYYY-MM-DD)</param>
        ///
        /// <example> /CalendarScreen/GetMealDay?user=tester&date=2015-10-30 </example>
        /// <returns>JSON object that passes back information that can be used
        ///         to generate objects in the UI</returns>
        public ActionResult GetMealDay(string user, string date)
        {
            if (user == null || date == null)
            {
                return(Json(null, JsonRequestBehavior.AllowGet));
            }
            SpeedyChefDataContext             scdc  = new SpeedyChefDataContext();
            IEnumerable <GetMealForDayResult> gmfdr = null;

            // Debugging purposes
            //System.Diagnostics.Debug.WriteLine(date);

            gmfdr = scdc.GetMealForDay(user, date);
            return(Json(gmfdr, JsonRequestBehavior.AllowGet));
        }