获取默认VID

This commit is contained in:
admin
2021-01-18 16:44:18 +08:00
parent 6f56a4ead3
commit caae14f652
9 changed files with 31 additions and 13 deletions

View File

@@ -59,6 +59,7 @@
<Compile Include="Base\UnitDAL.cs" />
<Compile Include="Base\WarehouseDAL.cs" />
<Compile Include="VoucherParameter.cs" />
<Compile Include="VT.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="ADODB, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">

View File

@@ -43,7 +43,7 @@ namespace NX.ERP.U8.Store
headXml.setAttribute("brdflag", 0);
headXml.setAttribute("cmaker", "");
headXml.setAttribute("cvouchtype", this.VoucherID);
headXml.setAttribute("vt_id", "65");
headXml.setAttribute("vt_id", new VT().GetDefaltVTID("0412"));
headXml.setAttribute("editprop", "A");
headXml.setAttribute("cdepcode", "1");

View File

@@ -39,7 +39,7 @@ namespace NX.ERP.U8.Store
headXml.setAttribute("ddate", storeIn.Date);
headXml.setAttribute("cmaker", "/");
headXml.setAttribute("cvouchtype", this.VoucherID);
headXml.setAttribute("vt_id", "");
headXml.setAttribute("vt_id",new VT().GetDefaltVTID("0301"));
headXml.setAttribute("editprop", "A");
headXml.setAttribute("cdepcode", "");
headXml.setAttribute("cpersoncode", "");

View File

@@ -38,7 +38,7 @@ namespace NX.ERP.U8.Store
headXml.setAttribute("ddate", storeIn.Date);
headXml.setAttribute("cmaker", "/");
headXml.setAttribute("cvouchtype", this.VoucherID);
headXml.setAttribute("vt_id", "");
headXml.setAttribute("vt_id", new VT().GetDefaltVTID("0302"));
headXml.setAttribute("editprop", "A");
headXml.setAttribute("cdepcode", "");
headXml.setAttribute("cpersoncode", "");

View File

@@ -37,7 +37,7 @@ namespace NX.ERP.U8.Store
headXml.setAttribute("ddate", storeIn.Date);
headXml.setAttribute("cmaker", "");
headXml.setAttribute("vt_id", "63");
headXml.setAttribute("vt_id", new VT().GetDefaltVTID("0411"));
headXml.setAttribute("editprop", "A");
headXml.setAttribute("cdepcode", "");
headXml.setAttribute("cpersoncode", "");

View File

@@ -44,7 +44,7 @@ namespace NX.ERP.U8.Store
headXml.setAttribute("brdflag", 1); //DomHead[0]["brdflag"] = ""; //收发标志,int类型
headXml.setAttribute("csource", puStoreIn.Source); //DomHead[0]["csource"] = ""; //单据来源,int类型
headXml.setAttribute("cmaker", puStoreIn.Maker);//DomHead[0]["cmaker"] = ""; //制单人,string类型
headXml.setAttribute("vt_id", "27");
headXml.setAttribute("vt_id", new VT().GetDefaltVTID("24"));
headXml.setAttribute("editprop", "A");
headXml.setAttribute("cdepcode", puStoreIn.Depcode);
headXml.setAttribute("cpersoncode", puStoreIn.PersonCode);

View File

@@ -40,7 +40,7 @@ namespace NX.ERP.U8.Store
headXml.setAttribute("ddate", storeOut.Date);
headXml.setAttribute("cmaker", "");
headXml.setAttribute("vt_id","");
headXml.setAttribute("vt_id", new VT().GetDefaltVTID("0303"));
headXml.setAttribute("editprop", "A");
headXml.setAttribute("cdepcode", "");
headXml.setAttribute("cpersoncode", "");

23
NX.ERP.U8/VT.cs Normal file
View File

@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Dapper;
namespace NX.ERP.U8
{
public class VT
{
public string GetDefaltVTID(string CardNumber)
{
using (var conn = new System.Data.SqlClient.SqlConnection(U8LoginContext.Instance.Constr4Net))
{
var strSql= "select DEF_ID from vouchers_base where CardNumber=@CardNumber";
return conn.ExecuteScalar<string>(strSql, new { CardNumber }, null, 100, System.Data.CommandType.Text);
}
}
}
}