using Kingdee.BOS.JSON;
|
using Newtonsoft.Json.Linq;
|
using System;
|
using System.Collections.Generic;
|
using System.Linq;
|
using System.Text;
|
using System.Threading.Tasks;
|
|
namespace test
|
{
|
class Program
|
{
|
static void Main(string[] args)
|
{
|
CustomDemo1();
|
Console.WriteLine(Convert.ToDecimal(1 / 10));
|
Console.WriteLine(1 % 10);
|
Console.WriteLine(1 % 10.0);
|
Console.WriteLine((float)61 / 111);
|
Console.WriteLine((double)61 / 111);
|
Console.WriteLine(Math.Round(((decimal)61 / 111), 2));
|
Console.WriteLine(Math.Round(((decimal)61 * 100 / 111), 2));
|
}
|
private static void CustomDemo()
|
{
|
JArray array = new JArray();
|
var entry = new JObject()
|
{
|
["HMaterID"] = 100465,
|
["HMaterNumber"] = "S1.06",
|
["HMaterName"] = "智能手机-6S",
|
["HModel"] = " ",
|
["HSourceID"] = 0,
|
["HSourceName"] = null,
|
["HDeptID"] = 100512,
|
["HDeptName"] = "手机车间",
|
["HUnitID"] = 10101,
|
["HUnitName"] = "Pcs",
|
["HQty"] = 100,
|
["HSTATUS"] = "3",
|
["HPlanBeginDate"] = "2022-11-29",
|
["HPlanEndDate"] = "2022-11-29",
|
};
|
array.Add(entry);
|
entry = new JObject()
|
{
|
["HMaterID"] = 100465,
|
["HMaterNumber"] = "S1.06",
|
["HMaterName"] = "智能手机-6S",
|
["HModel"] = " ",
|
["HSourceID"] = 0,
|
["HSourceName"] = null,
|
["HDeptID"] = 100512,
|
["HDeptName"] = "手机车间",
|
["HUnitID"] = 10101,
|
["HUnitName"] = "Pcs",
|
["HQty"] = 100,
|
["HSTATUS"] = "3",
|
["HPlanBeginDate"] = "2022-11-29",
|
["HPlanEndDate"] = "2022-11-29",
|
};
|
array.Add(entry);
|
var model = new JObject()
|
{
|
["HBillNo"] = "MO000148",
|
["HInterID"] = "100169",
|
["HPRDORGID"] = "100038",
|
["HDate"] = "2022-11-29",
|
["HSeOrderBillNo"] = "",
|
["HSeOrderInterID"] = "0",
|
["HSeOrderEntryID"] = "0",
|
["HEmpName"] = "",
|
["HEmpID"] = "0",
|
["HCenterName"] = "",
|
["HCenterID"] = "0",
|
["HPlanQty"] = "1",
|
["HRemark"] = "CLOUD导入",
|
["HSTATUS"] = "1",
|
["HENTRY"] = array
|
};
|
|
Console.WriteLine(array);
|
Console.WriteLine(model);
|
Console.Read();
|
|
|
}
|
|
private static void CustomDemo1()
|
{
|
string ret = @"{""code"":""1"",""count"":1,""Message"":""保存成功!"",""data"":1,""list"":null,""Dictlist"":null,""Verify"":null,""HInterID"":null}";
|
List<string> ltCodes = new List<string>(System.Text.RegularExpressions.Regex.Split(ret, ","));
|
List<string> _ltCodes = new List<string>(ret.Split(new string[] { ", " }, StringSplitOptions.RemoveEmptyEntries));
|
Console.WriteLine(ret);
|
Console.Read();
|
}
|
|
public class Root
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public string code { get; set; }
|
/// <summary>
|
///
|
/// </summary>
|
public int count { get; set; }
|
/// <summary>
|
/// 保存成功!
|
/// </summary>
|
public string Message { get; set; }
|
/// <summary>
|
///
|
/// </summary>
|
public int data { get; set; }
|
/// <summary>
|
///
|
/// </summary>
|
public string list { get; set; }
|
/// <summary>
|
///
|
/// </summary>
|
public string Dictlist { get; set; }
|
/// <summary>
|
///
|
/// </summary>
|
public string Verify { get; set; }
|
/// <summary>
|
///
|
/// </summary>
|
public string HInterID { get; set; }
|
}
|
}
|
}
|