Exemplo n.º 1
0
        public ActionResult Product(ReportFilter filter)
        {
            var model = ProductReport.Get(Employee.BussinessID, filter);

            if (Request.IsAjaxRequest())
            {
                return(Json(new
                {
                    html = RenderPartialViewToString(Views.ProductPartial, model)
                }, JsonRequestBehavior.DenyGet));
            }
            return(View(Views.Product, model));
        }
Exemplo n.º 2
0
        public ActionResult ProductDownload(ReportFilter filter)
        {
            var result = false;

            try
            {
                var report   = ProductReport.Get(Employee.BussinessID, filter);
                var fileName = String.Format("Revenue_{0}.xls", DateTime.Now.ToString("ddMMyyyyHHmmss"));
                var file     = String.Format("{0}/Content/Download/{1}", SiteConfiguration.ApplicationPath, fileName);
                Functions.CheckDirectory(String.Format("{0}/Content/Download/", SiteConfiguration.ApplicationPath));
                SaveProduct(file, report);
                Session[SessionKey.Download] = fileName;
                result = true;
            }
            catch { }
            return(Json(new
            {
                result = result
            }, JsonRequestBehavior.DenyGet));
        }