Programmer:Member List and Point Balance v2

From AutoCount Resource Center
Revision as of 08:20, 10 August 2018 by DanielY (talk | contribs) (Created page with "==Assemblies version 2.0== {{BaseReferenceAC20}} '''AutoCount.GeneralMaint.dll''' '''AutoCount.Invoicing.dll''' '''AutoCount.Invoicing.Sales.dll''' ==Load Member data== Re...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Assemblies version 2.0

AutoCount.Accounting.dll
AutoCount.Accounting.UI.dll
AutoCount.dll
AutoCount.MainEntry.dll
AutoCount.UI.dll
AutoCount.GeneralMaint.dll
AutoCount.Invoicing.dll
AutoCount.Invoicing.Sales.dll

Load Member data

Retrieve single record of a member

public AutoCount.GeneralMaint.MemberMaintenance.MemberEntity LoadAMemberData(string memberNo, AutoCount.Authentication.UserSession userSession)
{
    AutoCount.GeneralMaint.MemberMaintenance.MemberCommand cmd =
        AutoCount.GeneralMaint.MemberMaintenance.MemberCommand.Create(userSession, userSession.DBSetting);
    return cmd.GetMember(memberNo);
}

Load all members data in a table

public DataTable LoadMemberData(AutoCount.Authentication.UserSession userSession)
{
    AutoCount.GeneralMaint.MemberMaintenance.MemberCommand cmd =
        AutoCount.GeneralMaint.MemberMaintenance.MemberCommand.Create(userSession, userSession.DBSetting);
    return cmd.LoadBrowseTable();
}


Load Member Transaction Listing by Date Range with Member Point

public DataSet LoadAllMemberListingByDateWithPoint(DateTime fromDate, DateTime toDate, AutoCount.Authentication.UserSession userSession)
{
    AutoCount.Invoicing.Sales.BonusPointTransListing.BonusPointTransactionListing report
        = AutoCount.Invoicing.Sales.BonusPointTransListing.BonusPointTransactionListing.Create(userSession);

    //5 filters are required by report.Inquire
    AutoCount.SearchFilter.Filter filterMember = new AutoCount.SearchFilter.Filter("B", "MemberNo");
    AutoCount.SearchFilter.Filter filterMemberType = new AutoCount.SearchFilter.Filter("B", "MemberType");
    AutoCount.SearchFilter.Filter filterAgent = new AutoCount.SearchFilter.Filter("C", "SalesAgent");
    AutoCount.SearchFilter.Filter filterArea = new AutoCount.SearchFilter.Filter("B", "AreaCode");
    AutoCount.SearchFilter.Filter filterDebtor = new AutoCount.SearchFilter.Filter("B", "DebtorCode");

    //the value true indicates whether to load member whom point balance is zero;
    //set to true to load zero balance;
    report.Inquire(fromDate, toDate,
        filterMember, filterMemberType, filterAgent, filterArea, filterDebtor,
        true);
    DataSet ds = report.DsBonusPointTransactionListing;

    return ds;
}
  • Contains 2 Tables in the DataSet
    1. Master
      Table of member listing and transactions with earning points by date range.
    2. BalanceBF
      List of members and Balance Point until the toDate.


Load All Member and Member Point Balance

public DataTable LoadAllMemberBalancePoint(AutoCount.Authentication.UserSession userSession)
{
    AutoCount.Invoicing.Sales.BonusPointTransListing.BonusPointTransactionListing report =
        AutoCount.Invoicing.Sales.BonusPointTransListing.BonusPointTransactionListing.Create(userSession);
    AutoCount.SearchFilter.Filter filterMember = new AutoCount.SearchFilter.Filter("B", "MemberNo");
    AutoCount.SearchFilter.Filter filterMemberType = new AutoCount.SearchFilter.Filter("B", "MemberType");
    AutoCount.SearchFilter.Filter filterAgent = new AutoCount.SearchFilter.Filter("C", "SalesAgent");
    AutoCount.SearchFilter.Filter filterArea = new AutoCount.SearchFilter.Filter("B", "AreaCode");
    AutoCount.SearchFilter.Filter filterDebtor = new AutoCount.SearchFilter.Filter("B", "DebtorCode");

    //Set the from and to date to future, so the BF Balance is actual member total balance 
    report.Inquire(new DateTime(9900, 12, 31), new DateTime(9900, 12, 31),
        filterMember, filterMemberType, filterAgent, filterArea, filterDebtor, true);

    return report.DsBonusPointTransactionListing.Tables["BalanceBF"];
}

Prog MemberBFBal.png
Columns in return table of LoadAllMemberBalancePoint


Load selected Member(s) (filter member) and Member Point Balance

public DataTable LoadMemberBalPointByMultiSelectMember(List<string> memberNoList, AutoCount.Authentication.UserSession userSession)
{
    AutoCount.Invoicing.Sales.BonusPointTransListing.BonusPointTransactionListing report =
        AutoCount.Invoicing.Sales.BonusPointTransListing.BonusPointTransactionListing.Create(userSession);
    AutoCount.SearchFilter.Filter filterMember = new AutoCount.SearchFilter.Filter("B", "MemberNo");
    AutoCount.SearchFilter.Filter filterMemberType = new AutoCount.SearchFilter.Filter("B", "MemberType");
    AutoCount.SearchFilter.Filter filterAgent = new AutoCount.SearchFilter.Filter("C", "SalesAgent");
    AutoCount.SearchFilter.Filter filterArea = new AutoCount.SearchFilter.Filter("B", "AreaCode");
    AutoCount.SearchFilter.Filter filterDebtor = new AutoCount.SearchFilter.Filter("B", "DebtorCode");

    //Filter Member by multi-select
    filterMember.Type = AutoCount.SearchFilter.FilterType.ByIndividual;
    memberNoList.ForEach(s => filterMember.Add(s));

    //Set the from and to date to future, so the BF Balance is actual member total balance 
    report.Inquire(new DateTime(9900, 12, 31), new DateTime(9900, 12, 31),
        filterMember, filterMemberType, filterAgent, filterArea, filterDebtor, true);

    return report.DsBonusPointTransactionListing.Tables["BalanceBF"];
}
  • To call the method of LoadMemberBalPointByMultiSelectMember
string[] selectedMembers = { "M-0001", "M-0003" };
LoadMemberBalPointByMultiSelectMember(selectedMembers.ToList(), myUserSession);


Load a range of MemberType (filter MemberType) and Member Point Balance

public DataTable LoadMemberBalPointByRangeSelectMemberType(string fromMemberType, string toMemberType, AutoCount.Authentication.UserSession userSession)
{
    AutoCount.Invoicing.Sales.BonusPointTransListing.BonusPointTransactionListing report =
        AutoCount.Invoicing.Sales.BonusPointTransListing.BonusPointTransactionListing.Create(userSession);
    AutoCount.SearchFilter.Filter filterMember = new AutoCount.SearchFilter.Filter("B", "MemberNo");
    AutoCount.SearchFilter.Filter filterMemberType = new AutoCount.SearchFilter.Filter("B", "MemberType");
    AutoCount.SearchFilter.Filter filterAgent = new AutoCount.SearchFilter.Filter("C", "SalesAgent");
    AutoCount.SearchFilter.Filter filterArea = new AutoCount.SearchFilter.Filter("B", "AreaCode");
    AutoCount.SearchFilter.Filter filterDebtor = new AutoCount.SearchFilter.Filter("B", "DebtorCode");

    //Filter MemberType by range
    filterMemberType.Type = AutoCount.SearchFilter.FilterType.ByRange;
    filterMemberType.From = fromMemberType;
    filterMemberType.To = toMemberType;

    //Set the from and to date to future, so the BF Balance is actual member total balance 
    report.Inquire(new DateTime(9900, 12, 31), new DateTime(9900, 12, 31),
        filterMember, filterMemberType, filterAgent, filterArea, filterDebtor, true);

    return report.DsBonusPointTransactionListing.Tables["BalanceBF"];
}


See Also

Maintenance (Master Data)

Transactions

Reporting

  • Member List and Point Balance - [1.8, 1.9] [2.0]

    Go to menu

    IconAC81.png Go to top
    ProgrammerGo.jpg Resources For AutoCount Software Developers