Ejemplo n.º 1
0
        public JsonResult GetAllSalesReportByDate(DateTime fromDate, DateTime toDate, int customerID)
        {
            dynamic salesReportByDate = 0;

            try
            {
                if (ModelState.IsValid)
                {
                    SaleServiceClient saleServiceClient = new SaleServiceClient();
                    salesReportByDate = saleServiceClient.GetAllSalesReportByDate(fromDate, toDate, customerID);


                    //if (purchase.Count == 0 || purchase == null)
                    //{
                    //    ModelState.AddModelError("error", "No Record Found");
                    //}
                }
            }
            catch (Exception e)
            {
                ModelState.AddModelError("error", "Something Wrong");
                salesReportByDate = null;
                throw e;
            }

            //return Json(purchaseReportByDate, JsonRequestBehavior.AllowGet);
            return(Json(new { salesReportByDate }, JsonRequestBehavior.AllowGet));
        }