TG.WXCRM.V4/Model/DTO/FieldSettingDto.cs

105 lines
3.2 KiB
C#

using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Mvc;
namespace WX.CRM.Model.DTO
{
public class FieldSettingDto
{
public int Id { get; set; }
public bool Checkbox { get; set; }
public string Field { get; set; }
public string Title { get; set; }
public string Fixed { get; set; }
public int? Order { get; set; }
}
public class TableFieldSettingDto
{
[JsonProperty("checkbox", NullValueHandling = NullValueHandling.Ignore)]
public bool? Checkbox { get; set; }
[JsonProperty("field", NullValueHandling = NullValueHandling.Ignore)]
public string Field { get; set; }
[JsonProperty("type", NullValueHandling = NullValueHandling.Ignore)]
public string Type { get; set; }
[JsonProperty("title", NullValueHandling = NullValueHandling.Ignore)]
public string Title { get; set; }
[JsonProperty("width", NullValueHandling = NullValueHandling.Ignore)]
public int? Width { get; set; }
[JsonProperty("fixed", NullValueHandling = NullValueHandling.Ignore)]
public string Fixed { get; set; }
[JsonProperty("templet", NullValueHandling = NullValueHandling.Ignore)]
public string Templet { get; set; }
[JsonProperty("sort", NullValueHandling = NullValueHandling.Ignore)]
public bool? Sort { get; set; }
[JsonProperty("hide", NullValueHandling = NullValueHandling.Ignore)]
public bool? Hide { get; set; }
}
//public class JsonNetResult : JsonResult
//{
// public Encoding ContentEncoding { get; set; }
// public string ContentType { get; set; }
// public object Data { get; set; }
// public JsonSerializerSettings SerializerSettings { get; set; }
// public Formatting Formatting { get; set; }
// public JsonNetResult(object data, Formatting formatting)
// : this(data)
// {
// Formatting = formatting;
// JsonRequestBehavior = JsonRequestBehavior.AllowGet;
// }
// public JsonNetResult(object data) : this()
// {
// Data = data;
// JsonRequestBehavior= JsonRequestBehavior.AllowGet;
// }
// public JsonNetResult()
// {
// Formatting = Formatting.None;
// SerializerSettings = new JsonSerializerSettings();
// }
// public override void ExecuteResult(ControllerContext context)
// {
// if (context == null)
// throw new ArgumentNullException("context");
// var response = context.HttpContext.Response;
// response.ContentType = !string.IsNullOrEmpty(ContentType)
// ? ContentType
// : "application/json";
// if (ContentEncoding != null)
// response.ContentEncoding = ContentEncoding;
// if (Data == null) return;
// var writer = new JsonTextWriter(response.Output) { Formatting = Formatting };
// var serializer = JsonSerializer.Create(SerializerSettings);
// serializer.Serialize(writer, Data);
// writer.Flush();
// }
//}
}