Item JSON format Code:
var items = "";
var itemsCount = this.ProductDetails.Count();
var count = 0;
var s = "";
foreach (var item in this.ProductDetails)
{
count = count + 1;
var itemNum = count.ToString();
item.ItemNo = itemNum;
s = "{" + "\"itemNumber\": \"" + item.ItemNo +
"\",\"brand\": \"" + item.BrandDesc +
"\",\"material\": \"" + item.ProductID.content +
"\", \"stockQuantity\": \"" + item.Quantity.ToString().Trim() + "\"" +
"}";
items = items + s;
//count = count + 1;
if (count != itemsCount)
{
items = items + ",";
}
}
Header+Item JSON format Code:
Body = "{ \"calledFor\": \"" + calledFor + "\", \"orderType\": \"" + this.OrderTypeDropDown_new +
"\", \"distChannel\": \"" + this.DistributionChannelDropDown_new +
"\", \"chequeRTGS\": \"" + this.ChequeRTGS.GetDescription() +
"\", \"chequeRTGSDate\": \"" + this.ChequeRTGSDate.ToString().Replace("-", "") +
"\", \"dealerCode\": \"" + this.AccountID +
"\", \"discountCode\" : \"" + discountCode +
"\", \"discountValue\" : \"" + discountValue +
"\", \"plant\" : \"" + this.Plant +
"\", \"draftOrder\": \"N\"," +
"\"draftOrderID\": \"\"," +
"\"itemDetails\": [" +
items + "]" +
", \"returnMessages\": []" +
", \"orderCreated\": []" +
"}";
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
27 | |
24 | |
19 | |
13 | |
12 | |
11 | |
10 | |
8 | |
7 | |
6 |