This commit is contained in:
余宇波 2025-04-09 10:02:48 +08:00
parent e661f5d8aa
commit 5330246bdd
23 changed files with 86252 additions and 234 deletions

View File

@ -268,8 +268,7 @@
<HintPath>..\..\派诺(1)\派诺\git\6、程序\GZ_KD_Parino\bin\Debug\log4net.dll</HintPath> <HintPath>..\..\派诺(1)\派诺\git\6、程序\GZ_KD_Parino\bin\Debug\log4net.dll</HintPath>
</Reference> </Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath>..\..\派诺(1)\派诺\git\6、程序\GZ_KD_Parino\bin\Debug\Newtonsoft.Json.dll</HintPath>
</Reference> </Reference>
<Reference Include="NPOI"> <Reference Include="NPOI">
<HintPath>..\..\派诺(1)\派诺\git\6、程序\GZ_KD_Parino\bin\Debug\NPOI.dll</HintPath> <HintPath>..\..\派诺(1)\派诺\git\6、程序\GZ_KD_Parino\bin\Debug\NPOI.dll</HintPath>
@ -335,6 +334,9 @@
<Compile Include="SQL\SqlManage_yuyubo.cs" /> <Compile Include="SQL\SqlManage_yuyubo.cs" />
<Compile Include="SQL\SqlManage.cs" /> <Compile Include="SQL\SqlManage.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup> <PropertyGroup>
<PostBuildEvent> <PostBuildEvent>

View File

