1
This commit is contained in:
47
iMES.WebApi/Helper/ControHelp.cs
Normal file
47
iMES.WebApi/Helper/ControHelp.cs
Normal file
@@ -0,0 +1,47 @@
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using iMES.Bi.API;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace iMES.Bi
|
||||
{
|
||||
public class ControHelp
|
||||
{
|
||||
public static string CovJson(Msg_Result Model)
|
||||
{
|
||||
IsoDateTimeConverter timeConverter = new IsoDateTimeConverter();
|
||||
timeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
|
||||
string Result = JsonConvert.SerializeObject(Model, Formatting.Indented, timeConverter).Replace("null", "\"\"");
|
||||
return Result;
|
||||
}
|
||||
}
|
||||
public class NPOIMemoryStream : MemoryStream
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取流是否关闭
|
||||
/// </summary>
|
||||
public bool IsColse
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
public NPOIMemoryStream(bool colse = false)
|
||||
{
|
||||
IsColse = colse;
|
||||
}
|
||||
|
||||
public override void Close()
|
||||
{
|
||||
if (IsColse)
|
||||
{
|
||||
base.Close();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user