示例#1
0
        public JsonResult Feed(FormCollection collection)
        {
            try
            {
                string location  = collection["location"];
                string feedTime  = collection["feedTime"];
                string numberFed = collection["numberFed"];
                string feedType  = collection["feedType"];
                string gramsFed  = collection["gramsFed"];

                var model = new ReportModel();

                int rowsEffected = model.Feed(location, feedTime, numberFed, feedType, gramsFed);

                if (rowsEffected == 1)
                {
                    return(Json("1", JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine(e);
            }

            return(Json("0", JsonRequestBehavior.AllowGet));
        }