public ActionResult GetProductAvailabilityByProductId(int productId) { DateTime min = DateTime.Today.Date.AddMonths(-1); DateTime max = DateTime.Today.Date.AddDays(7); CakesPosRepository cpr = new CakesPosRepository(_connectionString); return(Json(cpr.GetProductAvailabilityByProductId(min, max, productId), JsonRequestBehavior.AllowGet)); }