You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using POSV.Entity.Report;
|
|
|
|
|
using POSV.Utils;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace POSV.Report
|
|
|
|
|
{
|
|
|
|
|
public class ReportUtils
|
|
|
|
|
{
|
|
|
|
|
private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
|
|
|
|
|
|
|
|
|
|
public static List<GridObject> GetGridObject(string nameSpace, string resourceName)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
var assembly = Assembly.GetExecutingAssembly();
|
|
|
|
|
using (var reader = new StreamReader(assembly.GetManifestResourceStream(nameSpace + resourceName)))
|
|
|
|
|
{
|
|
|
|
|
var json = reader.ReadToEnd();
|
|
|
|
|
return JsonUtils.Deserialize<List<GridObject>>(json);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
logger.Error(ex, "加载资源文件" + resourceName + "异常");
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|