添加修改功能

This commit is contained in:
gongxh
2021-03-15 09:50:23 +08:00
parent 073bd82663
commit bd8fb8ca93
12 changed files with 277 additions and 41 deletions

View File

@@ -21,6 +21,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>

11
NX.ERP.Model/BaseBill.cs Normal file
View File

@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NX.ERP.U8.Store
{
public class BaseBill
{
}
}

View File

@@ -60,6 +60,7 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="BaseBill.cs" />
<Compile Include="BaseModel.cs" /> <Compile Include="BaseModel.cs" />
<Compile Include="TimestampConverter.cs" /> <Compile Include="TimestampConverter.cs" />
<Compile Include="Request\Arrival.cs" /> <Compile Include="Request\Arrival.cs" />

View File

@@ -13,9 +13,10 @@ namespace NX.ERP.Model.Request
private string depcode; private string depcode;
private string whcode; private string whcode;
private IList<PuStoreInDetail> puStoreInDetails = new List<PuStoreInDetail>(); private IList<PuStoreInDetail> puStoreInDetails = new List<PuStoreInDetail>();
private string _puCode;
private string maker; private string maker;
private string personCode; private string personCode;
public IList<PuStoreInDetail> Details { get => puStoreInDetails; set => puStoreInDetails = value; } public IList<PuStoreInDetail> Details { get => puStoreInDetails; set => puStoreInDetails = value; }
public int Id { get => id; set => id = value; } public int Id { get => id; set => id = value; }
public string Code { get => code; set => code = value; } public string Code { get => code; set => code = value; }
@@ -34,8 +35,5 @@ namespace NX.ERP.Model.Request
/// </summary> /// </summary>
public string SourceCode { get; set; } public string SourceCode { get; set; }
} }
} }

View File

@@ -8,9 +8,9 @@ namespace NX.ERP.Model.Request
public class PuStoreInDetail public class PuStoreInDetail
{ {
private int id; private int id;
private int puStoreInId;
private string invcode; private string invcode;
private string unit;
private double quantity; private double quantity;
public string Batch { get; set; } public string Batch { get; set; }

View File

@@ -22,7 +22,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>x86</PlatformTarget>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
@@ -45,6 +45,7 @@
<Compile Include="Mom\MomOrderDAL.cs" /> <Compile Include="Mom\MomOrderDAL.cs" />
<Compile Include="Purchase\ArrivalDAL.cs" /> <Compile Include="Purchase\ArrivalDAL.cs" />
<Compile Include="Sale\DispatchListDAL.cs" /> <Compile Include="Sale\DispatchListDAL.cs" />
<Compile Include="Store\BaseBill.cs" />
<Compile Include="Store\MaterielStoreOutDAL.cs" /> <Compile Include="Store\MaterielStoreOutDAL.cs" />
<Compile Include="Store\OtherStoreInDAL.cs" /> <Compile Include="Store\OtherStoreInDAL.cs" />
<Compile Include="Store\OtherStoreOutDAL.cs" /> <Compile Include="Store\OtherStoreOutDAL.cs" />
@@ -71,7 +72,7 @@
<HintPath>..\packages\Dapper.1.42\lib\net35\Dapper.dll</HintPath> <HintPath>..\packages\Dapper.1.42\lib\net35\Dapper.dll</HintPath>
</Reference> </Reference>
<Reference Include="Interop.MSXML2"> <Reference Include="Interop.MSXML2">
<HintPath>D:\U8SOFT\Interop\Interop.MSXML2.dll</HintPath> <HintPath>E:\U8SOFT\Interop\Interop.MSXML2.dll</HintPath>
<EmbedInteropTypes>True</EmbedInteropTypes> <EmbedInteropTypes>True</EmbedInteropTypes>
</Reference> </Reference>
<Reference Include="Interop.U8Login, Version=1.14.0.0, Culture=neutral, PublicKeyToken=79a4e7ad54eeabca, processorArchitecture=MSIL"> <Reference Include="Interop.U8Login, Version=1.14.0.0, Culture=neutral, PublicKeyToken=79a4e7ad54eeabca, processorArchitecture=MSIL">
@@ -83,16 +84,17 @@
<Reference Include="System.configuration" /> <Reference Include="System.configuration" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="UFIDA.U8.MomServiceCommon"> <Reference Include="UFIDA.U8.MomServiceCommon">
<HintPath>D:\U8SOFT\UFMOM\U8APIFramework\UFIDA.U8.MomServiceCommon.dll</HintPath> <HintPath>E:\U8SOFT\UFMOM\U8APIFramework\UFIDA.U8.MomServiceCommon.dll</HintPath>
</Reference> </Reference>
<Reference Include="UFIDA.U8.U8APIFramework"> <Reference Include="UFIDA.U8.U8APIFramework">
<HintPath>D:\U8SOFT\UFMOM\U8APIFramework\UFIDA.U8.U8APIFramework.dll</HintPath> <HintPath>E:\U8SOFT\UFMOM\U8APIFramework\UFIDA.U8.U8APIFramework.dll</HintPath>
</Reference> </Reference>
<Reference Include="UFIDA.U8.U8MOMAPIFramework"> <Reference Include="UFIDA.U8.U8MOMAPIFramework">
<HintPath>D:\U8SOFT\UFMOM\U8APIFramework\UFIDA.U8.U8MOMAPIFramework.dll</HintPath> <HintPath>E:\U8SOFT\UFMOM\U8APIFramework\UFIDA.U8.U8MOMAPIFramework.dll</HintPath>
</Reference> </Reference>
<Reference Include="UFSoft.U8.Framework.Login.UI"> <Reference Include="UFSoft.U8.Framework.Login.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=19a34671517e8c56, processorArchitecture=MSIL">
<HintPath>D:\U8SOFT\Framework\UFSoft.U8.Framework.Login.UI.dll</HintPath> <SpecificVersion>False</SpecificVersion>
<HintPath>E:\U8SOFT\Framework\UFSoft.U8.Framework.Login.UI.dll</HintPath>
</Reference> </Reference>
<Reference Include="UFSoft.U8.Framework.LoginContext, Version=1.0.0.0, Culture=neutral, PublicKeyToken=90e57cffdf9d854d, processorArchitecture=MSIL"> <Reference Include="UFSoft.U8.Framework.LoginContext, Version=1.0.0.0, Culture=neutral, PublicKeyToken=90e57cffdf9d854d, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>

View File

@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NX.ERP.U8.Store
{
public class BaseBill
{
}
}

View File

@@ -93,7 +93,7 @@ namespace NX.ERP.U8.Store
#region 明细 #region 明细
bodyXml = domBody.createElement("z:row"); bodyXml = domBody.createElement("z:row");
bodyXml.setAttribute("autoid", n); //bodyXml.setAttribute("autoid", n);
bodyXml.setAttribute("cinvcode", detail.InvCode); bodyXml.setAttribute("cinvcode", detail.InvCode);
bodyXml.setAttribute("iquantity", detail.Quantity); bodyXml.setAttribute("iquantity", detail.Quantity);
bodyXml.setAttribute("irowno", n + 1); bodyXml.setAttribute("irowno", n + 1);

View File

@@ -15,13 +15,9 @@ namespace NX.ERP.U8.Store
public PuStoreInDAL() : base("01", "U8API/PuStoreIn") public PuStoreInDAL() : base("01", "U8API/PuStoreIn")
{ {
} }
/// <summary>
/// 保存一个采购到货单
/// </summary>
/// <param name="puStoreIn"></param>
public string AddVocher(Model.Request.PuStoreIn puStoreIn)
{
private VoucherParameter BuildVocher(Model.Request.PuStoreIn puStoreIn, string EditType)
{
VoucherParameter voucherParameter = new VoucherParameter VoucherParameter voucherParameter = new VoucherParameter
{ {
VoucherType = this.VoucherID, VoucherType = this.VoucherID,
@@ -36,7 +32,7 @@ namespace NX.ERP.U8.Store
headXml.setAttribute("cvouchtype", this.VoucherID);//DomHead[0]["cvouchtype"] = ""; //单据类型,string类型 headXml.setAttribute("cvouchtype", this.VoucherID);//DomHead[0]["cvouchtype"] = ""; //单据类型,string类型
headXml.setAttribute("id", puStoreIn.Id); //DomHead[0]["id"] = ""; //主关键字段,int类型 headXml.setAttribute("id", puStoreIn.Id); //DomHead[0]["id"] = ""; //主关键字段,int类型
headXml.setAttribute("bomfirst", "0"); //DomHead[0]["bomfirst"] = ""; //委外期初标志,string类型 headXml.setAttribute("bomfirst", "0"); //DomHead[0]["bomfirst"] = ""; //委外期初标志,string类型
headXml.setAttribute("ccode", "190700000050"); //DomHead[0]["ccode"] = ""; //入库单号,string类型 headXml.setAttribute("ccode", puStoreIn.Code); //DomHead[0]["ccode"] = ""; //入库单号,string类型
headXml.setAttribute("ddate", System.DateTime.Now.ToString("G")); //DomHead[0]["ddate"] = ""; //入库日期,DateTime类型 headXml.setAttribute("ddate", System.DateTime.Now.ToString("G")); //DomHead[0]["ddate"] = ""; //入库日期,DateTime类型
headXml.setAttribute("iverifystate", 0); //DomHead[0]["iverifystate"] = ""; //iverifystate,int类型 headXml.setAttribute("iverifystate", 0); //DomHead[0]["iverifystate"] = ""; //iverifystate,int类型
headXml.setAttribute("iswfcontrolled", 0); //DomHead[0]["iswfcontrolled"] = ""; //iswfcontrolled,int类型 headXml.setAttribute("iswfcontrolled", 0); //DomHead[0]["iswfcontrolled"] = ""; //iswfcontrolled,int类型
@@ -45,7 +41,7 @@ namespace NX.ERP.U8.Store
headXml.setAttribute("csource", puStoreIn.Source); //DomHead[0]["csource"] = ""; //单据来源,int类型 headXml.setAttribute("csource", puStoreIn.Source); //DomHead[0]["csource"] = ""; //单据来源,int类型
headXml.setAttribute("cmaker", puStoreIn.Maker);//DomHead[0]["cmaker"] = ""; //制单人,string类型 headXml.setAttribute("cmaker", puStoreIn.Maker);//DomHead[0]["cmaker"] = ""; //制单人,string类型
headXml.setAttribute("vt_id", new VT().GetDefaltVTID("24")); headXml.setAttribute("vt_id", new VT().GetDefaltVTID("24"));
headXml.setAttribute("editprop", "A"); headXml.setAttribute("editprop", EditType);
headXml.setAttribute("cdepcode", puStoreIn.Deptcode); headXml.setAttribute("cdepcode", puStoreIn.Deptcode);
headXml.setAttribute("cpersoncode", puStoreIn.PersonCode); headXml.setAttribute("cpersoncode", puStoreIn.PersonCode);
headXml.setAttribute("crdcode", "101" /*puStoreIn.RdCode*/); headXml.setAttribute("crdcode", "101" /*puStoreIn.RdCode*/);
@@ -67,20 +63,14 @@ namespace NX.ERP.U8.Store
headXml.setAttribute("darvdate", Arrival.ArrivalDate); headXml.setAttribute("darvdate", Arrival.ArrivalDate);
headXml.setAttribute("itaxrate", Arrival.TaxRate); headXml.setAttribute("itaxrate", Arrival.TaxRate);
headXml.setAttribute("cptcode", Arrival.PTCode); headXml.setAttribute("cptcode", Arrival.PTCode);
IXMLDOMElement bodyXml; IXMLDOMElement bodyXml;
for (var n = 0; n < puStoreIn.Details.Count; n++) for (var n = 0; n < puStoreIn.Details.Count; n++)
{ {
var detail = puStoreIn.Details[n]; var detail = puStoreIn.Details[n];
var arrivalDetail = Arrival.ArrivalDtlLst.First(m => { return m.ArrivalDtlId == detail.SorceDetailId; }); var arrivalDetail = Arrival.ArrivalDtlLst.First(m => { return m.ArrivalDtlId == detail.SorceDetailId; });
headXml.setAttribute("cordercode", arrivalDetail.OrderCode); headXml.setAttribute("cordercode", arrivalDetail.OrderCode);
// headXml.setAttribute("ipurorderid", arrivalDetail.PoId); // headXml.setAttribute("ipurorderid", arrivalDetail.PoId);
bodyXml = domBody.createElement("z:row"); bodyXml = domBody.createElement("z:row");
if (arrivalDetail.cunitid != 0) //需要做辅助计量单位 if (arrivalDetail.cunitid != 0) //需要做辅助计量单位
{ {
var _inum = detail.Quantity / arrivalDetail.inspecexchrate; var _inum = detail.Quantity / arrivalDetail.inspecexchrate;
@@ -93,9 +83,6 @@ namespace NX.ERP.U8.Store
{ {
bodyXml.setAttribute("innum", 0); bodyXml.setAttribute("innum", 0);
} }
bodyXml.setAttribute("cinvcode", detail.Invcode); bodyXml.setAttribute("cinvcode", detail.Invcode);
bodyXml.setAttribute("iquantity", detail.Quantity); bodyXml.setAttribute("iquantity", detail.Quantity);
bodyXml.setAttribute("irowno", n + 1); bodyXml.setAttribute("irowno", n + 1);
@@ -104,8 +91,6 @@ namespace NX.ERP.U8.Store
bodyXml.setAttribute("cbatch", detail.Batch); bodyXml.setAttribute("cbatch", detail.Batch);
bodyXml.setAttribute("cposition", detail.Position); bodyXml.setAttribute("cposition", detail.Position);
// bodyXml.setAttribute("cposname", "B1Y1H001"); //货位,string类型
//iXMLDOMElement.setAttribute("carvcode", Arrival.ArrivalCode);
bodyXml.setAttribute("cbarvcode", Arrival.ArrivalNo); bodyXml.setAttribute("cbarvcode", Arrival.ArrivalNo);
bodyXml.setAttribute("ipurarriveid", Arrival.ArrivalId); bodyXml.setAttribute("ipurarriveid", Arrival.ArrivalId);
bodyXml.setAttribute("iarrsid", detail.SorceDetailId); bodyXml.setAttribute("iarrsid", detail.SorceDetailId);
@@ -132,10 +117,17 @@ namespace NX.ERP.U8.Store
} }
} }
domHead.selectSingleNode("//rs:data").appendChild(headXml); domHead.selectSingleNode("//rs:data").appendChild(headXml);
return voucherParameter;
}
/// <summary>
/// 保存一个采购到货单
/// </summary>
/// <param name="puStoreIn"></param>
public string AddVocher(Model.Request.PuStoreIn puStoreIn)
{
try try
{ {
var voucherParameter = BuildVocher(puStoreIn, "A");
return AddRdVoucher(voucherParameter); return AddRdVoucher(voucherParameter);
} }
catch (Exception err) catch (Exception err)
@@ -143,11 +135,89 @@ namespace NX.ERP.U8.Store
throw err; throw err;
} }
}
public string UpdateVocher(Model.Request.PuStoreIn puStoreIn)
{
try
{
// var voucherParameter = BuildVocher(puStoreIn, "M");
var voucherParameter = this.LoadVoucher($"cCode='{puStoreIn.Code}'");
//添加一條
DOMDocument domBody = voucherParameter.DomBody;
if (puStoreIn.Source == "采购到货单")
{
var Arrival = new Purchase.ArrivalDAL().GetModel(puStoreIn.SourceCode);
if (Arrival == null)
{
throw new Exception("未知采购到货单,或到货单已经入库完成");
}
IXMLDOMElement bodyXml;
for (var n = 0; n < puStoreIn.Details.Count; n++)
{
var detail = puStoreIn.Details[n];
var arrivalDetail = Arrival.ArrivalDtlLst.First(m => { return m.ArrivalDtlId == detail.SorceDetailId; });
// headXml.setAttribute("ipurorderid", arrivalDetail.PoId);
bodyXml = domBody.createElement("z:row");
if (arrivalDetail.cunitid != 0) //需要做辅助计量单位
{
var _inum = detail.Quantity / arrivalDetail.inspecexchrate;
//bodyXml.setAttribute("innum", arrivalDetail.inum);
bodyXml.setAttribute("inum", _inum);
bodyXml.setAttribute("cinva_unit", arrivalDetail.cinva_unit);
bodyXml.setAttribute("cassunit", arrivalDetail.cunitid);
}
else
{
bodyXml.setAttribute("innum", 0);
}
bodyXml.setAttribute("cinvcode", detail.Invcode);
bodyXml.setAttribute("iquantity", detail.Quantity);
bodyXml.setAttribute("irowno", domBody.childNodes.length + n + 1);
bodyXml.setAttribute("cbvencode", "10001");
bodyXml.setAttribute("inquantity", detail.Quantity); //应收数量,double类型
bodyXml.setAttribute("cbatch", detail.Batch);
bodyXml.setAttribute("cposition", detail.Position);
bodyXml.setAttribute("cbarvcode", Arrival.ArrivalNo);
bodyXml.setAttribute("ipurarriveid", Arrival.ArrivalId);
bodyXml.setAttribute("iarrsid", detail.SorceDetailId);
bodyXml.setAttribute("darvdate", DateTime.Today.ToShortDateString());
bodyXml.setAttribute("editprop", "A");
bodyXml.setAttribute("cpoid", arrivalDetail.OrderCode);
bodyXml.setAttribute("iposid", arrivalDetail.posId);
bodyXml.setAttribute("itaxrate", Arrival.TaxRate);
var info = new Account.Accinformation();
FormatHelp.GetUnitPriceByCost(detail.Quantity, arrivalDetail.oricost, Arrival.TaxRate, Arrival.ExchRate, out double iprice2, out double itaxprice2, out double isum2);
bodyXml.setAttribute("iunitcost", arrivalDetail.cost);
bodyXml.setAttribute("iprice", iprice2);
bodyXml.setAttribute("facost", arrivalDetail.cost);
bodyXml.setAttribute("iaprice", iprice2);
bodyXml.setAttribute("itaxprice", itaxprice2);
bodyXml.setAttribute("isum", isum2);
FormatHelp.GetOriPriceByCost(detail.Quantity, arrivalDetail.oricost, Arrival.TaxRate, out double iorimoney2, out double ioritaxprice2, out double iorisum2, out double iunitcost2);
bodyXml.setAttribute("ioricost", arrivalDetail.oricost);
bodyXml.setAttribute("ioritaxcost", arrivalDetail.oritaxcost);
bodyXml.setAttribute("iorimoney", iorimoney2);
bodyXml.setAttribute("ioritaxprice", ioritaxprice2);
bodyXml.setAttribute("iorisum", iorisum2);
domBody.selectSingleNode("//rs:data").appendChild(bodyXml);
}
} }
return UpdateRdVoucher(voucherParameter);
}
catch (Exception err)
{
throw err;
}
}
} }
} }

View File

@@ -66,6 +66,17 @@ namespace NX.ERP.U8.Store
} }
} }
protected string UpdateUrl
{
get
{
return $"{BaseUrl}/Update";
}
}
protected string VoucherID protected string VoucherID
{ {
get get
@@ -189,9 +200,111 @@ namespace NX.ERP.U8.Store
} }
protected string UpdateRdVoucher(VoucherParameter para)
{
string VoucherId;
try
{
U8EnvContext u8EnvContext = new U8EnvContext();
u8EnvContext.U8Login = U8LoginContext.Instance.ClsLogin;
U8ApiAddress apiAddress = new U8ApiAddress(this.UpdateUrl);
U8ApiBroker u8ApiBroker = new U8ApiBroker(apiAddress, u8EnvContext);
u8ApiBroker.AssignNormalValue("sVouchType", para.VoucherType);
u8ApiBroker.AssignNormalValue("DomHead", para.DomHead);
u8ApiBroker.AssignNormalValue("domBody", para.DomBody);
if (para.DomPosition != null && para.DomPosition.selectNodes("//z:row").length != 0)
{
u8ApiBroker.AssignNormalValue("domPosition", para.DomPosition);
}
u8ApiBroker.AssignNormalValue("cnnFrom", null);
if (para.DOMMsg != null)
{
u8ApiBroker.AssignNormalValue("domMsg", para.DOMMsg);
}
else
{
u8ApiBroker.AssignNormalValue("domMsg", new DOMDocumentClass());
}
u8ApiBroker.AssignNormalValue("bCheck", para.IsCheck);
u8ApiBroker.AssignNormalValue("bBeforCheckStock", para.IsBeforCheckStock);
u8ApiBroker.AssignNormalValue("bIsRedVouch", para.IsRedVouch);
u8ApiBroker.AssignNormalValue("sAddedState", para.AddedState);
u8ApiBroker.AssignNormalValue("bUpdateNeedEas", true);
// u8ApiBroker.AssignNormalValue("bReMote", para.IsReMote);
if (!u8ApiBroker.Invoke())
{
Exception exception = u8ApiBroker.GetException();
if (exception != null)
{
if (exception is MomSysException)
{
MomSysException ex = exception as MomSysException;
}
else if (exception is MomBizException)
{
MomBizException ex2 = exception as MomBizException;
}
string exceptionString = u8ApiBroker.GetExceptionString();
if (exceptionString.Length != 0)
{
}
}
para.ReturnValue = false;
u8ApiBroker.Release();
}
para.ReturnValue = Convert.ToBoolean(u8ApiBroker.GetReturnValue());
para.DOMMsg = u8ApiBroker.GetResult("domMsg") as DOMDocument;
para.ErrMsg = u8ApiBroker.GetResult("errMsg") as string;
if (para.ReturnValue)
{
}
else
{
throw new Exception(para.ErrMsg);
}
u8ApiBroker.Release();
return "";
}
catch (Exception ex3)
{
throw ex3;
}
finally
{
}
}
protected string AddRdVoucher(VoucherParameter para) protected string AddRdVoucher(VoucherParameter para)
{ {
string VoucherId; string VoucherId;
try try
{ {
U8EnvContext u8EnvContext = new U8EnvContext(); U8EnvContext u8EnvContext = new U8EnvContext();
@@ -219,7 +332,8 @@ namespace NX.ERP.U8.Store
u8ApiBroker.AssignNormalValue("bBeforCheckStock", para.IsBeforCheckStock); u8ApiBroker.AssignNormalValue("bBeforCheckStock", para.IsBeforCheckStock);
u8ApiBroker.AssignNormalValue("bIsRedVouch", para.IsRedVouch); u8ApiBroker.AssignNormalValue("bIsRedVouch", para.IsRedVouch);
u8ApiBroker.AssignNormalValue("sAddedState", para.AddedState); u8ApiBroker.AssignNormalValue("sAddedState", para.AddedState);
u8ApiBroker.AssignNormalValue("bReMote", para.IsReMote);
// u8ApiBroker.AssignNormalValue("bReMote", para.IsReMote);
if (!u8ApiBroker.Invoke()) if (!u8ApiBroker.Invoke())
{ {
Exception exception = u8ApiBroker.GetException(); Exception exception = u8ApiBroker.GetException();
@@ -276,6 +390,25 @@ namespace NX.ERP.U8.Store
protected VoucherParameter LoadVoucher(string where)
{
var rdVoucherParameter = new VoucherParameter
{
VoucherType = this.VoucherID,
IsGetBlank = false,
StrWhere = where
};
this.LoadRdVoucher(rdVoucherParameter);
return rdVoucherParameter;
}
private void LoadTemplate() private void LoadTemplate()
{ {
VoucherParameter rdVoucherParameter = null; VoucherParameter rdVoucherParameter = null;

View File

@@ -9,7 +9,7 @@ namespace NX.ERP.WebAPi.Controllers.Store
public class PuStoreInController : ApiController public class PuStoreInController : ApiController
{ {
[Obsolete]
[Route("api/PuStoreIn/Add")] [Route("api/PuStoreIn/Add")]
[HttpPost] [HttpPost]
public object AddVoucher([FromBody] Model.Request.PuStoreIn storeIn) public object AddVoucher([FromBody] Model.Request.PuStoreIn storeIn)
@@ -17,5 +17,14 @@ namespace NX.ERP.WebAPi.Controllers.Store
var dal = new NX.ERP.U8.Store.PuStoreInDAL(); var dal = new NX.ERP.U8.Store.PuStoreInDAL();
return new { Id = dal.AddVocher(storeIn) }; return new { Id = dal.AddVocher(storeIn) };
} }
[Route("api/PuStoreIn/Update")]
[HttpPost]
public object UpdateVoucher([FromBody] Model.Request.PuStoreIn storeIn)
{
var dal = new NX.ERP.U8.Store.PuStoreInDAL();
return new { Id = dal.UpdateVocher(storeIn) };
}
} }
} }

View File

@@ -7,7 +7,7 @@
<appSettings> <appSettings>
<add key="server" value="10.0.0.12"/> <add key="server" value="10.0.0.12"/>
<add key="AccId" value="u8-2@001"/> <add key="AccId" value="u8-2@001"/>
<add key="UserId" value="wxapi"/> <add key="UserId" value="wx997"/>
<add key="Password" value="1"/> <add key="Password" value="1"/>
<add key="EaiPort" value="80"/> <add key="EaiPort" value="80"/>
<add key="EaiPath" value="U8EAI/import.asp" /> <add key="EaiPath" value="U8EAI/import.asp" />