Programmer:Sales Agent v2

From AutoCount Resource Center
Revision as of 07:38, 18 March 2024 by DanielY (talk | contribs) (Created page with " ==Technical Specification== # Default SalesAgent size = 12 # Not allow to delete Sales Agent when it is referred in document and transaction. ==References of AutoCount Accounting version 2.0== {{BaseReferenceAC20}} '''AutoCount.GeneralMaint.dll''' ==Sales Agent API== ===New=== <syntaxhighlight lang="csharp"> public void NewAgent(string agentCode, string agentName) { AutoCount.GeneralMaint.SalesAgent.SalesAgentCommand cmd = AutoCount.GeneralMaint.Sales...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Technical Specification

  1. Default SalesAgent size = 12
  2. Not allow to delete Sales Agent when it is referred in document and transaction.

References of AutoCount Accounting version 2.0

AutoCount.Accounting.dll
AutoCount.Accounting.UI.dll
AutoCount.dll
AutoCount.MainEntry.dll
AutoCount.UI.dll
AutoCount.GeneralMaint.dll

Sales Agent API

New

public void NewAgent(string agentCode, string agentName)
{
    AutoCount.GeneralMaint.SalesAgent.SalesAgentCommand cmd =
            AutoCount.GeneralMaint.SalesAgent.SalesAgentCommand.Create(myUserSession, myUserSession.DBSetting);
    AutoCount.GeneralMaint.SalesAgent.SalesAgentEntity agent = cmd.NewSalesAgent();

    agent.SalesAgent = agentCode;
    agent.Description = agentName;
    agent.EmailAddress = "<Assign agent email>";
    agent.Save();
}

Edit

public void UpdateAgent(string agentCode)
{
    AutoCount.GeneralMaint.SalesAgent.SalesAgentCommand cmd =
            AutoCount.GeneralMaint.SalesAgent.SalesAgentCommand.Create(myUserSession, myUserSession.DBSetting);
    AutoCount.GeneralMaint.SalesAgent.SalesAgentEntity agent = cmd.GetSalesAgent(agentCode);

    if (agentCode == null)
    {
        agent = cmd.NewSalesAgent();
        agent.SalesAgent = agentCode;
    }

    agent.Description = "<Assign agent name>";
    agent.EmailAddress = "<Assign agent email>";
    agent.Save();
}


See Also

Go to menu

Go to top
Resources For AutoCount Software Developers