Programmer:Sales Agent v2

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