public virtual ActionResult GetPrintFiles([DataSourceRequest] DataSourceRequest request) { LogI("GetPrintFiles"); var items = LabelPrintPackViewModel.GetAll(Db.LabelPrintPacks).OrderByDescending(l => l.CreateDate); var dataSource = items.ToDataSourceResult(request); return(new JsonResult { Data = dataSource, JsonRequestBehavior = JsonRequestBehavior.AllowGet }); }
public virtual ActionResult GetLabelPrintFile(long id) { LogI("GetLabelPrintFile, id=" + id); var labelFile = Db.LabelPrintPacks.Get(id); if (labelFile != null) { var model = new LabelPrintPackViewModel(labelFile); var path = UrlHelper.GetLabelPath(labelFile.FileName); var filename = model.IsReturn ? model.NumberOrPerson : "Label " + model.NumberOrPerson; return(File(path, FileHelper.GetMimeTypeByExt(Path.GetExtension(path)), filename + Path.GetExtension(path))); } return(new EmptyResult()); }