Stock Transfer API V2: Difference between revisions

m
no edit summary
(Created page with "==Technical Specification== ==References of AutoCount Accounting version 2.0== {{BaseReferenceAC20}} '''AutoCount.Stock.dll''' '''AutoCount.Manufacturing.dll''' ==API Usa...")
 
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 24:
 
//Set to auto populate the item information from Item Maintenance
//such as Item Description
doc.EnableAutoLoadItemDetail = true;
 
Line 73 ⟶ 74:
 
//Set to auto populate the item information from Item Maintenance
//such as Item Description
doc.EnableAutoLoadItemDetail = true;
 
Line 99 ⟶ 101:
</syntaxhighlight>
 
===Cancel===
<syntaxhighlight lang="csharp">
public void Cancel(AutoCount.Authentication.UserSession userSession)
{
string docNo = "XFER-00001";
AutoCount.Stock.StockTransfer.StockTransferCommand cmd =
AutoCount.Stock.StockTransfer.StockTransferCommand.Create(userSession, userSession.DBSetting);
 
try
{
cmd.CancelDocument(docNo);
//log success
AutoCount.AppMessage.ShowMessage($"Stock Transfer '{docNo}' is cancelled.");
}
catch (AutoCount.AppException ex)
{
//log error
AutoCount.AppMessage.ShowMessage($"Fail to cancel Stock Transfer '{docNo}'.\n" + ex.Message);
}
}
</syntaxhighlight>
 
===Uncancel===
<syntaxhighlight lang="csharp">
public void UnCancel(AutoCount.Authentication.UserSession userSession)
{
string docNo = "XFER-00001";
AutoCount.Stock.StockTransfer.StockTransferCommand cmd =
AutoCount.Stock.StockTransfer.StockTransferCommand.Create(userSession, userSession.DBSetting);
 
try
{
cmd.UncancelDocument(docNo);
//log success
AutoCount.AppMessage.ShowMessage($"Stock Transfer '{docNo}' is uncancelled.");
}
catch (AutoCount.AppException ex)
{
//log error
AutoCount.AppMessage.ShowMessage($"Fail to uncancel Stock Transfer '{docNo}'.\n" + ex.Message);
}
}
</syntaxhighlight>
 
===Delete===
<syntaxhighlight lang="csharp">
public void Delete(AutoCount.Authentication.UserSession userSession)
{
string docNo = "XFER-00001";
AutoCount.Stock.StockTransfer.StockTransferCommand cmd =
AutoCount.Stock.StockTransfer.StockTransferCommand.Create(userSession, userSession.DBSetting);
 
try
{
cmd.Delete(docNo);
//log success
AutoCount.AppMessage.ShowMessage($"Stock Transfer '{docNo}' is deleted.");
}
catch (AutoCount.AppException ex)
{
//log error
AutoCount.AppMessage.ShowMessage($"Fail to delete Stock Transfer '{docNo}'.\n" + ex.Message);
}
}
</syntaxhighlight>
 
<br/>