|
|
@ -274,7 +274,6 @@ namespace CK.SCP.Controller |
|
|
|
{ |
|
|
|
var tableName = GetTableName(uniApiType); |
|
|
|
var apiData = new TS_UNI_API(); |
|
|
|
|
|
|
|
apiData.InterfaceType = uniApiType.ToString(); |
|
|
|
apiData.TableName = tableName.ToString(); |
|
|
|
apiData.BillNum = bill.AsnBillNum; |
|
|
@ -298,47 +297,47 @@ namespace CK.SCP.Controller |
|
|
|
var ts = db.TS_UNI_API.Count(p => p.ErpLineNum == detail.PoLine && p.ErpBillNum == bill.PoBillNum); |
|
|
|
string str = "000"; |
|
|
|
string st = bill.PoBillNum.Substring(0,4); |
|
|
|
if (ts == 0) |
|
|
|
{ |
|
|
|
//if (ts == 0)
|
|
|
|
//{
|
|
|
|
string str1= detail.PoLine.ToString(); |
|
|
|
|
|
|
|
apiData.Extend3 = str1; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
if (ts == 1) |
|
|
|
{ |
|
|
|
var ts1 = db.TB_PO_DETAIL.Where(p => p.PoLine == detail.PoLine && p.PoBillNum == bill.PoBillNum).Select(r => r.PoLine).Max(); |
|
|
|
int ts2 = ts1 + 50; |
|
|
|
string str2 = ts2.ToString(); |
|
|
|
|
|
|
|
apiData.Extend3 = str2; |
|
|
|
} |
|
|
|
else if (ts == 2) |
|
|
|
{ |
|
|
|
var ts1 = db.TB_PO_DETAIL.Where(p => p.PoLine == detail.PoLine && p.PoBillNum == bill.PoBillNum).Select(r => r.PoLine).Max(); |
|
|
|
int ts2 = ts1 + 60; |
|
|
|
string str3 = ts2.ToString(); |
|
|
|
|
|
|
|
apiData.Extend3 = str3; |
|
|
|
} |
|
|
|
else if (ts == 3) |
|
|
|
{ |
|
|
|
var ts1 = db.TB_PO_DETAIL.Where(p => p.PoLine == detail.PoLine && p.PoBillNum == bill.PoBillNum).Select(r => r.PoLine).Max(); |
|
|
|
int ts2 = ts1 + 70; |
|
|
|
string str4 = ts2.ToString(); |
|
|
|
|
|
|
|
apiData.Extend3 = str4; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var ts3 = db.TS_UNI_API.Where(p => p.ErpLineNum == detail.PoLine && p.ErpBillNum == bill.PoBillNum).Select(r => r.Extend3).Max(); |
|
|
|
int ts4 = int.Parse(ts3) + 10; |
|
|
|
string str5 = ts4.ToString(); |
|
|
|
|
|
|
|
apiData.Extend3 = str5; |
|
|
|
} |
|
|
|
} |
|
|
|
//}
|
|
|
|
//else
|
|
|
|
// {
|
|
|
|
// if (ts == 1)
|
|
|
|
// {
|
|
|
|
// var ts1 = db.TB_PO_DETAIL.Where(p => p.PoLine == detail.PoLine && p.PoBillNum == bill.PoBillNum).Select(r => r.PoLine).Max();
|
|
|
|
// int ts2 = ts1 + 50;
|
|
|
|
// string str2 = ts2.ToString();
|
|
|
|
|
|
|
|
// apiData.Extend3 = str2;
|
|
|
|
// }
|
|
|
|
// else if (ts == 2)
|
|
|
|
// {
|
|
|
|
// var ts1 = db.TB_PO_DETAIL.Where(p => p.PoLine == detail.PoLine && p.PoBillNum == bill.PoBillNum).Select(r => r.PoLine).Max();
|
|
|
|
// int ts2 = ts1 + 60;
|
|
|
|
// string str3 = ts2.ToString();
|
|
|
|
|
|
|
|
// apiData.Extend3 = str3;
|
|
|
|
// }
|
|
|
|
// else if (ts == 3)
|
|
|
|
// {
|
|
|
|
// var ts1 = db.TB_PO_DETAIL.Where(p => p.PoLine == detail.PoLine && p.PoBillNum == bill.PoBillNum).Select(r => r.PoLine).Max();
|
|
|
|
// int ts2 = ts1 + 70;
|
|
|
|
// string str4 = ts2.ToString();
|
|
|
|
|
|
|
|
// apiData.Extend3 = str4;
|
|
|
|
// }
|
|
|
|
// else
|
|
|
|
// {
|
|
|
|
// var ts3 = db.TS_UNI_API.Where(p => p.ErpLineNum == detail.PoLine && p.ErpBillNum == bill.PoBillNum).Select(r => r.Extend3).Max();
|
|
|
|
// int ts4 = int.Parse(ts3) + 10;
|
|
|
|
// string str5 = ts4.ToString();
|
|
|
|
|
|
|
|
// apiData.Extend3 = str5;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
if (bill.SubSite == "W21") |
|
|
|
{ |
|
|
|
apiData.VendBatch = detail.UpdateUser; |
|
|
|