@ -1297,253 +1297,253 @@ namespace Pilot_KD_Parino.QPHY_AutoWrire
}); });
} }
} }
#region DataChanged()
///// <summary>
///// 单据体值更新事件
///// </summary>
///// <param name="e"></param>
//public override void DataChanged(DataChangedEventArgs e)
//{
// base.DataChanged(e);
// if (e.Field.Key.Equals("FShuaXin"))
// {
// //文本字段触发值更新时,模拟用户点击菜单,此处模拟点击“选项”菜单:
// ((IDynamicFormViewService)this.View).MainBarItemClick("MBBA_tbButton_1");
// }
// if (e.Field.Key.Equals("FCONTRACTNUMBER2"))
// {
// if (INDEXNumber == 0)
// {
// //获取销售订单/应收单单据体数据
// DynamicObjectCollection FEntity = this.View.Model.DataObject["FEntity"] as DynamicObjectCollection;
/// <summary> // SaleBILLLIS = new List<CombinaClass>();
/// 单据体值更新事件
/// </summary>
/// <param name="e"></param>
public override void DataChanged(DataChangedEventArgs e)
{
base.DataChanged(e);
if (e.Field.Key.Equals("FShuaXin"))
{
//文本字段触发值更新时,模拟用户点击菜单,此处模拟点击“选项”菜单:
((IDynamicFormViewService)this.View).MainBarItemClick("MBBA_tbButton_1");
}
if (e.Field.Key.Equals("FCONTRACTNUMBER2"))
{
if (INDEXNumber == 0)
{
//获取销售订单/应收单单据体数据
DynamicObjectCollection FEntity = this.View.Model.DataObject["FEntity"] as DynamicObjectCollection;
SaleBILLLIS = new List<CombinaClass>(); // foreach (var item in FEntity)
// {
// SaleBILLLIS.Add(new CombinaClass()
// {
// FBIllNO = item["FBILLNO"]?.ToString(),
// FCONTRACTNUMBER = item["FCONTRACTNUMBER"]?.ToString(),
// FClient = Convert.ToInt32(item["FClient_Id"]),
// FDate = item["FDate"]?.ToString(),
// FALLAMOUNT = Convert.ToDouble(item["F_MBBA_Decimal_c1c"]),
// FYAMOUNT = Convert.ToDouble(item["F_MBBA_Decimal_vb1"]),
// FDAMOUNT = Convert.ToDouble(item["F_MBBA_Decimal_emq"]),
// FSKBIllNO = item["FSKBILLNO"]?.ToString(),
// FCreated = Convert.ToInt32(item["FCreated_Id"]),
// FSalesman = Convert.ToInt32(item["FSalesman_Id"]),
// FType = item["FType"]?.ToString(),
// FISHX = item["FISHX"]?.ToString(),
// FWeiYi = item["FWeiYi"]?.ToString(),
// });
// }
foreach (var item in FEntity) // var fBILLNO = this.Model.GetValue("FBILLNO2", e.Row);
{ // var fCONTRACTNUMBER = this.Model.GetValue("FCONTRACTNUMBER2", e.Row);
SaleBILLLIS.Add(new CombinaClass()
{
FBIllNO = item["FBILLNO"]?.ToString(),
FCONTRACTNUMBER = item["FCONTRACTNUMBER"]?.ToString(),
FClient = Convert.ToInt32(item["FClient_Id"]),
FDate = item["FDate"]?.ToString(),
FALLAMOUNT = Convert.ToDouble(item["F_MBBA_Decimal_c1c"]),
FYAMOUNT = Convert.ToDouble(item["F_MBBA_Decimal_vb1"]),
FDAMOUNT = Convert.ToDouble(item["F_MBBA_Decimal_emq"]),
FSKBIllNO = item["FSKBILLNO"]?.ToString(),
FCreated = Convert.ToInt32(item["FCreated_Id"]),
FSalesman = Convert.ToInt32(item["FSalesman_Id"]),
FType = item["FType"]?.ToString(),
FISHX = item["FISHX"]?.ToString(),
FWeiYi = item["FWeiYi"]?.ToString(),
});
}
var fBILLNO = this.Model.GetValue("FBILLNO2", e.Row); // //判断是否为空
var fCONTRACTNUMBER = this.Model.GetValue("FCONTRACTNUMBER2", e.Row); // if (string.IsNullOrWhiteSpace(fCONTRACTNUMBER?.ToString()))
// {
// this.Model.SetValue("FISHX2", "", e.Row);
//判断是否为空 // this.Model.SetValue("F_MBBA_Decimal_qtr", 0, e.Row);
if (string.IsNullOrWhiteSpace(fCONTRACTNUMBER?.ToString()))
{
this.Model.SetValue("FISHX2", "", e.Row);
this.Model.SetValue("F_MBBA_Decimal_qtr", 0, e.Row); // //获取当前的父id
// var fPARENTROWID = this.Model.GetValue("FPARENTROWID", e.Row)?.ToString();
//获取当前的父id // DynamicObjectCollection FEntity2 = this.View.Model.DataObject["FEntity2"] as DynamicObjectCollection;
var fPARENTROWID = this.Model.GetValue("FPARENTROWID", e.Row)?.ToString();
DynamicObjectCollection FEntity2 = this.View.Model.DataObject["FEntity2"] as DynamicObjectCollection; // //获取行数
// List<int> ints = new List<int>();
//获取行数 // foreach (var fEntity in FEntity2)
List<int> ints = new List<int>(); // {
// if (fEntity["PARENTROWID"]?.ToString() == fPARENTROWID && fEntity["F_RowNew"]?.ToString() == "0")
// {
// ints.Add(Convert.ToInt32(fEntity["seq"]) - 1);
// }
// }
foreach (var fEntity in FEntity2) // //循环删除子项
{ // for (int i = 0; i < ints.Count; i++)
if (fEntity["PARENTROWID"]?.ToString() == fPARENTROWID && fEntity["F_RowNew"]?.ToString() == "0") // {
{ // this.View.Model.DeleteEntryRow("FEntity2", ints[0]);
ints.Add(Convert.ToInt32(fEntity["seq"]) - 1); // }
}
}
//循环删除子项 // foreach (var item in SaleBILLLIS)
for (int i = 0; i < ints.Count; i++) // {
{ // if (!string.IsNullOrEmpty(item.FSKBIllNO))
this.View.Model.DeleteEntryRow("FEntity2", ints[0]); // {
} // string[] strings = item.FSKBIllNO?.ToString()?.Split(',');
// //判断假如是一个收款单对应多个销售订单
// if (strings.Contains(fBILLNO?.ToString()) && strings.Count() == 1)
// {
// item.FSKBIllNO = "";
// item.FISHX = "";
// item.FWeiYi = "";
// }
// //判断多个收款单对应一个销售订单
// else if (strings.Contains(fBILLNO?.ToString()) && strings.Count() > 1)
// {
// List<string> strings1 = new List<string>(strings);
// strings1.Remove(fBILLNO?.ToString());
// string strings2 = string.Join(",", strings1);
// item.FSKBIllNO = strings2;
// }
// }
// }
// }
// int n = 1;
// //判断多个销售订单对应1个收款单只删除一个或多个但不是空的情况
// if (!string.IsNullOrWhiteSpace(fCONTRACTNUMBER?.ToString()))
// {
// double sumAmount = 0;
// string[] strings = fCONTRACTNUMBER?.ToString()?.Split(',');
// var FROWID = Convert.ToString(this.View.Model.GetValue("FROWID", e.Row));
// var Rowindex = this.View.Model.GetEntryRowCount("FEntity2");
// foreach (var item in SaleBILLLIS)
// {
// if (!string.IsNullOrEmpty(item.FSKBIllNO) && item.FSKBIllNO == fBILLNO?.ToString())
// {
// if (!strings.Contains(item.FCONTRACTNUMBER))
// {
// item.FSKBIllNO = "";
// item.FISHX = "";
// item.FWeiYi = "";
// }
// }
// if (strings.Contains(item.FCONTRACTNUMBER))
// {
// item.FSKBIllNO = fBILLNO?.ToString();
// item.FISHX = "已核销配对";
// this.Model.SetValue("FISHX2", "已核销配对", e.Row);
foreach (var item in SaleBILLLIS) // //this.View.Model.SetValue("FPARENTROWID", FROWID, item.FRow);
{ // //this.View.Model.CreateNewEntryRow("FEntity2");
if (!string.IsNullOrEmpty(item.FSKBIllNO)) // //this.View.Model.SetValue("FROWID", SequentialGuid.NewGuid().ToString(), Rowindex);
{ // //this.View.Model.SetValue("FPARENTROWID", FROWID, Rowindex);
string[] strings = item.FSKBIllNO?.ToString()?.Split(','); // //this.View.Model.SetValue("FBILLNO2", item.FBIllNO, Rowindex);
//判断假如是一个收款单对应多个销售订单 // //if (DateTime.TryParseExact(item?.FDate, dateFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime parsedDate))
if (strings.Contains(fBILLNO?.ToString()) && strings.Count() == 1) // //{
{ // // this.View.Model.SetValue("FDate2", item?.FDate, Rowindex);
item.FSKBIllNO = ""; // //}
item.FISHX = ""; // //else
item.FWeiYi = ""; // //{
} // // this.View.Model.SetValue("FDate2", DateTime.Now.AddDays(-1 * Convert.ToInt32(item?.FDate)).ToString("yyyy-MM-dd"), Rowindex);
//判断多个收款单对应一个销售订单 // //}
else if (strings.Contains(fBILLNO?.ToString()) && strings.Count() > 1) // //this.View.Model.SetValue("F_MBBA_Decimal_imu", item.FALLAMOUNT, Rowindex);
{ // //this.View.Model.SetValue("FClient2", item.FClient, Rowindex);
List<string> strings1 = new List<string>(strings); // //this.View.Model.SetValue("FCreated2", item.FCreated, Rowindex);
strings1.Remove(fBILLNO?.ToString()); // //this.View.Model.SetValue("FCONTRACTNUMBER2", item.FCONTRACTNUMBER, Rowindex);
string strings2 = string.Join(",", strings1); // //this.View.Model.SetValue("FSalesman2", item.FSalesman, Rowindex);
item.FSKBIllNO = strings2; // //this.View.UpdateView("FEntity2");
}
}
}
}
int n = 1;
//判断多个销售订单对应1个收款单只删除一个或多个但不是空的情况
if (!string.IsNullOrWhiteSpace(fCONTRACTNUMBER?.ToString()))
{
double sumAmount = 0;
string[] strings = fCONTRACTNUMBER?.ToString()?.Split(',');
var FROWID = Convert.ToString(this.View.Model.GetValue("FROWID", e.Row));
var Rowindex = this.View.Model.GetEntryRowCount("FEntity2");
foreach (var item in SaleBILLLIS)
{
if (!string.IsNullOrEmpty(item.FSKBIllNO) && item.FSKBIllNO == fBILLNO?.ToString())
{
if (!strings.Contains(item.FCONTRACTNUMBER))
{
item.FSKBIllNO = "";
item.FISHX = "";
item.FWeiYi = "";
}
}
if (strings.Contains(item.FCONTRACTNUMBER))
{
item.FSKBIllNO = fBILLNO?.ToString();
item.FISHX = "已核销配对";
this.Model.SetValue("FISHX2", "已核销配对", e.Row);
//this.View.Model.SetValue("FPARENTROWID", FROWID, item.FRow); // sumAmount += item.FALLAMOUNT;
//this.View.Model.CreateNewEntryRow("FEntity2"); // }
//this.View.Model.SetValue("FROWID", SequentialGuid.NewGuid().ToString(), Rowindex); // }
//this.View.Model.SetValue("FPARENTROWID", FROWID, Rowindex); // this.Model.SetValue("F_MBBA_Decimal_qtr", sumAmount, e.Row);
//this.View.Model.SetValue("FBILLNO2", item.FBIllNO, Rowindex); // n = SaleBILLLIS.Count(a => strings.Contains(a.FCONTRACTNUMBER));
//if (DateTime.TryParseExact(item?.FDate, dateFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime parsedDate)) // }
//{
// this.View.Model.SetValue("FDate2", item?.FDate, Rowindex);
//}
//else
//{
// this.View.Model.SetValue("FDate2", DateTime.Now.AddDays(-1 * Convert.ToInt32(item?.FDate)).ToString("yyyy-MM-dd"), Rowindex);
//}
//this.View.Model.SetValue("F_MBBA_Decimal_imu", item.FALLAMOUNT, Rowindex);
//this.View.Model.SetValue("FClient2", item.FClient, Rowindex);
//this.View.Model.SetValue("FCreated2", item.FCreated, Rowindex);
//this.View.Model.SetValue("FCONTRACTNUMBER2", item.FCONTRACTNUMBER, Rowindex);
//this.View.Model.SetValue("FSalesman2", item.FSalesman, Rowindex);
//this.View.UpdateView("FEntity2");
sumAmount += item.FALLAMOUNT; // if (n == 0)
} // {
} // this.Model.SetValue("FISHX2", "", e.Row);
this.Model.SetValue("F_MBBA_Decimal_qtr", sumAmount, e.Row); // }
n = SaleBILLLIS.Count(a => strings.Contains(a.FCONTRACTNUMBER)); // //删除数据
} // this.View.Model.DeleteEntryData("FEntity");
// //绑定销售订单数据
if (n == 0) // for (int i = 0; i < SaleBILLLIS.Count; i++)
{ // {
this.Model.SetValue("FISHX2", "", e.Row); // int rowindex = this.View.Model.GetEntryRowCount("FEntity");
} // this.View.Model.CreateNewEntryRow("FEntity");
//删除数据 // //单据编号
this.View.Model.DeleteEntryData("FEntity"); // this.View.Model.SetValue("FBILLNO", SaleBILLLIS[i].FBIllNO, i);
//绑定销售订单数据 // //日期
for (int i = 0; i < SaleBILLLIS.Count; i++) // this.View.Model.SetValue("FDate", SaleBILLLIS[i].FDate, i);
{ // //金额
int rowindex = this.View.Model.GetEntryRowCount("FEntity"); // this.View.Model.SetValue("F_MBBA_Decimal_c1c", SaleBILLLIS[i].FALLAMOUNT, i);
this.View.Model.CreateNewEntryRow("FEntity"); // //类型
//单据编号 // this.View.Model.SetValue("FType", SaleBILLLIS[i].FType, i);
this.View.Model.SetValue("FBILLNO", SaleBILLLIS[i].FBIllNO, i); // //纸质合同号
//日期 // this.View.Model.SetValue("FCONTRACTNUMBER", SaleBILLLIS[i].FCONTRACTNUMBER, i);
this.View.Model.SetValue("FDate", SaleBILLLIS[i].FDate, i); // //客户名称
//金额 // this.View.Model.SetValue("FClient", SaleBILLLIS[i].FClient, i);
this.View.Model.SetValue("F_MBBA_Decimal_c1c", SaleBILLLIS[i].FALLAMOUNT, i); // //已核销金额
//类型 // this.View.Model.SetValue("F_MBBA_Decimal_vb1", SaleBILLLIS[i].FYAMOUNT, i);
this.View.Model.SetValue("FType", SaleBILLLIS[i].FType, i); // //待核销金额
//纸质合同号 // this.View.Model.SetValue("F_MBBA_Decimal_emq", SaleBILLLIS[i].FDAMOUNT, i);
this.View.Model.SetValue("FCONTRACTNUMBER", SaleBILLLIS[i].FCONTRACTNUMBER, i); // //单据编号(收款单)
//客户名称 // this.View.Model.SetValue("FSKBILLNO", SaleBILLLIS[i].FSKBIllNO, i);
this.View.Model.SetValue("FClient", SaleBILLLIS[i].FClient, i); // //是否核销匹对
//已核销金额 // this.View.Model.SetValue("FISHX", SaleBILLLIS[i].FISHX, i);
this.View.Model.SetValue("F_MBBA_Decimal_vb1", SaleBILLLIS[i].FYAMOUNT, i); // //是否唯一
//待核销金额 // this.View.Model.SetValue("FWeiYi", SaleBILLLIS[i]?.FWeiYi, i);
this.View.Model.SetValue("F_MBBA_Decimal_emq", SaleBILLLIS[i].FDAMOUNT, i); // //商务人员
//单据编号(收款单) // this.View.Model.SetValue("FCreated", SaleBILLLIS[i]?.FCreated, i);
this.View.Model.SetValue("FSKBILLNO", SaleBILLLIS[i].FSKBIllNO, i); // //销售员
//是否核销匹对 // this.View.Model.SetValue("FSalesman", SaleBILLLIS[i]?.FSalesman, i);
this.View.Model.SetValue("FISHX", SaleBILLLIS[i].FISHX, i); // }
//是否唯一 // this.View.UpdateView("FEntity");
this.View.Model.SetValue("FWeiYi", SaleBILLLIS[i]?.FWeiYi, i); // }
//商务人员 // }
this.View.Model.SetValue("FCreated", SaleBILLLIS[i]?.FCreated, i); // if (e.Field.Key.Equals("F_ISHX"))
//销售员 // {
this.View.Model.SetValue("FSalesman", SaleBILLLIS[i]?.FSalesman, i); // //获取当前复选框的值
} // var IsHX = this.Model.GetValue("F_ISHX", e.Row)?.ToString();
this.View.UpdateView("FEntity"); // var ISWeiYi = this.Model.GetValue("FWeiYi2", e.Row)?.ToString();
} // //查询对应的销售订单/应收单-》勾选复选框
} // var fc = this.Model.GetValue("FCONTRACTNUMBER2", e.Row)?.ToString();
if (e.Field.Key.Equals("F_ISHX")) // if (IsHX == "True")
{ // {
//获取当前复选框的值 // //查看是否为唯一
var IsHX = this.Model.GetValue("F_ISHX", e.Row)?.ToString(); // if (!string.IsNullOrEmpty(ISWeiYi) && ISWeiYi == "否")
var ISWeiYi = this.Model.GetValue("FWeiYi2", e.Row)?.ToString(); // {
//查询对应的销售订单/应收单-》勾选复选框 // //获取销售订单/应收单单据体数据
var fc = this.Model.GetValue("FCONTRACTNUMBER2", e.Row)?.ToString(); // DynamicObjectCollection FEntity = this.View.Model.DataObject["FEntity"] as DynamicObjectCollection;
if (IsHX == "True") // for (int i = 0; i < FEntity.Count; i++)
{ // {
//查看是否为唯一 // if (FEntity[i]["FCONTRACTNUMBER"]?.ToString() == fc)
if (!string.IsNullOrEmpty(ISWeiYi) && ISWeiYi == "否") // {
{ // this.Model.SetValue("F_ISGX", "True", i);
//获取销售订单/应收单单据体数据 // }
DynamicObjectCollection FEntity = this.View.Model.DataObject["FEntity"] as DynamicObjectCollection; // }
for (int i = 0; i < FEntity.Count; i++) // }
{ // }
if (FEntity[i]["FCONTRACTNUMBER"]?.ToString() == fc) // if (IsHX == "False")
{ // {
this.Model.SetValue("F_ISGX", "True", i); // //获取销售订单/应收单单据体数据
} // DynamicObjectCollection FEntity2 = this.View.Model.DataObject["FEntity2"] as DynamicObjectCollection;
} // int n = 0;
} // //判断其他收款单是否勾选
} // foreach (var item in FEntity2)
if (IsHX == "False") // {
{ // if (item["F_ISHX"]?.ToString() == "True" && item["FCONTRACTNUMBER2"]?.ToString() == fc)
//获取销售订单/应收单单据体数据 // {
DynamicObjectCollection FEntity2 = this.View.Model.DataObject["FEntity2"] as DynamicObjectCollection; // n++;
int n = 0; // }
//判断其他收款单是否勾选 // }
foreach (var item in FEntity2)
{
if (item["F_ISHX"]?.ToString() == "True" && item["FCONTRACTNUMBER2"]?.ToString() == fc)
{
n++;
}
}
if (n == 0)
{
//查看是否为唯一
if (!string.IsNullOrEmpty(ISWeiYi) && ISWeiYi == "否")
{
//获取销售订单/应收单单据体数据
DynamicObjectCollection FEntity = this.View.Model.DataObject["FEntity"] as DynamicObjectCollection;
for (int i = 0; i < FEntity.Count; i++)
{
if (FEntity[i]["FCONTRACTNUMBER"]?.ToString() == fc)
{
this.Model.SetValue("F_ISGX", "False", i);
}
}
}
}
}
}
}
// if (n == 0)
// {
// //查看是否为唯一
// if (!string.IsNullOrEmpty(ISWeiYi) && ISWeiYi == "否")
// {
// //获取销售订单/应收单单据体数据
// DynamicObjectCollection FEntity = this.View.Model.DataObject["FEntity"] as DynamicObjectCollection;
// for (int i = 0; i < FEntity.Count; i++)
// {
// if (FEntity[i]["FCONTRACTNUMBER"]?.ToString() == fc)
// {
// this.Model.SetValue("F_ISGX", "False", i);
// }
// }
// }
// }
// }
// }
//}
#endregion
public enum ENUM_ROWTYPE : int public enum ENUM_ROWTYPE : int
{ {
Default = 0, Default = 0,

Binary file not shown.

View File

@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2007 James Newton-King
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Binary file not shown.

View File

@ -0,0 +1,71 @@
# ![Logo](https://raw.githubusercontent.com/JamesNK/Newtonsoft.Json/master/Doc/icons/logo.jpg) Json.NET
[![NuGet version (Newtonsoft.Json)](https://img.shields.io/nuget/v/Newtonsoft.Json.svg?style=flat-square)](https://www.nuget.org/packages/Newtonsoft.Json/)
[![Build status](https://dev.azure.com/jamesnk/Public/_apis/build/status/JamesNK.Newtonsoft.Json?branchName=master)](https://dev.azure.com/jamesnk/Public/_build/latest?definitionId=8)
Json.NET is a popular high-performance JSON framework for .NET
## Serialize JSON
```csharp
Product product = new Product();
product.Name = "Apple";
product.Expiry = new DateTime(2008, 12, 28);
product.Sizes = new string[] { "Small" };
string json = JsonConvert.SerializeObject(product);
// {
// "Name": "Apple",
// "Expiry": "2008-12-28T00:00:00",
// "Sizes": [
// "Small"
// ]
// }
```
## Deserialize JSON
```csharp
string json = @"{
'Name': 'Bad Boys',
'ReleaseDate': '1995-4-7T00:00:00',
'Genres': [
'Action',
'Comedy'
]
}";
Movie m = JsonConvert.DeserializeObject<Movie>(json);
string name = m.Name;
// Bad Boys
```
## LINQ to JSON
```csharp
JArray array = new JArray();
array.Add("Manual text");
array.Add(new DateTime(2000, 5, 23));
JObject o = new JObject();
o["MyArray"] = array;
string json = o.ToString();
// {
// "MyArray": [
// "Manual text",
// "2000-05-23T00:00:00"
// ]
// }
```
## Links
- [Homepage](https://www.newtonsoft.com/json)
- [Documentation](https://www.newtonsoft.com/json/help)
- [NuGet Package](https://www.nuget.org/packages/Newtonsoft.Json)
- [Release Notes](https://github.com/JamesNK/Newtonsoft.Json/releases)
- [Contributing Guidelines](https://github.com/JamesNK/Newtonsoft.Json/blob/master/CONTRIBUTING.md)
- [License](https://github.com/JamesNK/Newtonsoft.Json/blob/master/LICENSE.md)
- [Stack Overflow](https://stackoverflow.com/questions/tagged/json.net)

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB