【修改】提交代码
This commit is contained in:
parent
ef94da9435
commit
64c2c2f1db
@ -126,6 +126,12 @@
|
|||||||
<Compile Include="..\..\shared file\modConstant.vb">
|
<Compile Include="..\..\shared file\modConstant.vb">
|
||||||
<Link>modConstant.vb</Link>
|
<Link>modConstant.vb</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="frmDemo21706.Designer.vb">
|
||||||
|
<DependentUpon>frmDemo21706.vb</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="frmDemo21706.vb">
|
||||||
|
<SubType>Form</SubType>
|
||||||
|
</Compile>
|
||||||
<Compile Include="frmSubcontractor.vb">
|
<Compile Include="frmSubcontractor.vb">
|
||||||
<SubType>Form</SubType>
|
<SubType>Form</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@ -152,6 +158,9 @@
|
|||||||
</Compile>
|
</Compile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<EmbeddedResource Include="frmDemo21706.resx">
|
||||||
|
<DependentUpon>frmDemo21706.vb</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
<EmbeddedResource Include="frmSubcontractor.resx">
|
<EmbeddedResource Include="frmSubcontractor.resx">
|
||||||
<DependentUpon>frmSubcontractor.vb</DependentUpon>
|
<DependentUpon>frmSubcontractor.vb</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
@ -218,6 +218,143 @@ namespace wsSXS
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[WebMethod(Description = "Add Subcontractor data(Custom)")]
|
||||||
|
public string AddSubcontractorCustom(string InXml)
|
||||||
|
{
|
||||||
|
string AddSubcontractorRet = default(string);
|
||||||
|
|
||||||
|
// 此 Function 为用作练习之自定义 Function
|
||||||
|
// 先給預設值,以判斷是否有傳入該參數
|
||||||
|
var SubcontractorNo = default(string);
|
||||||
|
string SubcontractorName;
|
||||||
|
string Description = defString;
|
||||||
|
string Creator = defString;
|
||||||
|
|
||||||
|
// 以下为自定义字段
|
||||||
|
string NotNull;
|
||||||
|
string Note21706 = defString;
|
||||||
|
|
||||||
|
ArriveTime = DateTime.Now;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 讀取InXml字串
|
||||||
|
xmlDoc.LoadXml(InXml);
|
||||||
|
|
||||||
|
// 組Identity字串
|
||||||
|
strIdentity = CombineXMLIdentity(Environment.MachineName, GetXMLCurUserNo(xmlDoc), Conversions.ToString(ArriveTime));
|
||||||
|
|
||||||
|
// 開始解譯InXml字串
|
||||||
|
// Subcontractor一定要傳入
|
||||||
|
if (xmlDoc.DocumentElement.GetElementsByTagName("subcontractorno").Count > 0)
|
||||||
|
{
|
||||||
|
if (xmlDoc.GetElementsByTagName("subcontractorno").Item(0).SelectNodes("value").Count > 0)
|
||||||
|
{
|
||||||
|
SubcontractorNo = xmlDoc.DocumentElement.GetElementsByTagName("subcontractorno").Item(0).SelectNodes("value").Item(0).InnerText;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new iMESException.MESException("0000-200002", "SubcontractorNo Not Found!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new iMESException.MESException("0000-200002", "SubcontractorNo Not Found!");
|
||||||
|
}
|
||||||
|
if (xmlDoc.DocumentElement.GetElementsByTagName("subcontractorname").Count > 0)
|
||||||
|
{
|
||||||
|
if (xmlDoc.GetElementsByTagName("subcontractorname").Item(0).SelectNodes("value").Count > 0)
|
||||||
|
{
|
||||||
|
SubcontractorName = xmlDoc.DocumentElement.GetElementsByTagName("subcontractorname").Item(0).SelectNodes("value").Item(0).InnerText;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new iMESException.MESException("0000-200002", "SubcontractorName Not Found!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new iMESException.MESException("0000-200002", "SubcontractorName Not Found!");
|
||||||
|
}
|
||||||
|
// 自定义的非空字段 NotNull 一定要傳入
|
||||||
|
if (xmlDoc.DocumentElement.GetElementsByTagName("notnull").Count > 0)
|
||||||
|
{
|
||||||
|
if (xmlDoc.GetElementsByTagName("notnull").Item(0).SelectNodes("value").Count > 0)
|
||||||
|
{
|
||||||
|
NotNull = xmlDoc.DocumentElement.GetElementsByTagName("notnull").Item(0).SelectNodes("value").Item(0).InnerText;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new iMESException.MESException("0000-200002", "NotNull Not Found!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new iMESException.MESException("0000-200002", "NotNull Not Found!");
|
||||||
|
}
|
||||||
|
// Description
|
||||||
|
if (xmlDoc.DocumentElement.GetElementsByTagName("description").Count > 0)
|
||||||
|
{
|
||||||
|
if (xmlDoc.GetElementsByTagName("description").Item(0).SelectNodes("value").Count > 0)
|
||||||
|
{
|
||||||
|
Description = xmlDoc.DocumentElement.GetElementsByTagName("description").Item(0).SelectNodes("value").Item(0).InnerText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Creator
|
||||||
|
if (xmlDoc.DocumentElement.GetElementsByTagName("creator").Count > 0)
|
||||||
|
{
|
||||||
|
if (xmlDoc.GetElementsByTagName("creator").Item(0).SelectNodes("value").Count > 0)
|
||||||
|
{
|
||||||
|
Creator = xmlDoc.DocumentElement.GetElementsByTagName("creator").Item(0).SelectNodes("value").Item(0).InnerText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Note21706
|
||||||
|
if (xmlDoc.DocumentElement.GetElementsByTagName("note21706").Count > 0)
|
||||||
|
{
|
||||||
|
if (xmlDoc.GetElementsByTagName("note21706").Item(0).SelectNodes("value").Count > 0)
|
||||||
|
{
|
||||||
|
Note21706 = xmlDoc.DocumentElement.GetElementsByTagName("note21706").Item(0).SelectNodes("value").Item(0).InnerText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 呼叫Dll執行新增資料
|
||||||
|
objENT.AddSubcontractorCustom(SubcontractorNo, SubcontractorName, NotNull, Description, Creator, defDateTime, Note21706);
|
||||||
|
|
||||||
|
strException = "";
|
||||||
|
strResult = "success";
|
||||||
|
|
||||||
|
objSYS.AddEventLog("wsENT", GetXMLCurUserNo(xmlDoc), "SubcontractorNo", SubcontractorNo, DateTime.Now, "AddSubcontractor");
|
||||||
|
}
|
||||||
|
|
||||||
|
catch (iMESException.MESException ex)
|
||||||
|
{
|
||||||
|
strException = CombineXMLException(Conversions.ToString(ex.ErrorCode), TranslateMsg(ex.Message, GetXMLLanguageMode(xmlDoc), strResourceDir), "Add Subcontractor failed!", ex.StackTrace);
|
||||||
|
|
||||||
|
strResult = "fail";
|
||||||
|
|
||||||
|
objSYS.AddErrorLog_ErrorCode("wsENT", GetXMLCurUserNo(xmlDoc), "SubcontractorNo", SubcontractorNo, DateTime.Now, strException, ComputerName: GetXMLCurComputer(xmlDoc), ErrorCode: Conversions.ToString(ex.ErrorCode));
|
||||||
|
}
|
||||||
|
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
strException = CombineXMLException(defWSErrCode, ex.Message, "Add Subcontractor failed!", ex.StackTrace);
|
||||||
|
|
||||||
|
strResult = "fail";
|
||||||
|
|
||||||
|
objSYS.AddErrorLog_ErrorCode("wsENT", GetXMLCurUserNo(xmlDoc), "SubcontractorNo", SubcontractorNo, DateTime.Now, strException, ComputerName: GetXMLCurComputer(xmlDoc), ErrorCode: defWSErrCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
// 將各部份之XML字串組起來並傳出
|
||||||
|
AddSubcontractorRet = CombineXMLResponse(strIdentity, "", strException, strResult, "");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return AddSubcontractorRet;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
[WebMethod(Description = "Edit Specified Subcontractor Data")]
|
[WebMethod(Description = "Edit Specified Subcontractor Data")]
|
||||||
public string EditSubcontractor(string InXml)
|
public string EditSubcontractor(string InXml)
|
||||||
{
|
{
|
||||||
@ -345,6 +482,158 @@ namespace wsSXS
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[WebMethod(Description = "Edit Specified Subcontractor Data(Custom)")]
|
||||||
|
public string EditSubcontractorCustom(string InXml)
|
||||||
|
{
|
||||||
|
string EditSubcontractorRet = default(string);
|
||||||
|
|
||||||
|
// 此 Function 为用作练习之自定义 Function
|
||||||
|
// 參數先給預設值,以判斷是否有傳入該參數
|
||||||
|
var SubcontractorNo = default(string);
|
||||||
|
int IssueState = defInteger;
|
||||||
|
string SubcontractorName = defString;
|
||||||
|
string Description = defString;
|
||||||
|
|
||||||
|
int DataStamp = defInteger;
|
||||||
|
string AdditionalXml = "";
|
||||||
|
|
||||||
|
// 以下为自定义字段
|
||||||
|
string NotNull = defString;
|
||||||
|
string Note21706 = defString;
|
||||||
|
|
||||||
|
ArriveTime = DateTime.Now;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 讀取InXml字串
|
||||||
|
xmlDoc.LoadXml(InXml);
|
||||||
|
// 組Identity字串
|
||||||
|
strIdentity = CombineXMLIdentity(Environment.MachineName, GetXMLCurUserNo(xmlDoc), Conversions.ToString(ArriveTime));
|
||||||
|
|
||||||
|
// 開始解譯InXml字串
|
||||||
|
// Subcontractor一定要傳入
|
||||||
|
if (xmlDoc.DocumentElement.GetElementsByTagName("subcontractorno").Count > 0)
|
||||||
|
{
|
||||||
|
if (xmlDoc.GetElementsByTagName("subcontractorno").Item(0).SelectNodes("value").Count > 0)
|
||||||
|
{
|
||||||
|
SubcontractorNo = xmlDoc.DocumentElement.GetElementsByTagName("subcontractorno").Item(0).SelectNodes("value").Item(0).InnerText;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new iMESException.MESException("0000-200002", "SubcontractorNo Not Found!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new iMESException.MESException("0000-200002", "SubcontractorNo Not Found!");
|
||||||
|
}
|
||||||
|
// IssueState一定要傳入
|
||||||
|
if (xmlDoc.DocumentElement.GetElementsByTagName("issuestate").Count > 0)
|
||||||
|
{
|
||||||
|
if (xmlDoc.GetElementsByTagName("issuestate").Item(0).SelectNodes("value").Count > 0)
|
||||||
|
{
|
||||||
|
IssueState = Conversions.ToInteger(xmlDoc.DocumentElement.GetElementsByTagName("issuestate").Item(0).SelectNodes("value").Item(0).InnerText);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new iMESException.MESException("0000-200002", "[%IssueState%]");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new iMESException.MESException("0000-200002", "[%IssueState%]");
|
||||||
|
}
|
||||||
|
// SubcontractorName不可空白
|
||||||
|
if (xmlDoc.DocumentElement.GetElementsByTagName("subcontractorname").Count > 0)
|
||||||
|
{
|
||||||
|
if (xmlDoc.GetElementsByTagName("subcontractorname").Item(0).SelectNodes("value").Count > 0)
|
||||||
|
{
|
||||||
|
SubcontractorName = xmlDoc.DocumentElement.GetElementsByTagName("subcontractorname").Item(0).SelectNodes("value").Item(0).InnerText;
|
||||||
|
if (string.IsNullOrEmpty(SubcontractorName))
|
||||||
|
{
|
||||||
|
throw new iMESException.MESException("0000-200001", "SubcontractorName is empty!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// NotNull不可空白
|
||||||
|
if (xmlDoc.DocumentElement.GetElementsByTagName("notnull").Count > 0)
|
||||||
|
{
|
||||||
|
if (xmlDoc.GetElementsByTagName("notnull").Item(0).SelectNodes("value").Count > 0)
|
||||||
|
{
|
||||||
|
NotNull = xmlDoc.DocumentElement.GetElementsByTagName("notnull").Item(0).SelectNodes("value").Item(0).InnerText;
|
||||||
|
if (string.IsNullOrEmpty(SubcontractorName))
|
||||||
|
{
|
||||||
|
throw new iMESException.MESException("0000-200001", "NotNull is empty!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Description
|
||||||
|
if (xmlDoc.DocumentElement.GetElementsByTagName("description").Count > 0)
|
||||||
|
{
|
||||||
|
if (xmlDoc.GetElementsByTagName("description").Item(0).SelectNodes("value").Count > 0)
|
||||||
|
{
|
||||||
|
Description = xmlDoc.DocumentElement.GetElementsByTagName("description").Item(0).SelectNodes("value").Item(0).InnerText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Note21706
|
||||||
|
if (xmlDoc.DocumentElement.GetElementsByTagName("Note21706").Count > 0)
|
||||||
|
{
|
||||||
|
if (xmlDoc.GetElementsByTagName("Note21706").Item(0).SelectNodes("value").Count > 0)
|
||||||
|
{
|
||||||
|
Note21706 = xmlDoc.DocumentElement.GetElementsByTagName("Note21706").Item(0).SelectNodes("value").Item(0).InnerText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// AdditionalXml
|
||||||
|
GetXMLTagValue(ref AdditionalXml, xmlDoc, "additionalxml");
|
||||||
|
|
||||||
|
// DataStamp
|
||||||
|
GetXMLTagValue(ref DataStamp, xmlDoc, "datastamp", true);
|
||||||
|
|
||||||
|
if (IssueState == 0) // Unfrozen時才可修改
|
||||||
|
{
|
||||||
|
// 有修改欄位值時
|
||||||
|
if ((SubcontractorName ?? "") != defString | (Description ?? "") != defString)
|
||||||
|
{
|
||||||
|
// 呼叫Dll執行修改
|
||||||
|
objENT.EditSubcontractorCustom(SubcontractorNo, SubcontractorName, NotNull, Description, AdditionalXml, DataStamp: DataStamp, Reviser: GetXMLCurUserNo(xmlDoc), ReviseDate: ArriveTime, Note21706);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
strException = "";
|
||||||
|
strResult = "success";
|
||||||
|
|
||||||
|
objSYS.AddEventLog("wsENT", GetXMLCurUserNo(xmlDoc), "SubcontractorNo", SubcontractorNo, DateTime.Now, "EditSubcontractor");
|
||||||
|
}
|
||||||
|
|
||||||
|
catch (iMESException.MESException ex)
|
||||||
|
{
|
||||||
|
strException = CombineXMLException(Conversions.ToString(ex.ErrorCode), TranslateMsg(ex.Message, GetXMLLanguageMode(xmlDoc), strResourceDir), "Edit Subcontractor failed!", ex.StackTrace);
|
||||||
|
|
||||||
|
strResult = "fail";
|
||||||
|
|
||||||
|
objSYS.AddErrorLog_ErrorCode("wsENT", GetXMLCurUserNo(xmlDoc), "SubcontractorNo", SubcontractorNo, DateTime.Now, strException, ComputerName: GetXMLCurComputer(xmlDoc), ErrorCode: Conversions.ToString(ex.ErrorCode));
|
||||||
|
}
|
||||||
|
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
strException = CombineXMLException(defWSErrCode, ex.Message, "Edit Subcontractor failed!", ex.StackTrace);
|
||||||
|
|
||||||
|
strResult = "fail";
|
||||||
|
|
||||||
|
objSYS.AddErrorLog_ErrorCode("wsENT", GetXMLCurUserNo(xmlDoc), "SubcontractorNo", SubcontractorNo, DateTime.Now, strException, ComputerName: GetXMLCurComputer(xmlDoc), ErrorCode: defWSErrCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
// 將各部份之XML字串組起來並傳出
|
||||||
|
EditSubcontractorRet = CombineXMLResponse(strIdentity, "", strException, strResult, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
return EditSubcontractorRet;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
[WebMethod(Description = "Delete Subcontractor By Specified Subcontractor")]
|
[WebMethod(Description = "Delete Subcontractor By Specified Subcontractor")]
|
||||||
public string DelSubcontractor(string InXml)
|
public string DelSubcontractor(string InXml)
|
||||||
{
|
{
|
||||||
@ -840,6 +1129,167 @@ namespace wsSXS
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[WebMethod(Description = "Add Subcontractor Contactor data(Custom)")]
|
||||||
|
public string AddSubcontractorContCustom(string InXml)
|
||||||
|
{
|
||||||
|
string AddSubcontractorContRet = default(string);
|
||||||
|
|
||||||
|
// 此 Function 为用作练习之自定义 Function
|
||||||
|
// 先給預設值,以判斷是否有傳入該參數
|
||||||
|
var SubcontractorNo = default(string);
|
||||||
|
var ContactorName = default(string);
|
||||||
|
string TelNo = defString;
|
||||||
|
string FaxNo = defString;
|
||||||
|
string Title = defString;
|
||||||
|
string Address = defString;
|
||||||
|
string EMail = defString;
|
||||||
|
string Description = defString;
|
||||||
|
string AdditionalXml = "";
|
||||||
|
|
||||||
|
// 以下为自定义字段
|
||||||
|
string Note21706 = defString;
|
||||||
|
|
||||||
|
ArriveTime = DateTime.Now;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 讀取InXml字串
|
||||||
|
xmlDoc.LoadXml(InXml);
|
||||||
|
|
||||||
|
// 組Identity字串
|
||||||
|
strIdentity = CombineXMLIdentity(Environment.MachineName, GetXMLCurUserNo(xmlDoc), Conversions.ToString(ArriveTime));
|
||||||
|
|
||||||
|
// 開始解譯InXml字串
|
||||||
|
// SubcontractorNo一定要傳入
|
||||||
|
if (xmlDoc.DocumentElement.GetElementsByTagName("subcontractorno").Count > 0)
|
||||||
|
{
|
||||||
|
if (xmlDoc.GetElementsByTagName("subcontractorno").Item(0).SelectNodes("value").Count > 0)
|
||||||
|
{
|
||||||
|
SubcontractorNo = xmlDoc.DocumentElement.GetElementsByTagName("subcontractorno").Item(0).SelectNodes("value").Item(0).InnerText;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new iMESException.MESException("0000-200002", "SubcontractorNo Not Found!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new iMESException.MESException("0000-200002", "SubcontractorNo Not Found!");
|
||||||
|
}
|
||||||
|
// ContactorName一定要傳入
|
||||||
|
if (xmlDoc.DocumentElement.GetElementsByTagName("contactorname").Count > 0)
|
||||||
|
{
|
||||||
|
if (xmlDoc.GetElementsByTagName("contactorname").Item(0).SelectNodes("value").Count > 0)
|
||||||
|
{
|
||||||
|
ContactorName = xmlDoc.DocumentElement.GetElementsByTagName("contactorname").Item(0).SelectNodes("value").Item(0).InnerText;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new iMESException.MESException("0000-200002", "ContactorName Not Found!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new iMESException.MESException("0000-200002", "ContactorName Not Found!");
|
||||||
|
}
|
||||||
|
// TelNo
|
||||||
|
if (xmlDoc.DocumentElement.GetElementsByTagName("telno").Count > 0)
|
||||||
|
{
|
||||||
|
if (xmlDoc.GetElementsByTagName("telno").Item(0).SelectNodes("value").Count > 0)
|
||||||
|
{
|
||||||
|
TelNo = xmlDoc.DocumentElement.GetElementsByTagName("telno").Item(0).SelectNodes("value").Item(0).InnerText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// FaxNo
|
||||||
|
if (xmlDoc.DocumentElement.GetElementsByTagName("faxno").Count > 0)
|
||||||
|
{
|
||||||
|
if (xmlDoc.GetElementsByTagName("faxno").Item(0).SelectNodes("value").Count > 0)
|
||||||
|
{
|
||||||
|
FaxNo = xmlDoc.DocumentElement.GetElementsByTagName("faxno").Item(0).SelectNodes("value").Item(0).InnerText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Title
|
||||||
|
if (xmlDoc.DocumentElement.GetElementsByTagName("title").Count > 0)
|
||||||
|
{
|
||||||
|
if (xmlDoc.GetElementsByTagName("title").Item(0).SelectNodes("value").Count > 0)
|
||||||
|
{
|
||||||
|
Title = xmlDoc.DocumentElement.GetElementsByTagName("title").Item(0).SelectNodes("value").Item(0).InnerText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Address
|
||||||
|
if (xmlDoc.DocumentElement.GetElementsByTagName("address").Count > 0)
|
||||||
|
{
|
||||||
|
if (xmlDoc.GetElementsByTagName("address").Item(0).SelectNodes("value").Count > 0)
|
||||||
|
{
|
||||||
|
Address = xmlDoc.DocumentElement.GetElementsByTagName("address").Item(0).SelectNodes("value").Item(0).InnerText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// EMail
|
||||||
|
if (xmlDoc.DocumentElement.GetElementsByTagName("email").Count > 0)
|
||||||
|
{
|
||||||
|
if (xmlDoc.GetElementsByTagName("email").Item(0).SelectNodes("value").Count > 0)
|
||||||
|
{
|
||||||
|
EMail = xmlDoc.DocumentElement.GetElementsByTagName("email").Item(0).SelectNodes("value").Item(0).InnerText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Description
|
||||||
|
if (xmlDoc.DocumentElement.GetElementsByTagName("description").Count > 0)
|
||||||
|
{
|
||||||
|
if (xmlDoc.GetElementsByTagName("description").Item(0).SelectNodes("value").Count > 0)
|
||||||
|
{
|
||||||
|
Description = xmlDoc.DocumentElement.GetElementsByTagName("description").Item(0).SelectNodes("value").Item(0).InnerText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Note21706
|
||||||
|
if (xmlDoc.DocumentElement.GetElementsByTagName("note21706").Count > 0)
|
||||||
|
{
|
||||||
|
if (xmlDoc.GetElementsByTagName("note21706").Item(0).SelectNodes("value").Count > 0)
|
||||||
|
{
|
||||||
|
Note21706 = xmlDoc.DocumentElement.GetElementsByTagName("note21706").Item(0).SelectNodes("value").Item(0).InnerText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// AdditionalXml
|
||||||
|
GetXMLTagValue(ref AdditionalXml, xmlDoc, "additionalxml");
|
||||||
|
|
||||||
|
|
||||||
|
// 呼叫Dll執行新增資料
|
||||||
|
objENT.AddSubcontractorContCustom(SubcontractorNo, ContactorName, TelNo, FaxNo, Title, Address, EMail, Description, AdditionalXml, GetXMLCurUserNo(xmlDoc), ArriveTime, Note21706);
|
||||||
|
|
||||||
|
strException = "";
|
||||||
|
strResult = "success";
|
||||||
|
|
||||||
|
objSYS.AddEventLog("wsENT", GetXMLCurUserNo(xmlDoc), "SubcontractorNo", SubcontractorNo, DateTime.Now, "AddSubcontractorContactor ContactorName:" + ContactorName);
|
||||||
|
}
|
||||||
|
|
||||||
|
catch (iMESException.MESException ex)
|
||||||
|
{
|
||||||
|
strException = CombineXMLException(Conversions.ToString(ex.ErrorCode), TranslateMsg(ex.Message, GetXMLLanguageMode(xmlDoc), strResourceDir), "Add SubcontractorContactor Data failed, ContactorName:" + ContactorName, ex.StackTrace);
|
||||||
|
|
||||||
|
strResult = "fail";
|
||||||
|
|
||||||
|
objSYS.AddErrorLog_ErrorCode("wsENT", GetXMLCurUserNo(xmlDoc), "SubcontractorNo", SubcontractorNo, DateTime.Now, strException, ComputerName: GetXMLCurComputer(xmlDoc), ErrorCode: Conversions.ToString(ex.ErrorCode));
|
||||||
|
}
|
||||||
|
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
strException = CombineXMLException(defWSErrCode, ex.Message, "Add SubcontractorContactor Data failed, ContactorName:" + ContactorName, ex.StackTrace);
|
||||||
|
|
||||||
|
strResult = "fail";
|
||||||
|
|
||||||
|
objSYS.AddErrorLog_ErrorCode("wsENT", GetXMLCurUserNo(xmlDoc), "SubcontractorNo", SubcontractorNo, DateTime.Now, strException, ComputerName: GetXMLCurComputer(xmlDoc), ErrorCode: defWSErrCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
// 將各部份之XML字串組起來並傳出
|
||||||
|
AddSubcontractorContRet = CombineXMLResponse(strIdentity, "", strException, strResult, "");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return AddSubcontractorContRet;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
[WebMethod(Description = "Edit Specified Subcontractor Contactor Data")]
|
[WebMethod(Description = "Edit Specified Subcontractor Contactor Data")]
|
||||||
public string EditSubcontractorCont(string InXml)
|
public string EditSubcontractorCont(string InXml)
|
||||||
{
|
{
|
||||||
@ -998,6 +1448,177 @@ namespace wsSXS
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[WebMethod(Description = "Edit Specified Subcontractor Contactor Data(Custom)")]
|
||||||
|
public string EditSubcontractorContCustom(string InXml)
|
||||||
|
{
|
||||||
|
string EditSubcontractorContRet = default(string);
|
||||||
|
|
||||||
|
// 此 Function 为用作练习之自定义 Function
|
||||||
|
// 先給預設值,以判斷是否有傳入該參數
|
||||||
|
var SubcontractorNo = default(string);
|
||||||
|
var ContactorName = default(string);
|
||||||
|
string TelNo = defString;
|
||||||
|
string FaxNo = defString;
|
||||||
|
string Title = defString;
|
||||||
|
string Address = defString;
|
||||||
|
string EMail = defString;
|
||||||
|
string Description = defString;
|
||||||
|
|
||||||
|
int DataStamp = defInteger;
|
||||||
|
string AdditionalXml = "";
|
||||||
|
|
||||||
|
// 以下为自定义字段
|
||||||
|
string Note21706 = defString;
|
||||||
|
|
||||||
|
ArriveTime = DateTime.Now;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
// 讀取InXml字串
|
||||||
|
xmlDoc.LoadXml(InXml);
|
||||||
|
// 組Identity字串
|
||||||
|
strIdentity = CombineXMLIdentity(Environment.MachineName, GetXMLCurUserNo(xmlDoc), Conversions.ToString(ArriveTime));
|
||||||
|
|
||||||
|
// 開始解譯InXml字串
|
||||||
|
// SubcontractorNo一定要傳入
|
||||||
|
if (xmlDoc.DocumentElement.GetElementsByTagName("subcontractorno").Count > 0)
|
||||||
|
{
|
||||||
|
if (xmlDoc.GetElementsByTagName("subcontractorno").Item(0).SelectNodes("value").Count > 0)
|
||||||
|
{
|
||||||
|
SubcontractorNo = xmlDoc.DocumentElement.GetElementsByTagName("subcontractorno").Item(0).SelectNodes("value").Item(0).InnerText;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new iMESException.MESException("0000-200002", "SubcontractorNo Not Found!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new iMESException.MESException("0000-200002", "SubcontractorNo Not Found!");
|
||||||
|
}
|
||||||
|
// ContactorName一定要傳入
|
||||||
|
if (xmlDoc.DocumentElement.GetElementsByTagName("contactorname").Count > 0)
|
||||||
|
{
|
||||||
|
if (xmlDoc.GetElementsByTagName("contactorname").Item(0).SelectNodes("value").Count > 0)
|
||||||
|
{
|
||||||
|
ContactorName = xmlDoc.DocumentElement.GetElementsByTagName("contactorname").Item(0).SelectNodes("value").Item(0).InnerText;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new iMESException.MESException("0000-200002", "ContactorName Not Found!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new iMESException.MESException("0000-200002", "ContactorName Not Found!");
|
||||||
|
}
|
||||||
|
// TelNo
|
||||||
|
if (xmlDoc.DocumentElement.GetElementsByTagName("telno").Count > 0)
|
||||||
|
{
|
||||||
|
if (xmlDoc.GetElementsByTagName("telno").Item(0).SelectNodes("value").Count > 0)
|
||||||
|
{
|
||||||
|
TelNo = xmlDoc.DocumentElement.GetElementsByTagName("telno").Item(0).SelectNodes("value").Item(0).InnerText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// FaxNo
|
||||||
|
if (xmlDoc.DocumentElement.GetElementsByTagName("faxno").Count > 0)
|
||||||
|
{
|
||||||
|
if (xmlDoc.GetElementsByTagName("faxno").Item(0).SelectNodes("value").Count > 0)
|
||||||
|
{
|
||||||
|
FaxNo = xmlDoc.DocumentElement.GetElementsByTagName("faxno").Item(0).SelectNodes("value").Item(0).InnerText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Title
|
||||||
|
if (xmlDoc.DocumentElement.GetElementsByTagName("title").Count > 0)
|
||||||
|
{
|
||||||
|
if (xmlDoc.GetElementsByTagName("title").Item(0).SelectNodes("value").Count > 0)
|
||||||
|
{
|
||||||
|
Title = xmlDoc.DocumentElement.GetElementsByTagName("title").Item(0).SelectNodes("value").Item(0).InnerText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Address
|
||||||
|
if (xmlDoc.DocumentElement.GetElementsByTagName("address").Count > 0)
|
||||||
|
{
|
||||||
|
if (xmlDoc.GetElementsByTagName("address").Item(0).SelectNodes("value").Count > 0)
|
||||||
|
{
|
||||||
|
Address = xmlDoc.DocumentElement.GetElementsByTagName("address").Item(0).SelectNodes("value").Item(0).InnerText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// EMail
|
||||||
|
if (xmlDoc.DocumentElement.GetElementsByTagName("email").Count > 0)
|
||||||
|
{
|
||||||
|
if (xmlDoc.GetElementsByTagName("email").Item(0).SelectNodes("value").Count > 0)
|
||||||
|
{
|
||||||
|
EMail = xmlDoc.DocumentElement.GetElementsByTagName("email").Item(0).SelectNodes("value").Item(0).InnerText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Description
|
||||||
|
if (xmlDoc.DocumentElement.GetElementsByTagName("description").Count > 0)
|
||||||
|
{
|
||||||
|
if (xmlDoc.GetElementsByTagName("description").Item(0).SelectNodes("value").Count > 0)
|
||||||
|
{
|
||||||
|
Description = xmlDoc.DocumentElement.GetElementsByTagName("description").Item(0).SelectNodes("value").Item(0).InnerText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Note21706
|
||||||
|
if (xmlDoc.DocumentElement.GetElementsByTagName("note21706").Count > 0)
|
||||||
|
{
|
||||||
|
if (xmlDoc.GetElementsByTagName("note21706").Item(0).SelectNodes("value").Count > 0)
|
||||||
|
{
|
||||||
|
Note21706 = xmlDoc.DocumentElement.GetElementsByTagName("note21706").Item(0).SelectNodes("value").Item(0).InnerText;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// AdditionalXml
|
||||||
|
GetXMLTagValue(ref AdditionalXml, xmlDoc, "additionalxml");
|
||||||
|
|
||||||
|
// DataStamp
|
||||||
|
GetXMLTagValue(ref DataStamp, xmlDoc, "datastamp", true);
|
||||||
|
|
||||||
|
// If IssueState = 0 Then 'Unfrozen時才可修改
|
||||||
|
// 有修改欄位值時
|
||||||
|
if ((TelNo ?? "") != defString | (FaxNo ?? "") != defString | (Title ?? "") != defString | (Address ?? "") != defString | (EMail ?? "") != defString | (Description ?? "") != defString)
|
||||||
|
{
|
||||||
|
// 呼叫Dll執行修改
|
||||||
|
objENT.EditSubcontractorContCustom(SubcontractorNo, ContactorName, TelNo, FaxNo, Title, Address, EMail, Description, AdditionalXml, DataStamp: DataStamp, Reviser: GetXMLCurUserNo(xmlDoc), ReviseDate: ArriveTime, Note21706);
|
||||||
|
}
|
||||||
|
// End If
|
||||||
|
|
||||||
|
strException = "";
|
||||||
|
strResult = "success";
|
||||||
|
|
||||||
|
objSYS.AddEventLog("wsENT", GetXMLCurUserNo(xmlDoc), "SubcontractorNo", SubcontractorNo, DateTime.Now, "EditSubcontractorContactor ContactorName:" + ContactorName);
|
||||||
|
}
|
||||||
|
|
||||||
|
catch (iMESException.MESException ex)
|
||||||
|
{
|
||||||
|
strException = CombineXMLException(Conversions.ToString(ex.ErrorCode), TranslateMsg(ex.Message, GetXMLLanguageMode(xmlDoc), strResourceDir), "Edit SubcontractorContactor Data failed, ContactorName:" + ContactorName, ex.StackTrace);
|
||||||
|
|
||||||
|
strResult = "fail";
|
||||||
|
|
||||||
|
objSYS.AddErrorLog_ErrorCode("wsENT", GetXMLCurUserNo(xmlDoc), "SubcontractorNo", SubcontractorNo, DateTime.Now, strException, ComputerName: GetXMLCurComputer(xmlDoc), ErrorCode: Conversions.ToString(ex.ErrorCode));
|
||||||
|
}
|
||||||
|
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
strException = CombineXMLException(defWSErrCode, ex.Message, "Edit SubcontractorContactor Data failed, ContactorName:" + ContactorName, ex.StackTrace);
|
||||||
|
|
||||||
|
strResult = "fail";
|
||||||
|
|
||||||
|
objSYS.AddErrorLog_ErrorCode("wsENT", GetXMLCurUserNo(xmlDoc), "SubcontractorNo", SubcontractorNo, DateTime.Now, strException, ComputerName: GetXMLCurComputer(xmlDoc), ErrorCode: defWSErrCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
// 將各部份之XML字串組起來並傳出
|
||||||
|
EditSubcontractorContRet = CombineXMLResponse(strIdentity, "", strException, strResult, "");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return EditSubcontractorContRet;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
[WebMethod(Description = "Delete Subcontractor Contactor By Specified SubcontractorNo and ContactorName")]
|
[WebMethod(Description = "Delete Subcontractor Contactor By Specified SubcontractorNo and ContactorName")]
|
||||||
public string DelSubcontractorCont(string InXml)
|
public string DelSubcontractorCont(string InXml)
|
||||||
{
|
{
|
||||||
@ -1079,5 +1700,6 @@ namespace wsSXS
|
|||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user