Programmer:Member List and Point Balance

From AutoCount Resource Center
Jump to navigation Jump to search

Assemblies version 1.8, 1.9

BCE.AutoCount.dll
BCE.AutoCount.CommonAccounting.dll
BCE.AutoCount.MainEntry.dll
BCE.Utils.dll
BCE.Utils.UI.dll
BCE.AutoCount.GeneralMaint.dll
BCE.AutoCount.Invoicing.dll
BCE.AutoCount.Invoicing.Sales.dll

Load Member data

Retrieve single record of a member

public BCE.AutoCount.GeneralMaint.MemberMaintenance.MemberEntity LoadAMemberData(string memberNo, BCE.Data.DBSetting dbSetting)
{
    BCE.AutoCount.GeneralMaint.MemberMaintenance.MemberCommand cmd =
        BCE.AutoCount.GeneralMaint.MemberMaintenance.MemberCommand.Create(dbSetting);
    return cmd.GetMember(memberNo);
}

Load all members data in a table

public DataTable LoadMemberData(BCE.Data.DBSetting dbSetting)
{
    BCE.AutoCount.GeneralMaint.MemberMaintenance.MemberCommand cmd =
        BCE.AutoCount.GeneralMaint.MemberMaintenance.MemberCommand.Create(dbSetting);
    return cmd.LoadBrowseTable();
}


Load Member Transaction Listing by Date Range with Member Point

public DataSet LoadAllMemberListingByDateWithPoint(DateTime fromDate, DateTime toDate, BCE.Data.DBSetting dbSetting)
{
    BCE.AutoCount.Invoicing.Sales.BonusPointTransListing.BonusPointTransactionListing report
        = BCE.AutoCount.Invoicing.Sales.BonusPointTransListing.BonusPointTransactionListing.Create(dbSetting);

    //5 filters are required by report.Inquire
    BCE.AutoCount.SearchFilter.Filter filterMember = new BCE.AutoCount.SearchFilter.Filter("B", "MemberNo");
    BCE.AutoCount.SearchFilter.Filter filterMemberType = new BCE.AutoCount.SearchFilter.Filter("B", "MemberType");
    BCE.AutoCount.SearchFilter.Filter filterAgent = new BCE.AutoCount.SearchFilter.Filter("C", "SalesAgent");
    BCE.AutoCount.SearchFilter.Filter filterArea = new BCE.AutoCount.SearchFilter.Filter("B", "AreaCode");
    BCE.AutoCount.SearchFilter.Filter filterDebtor = new BCE.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.
Tips icons.png Prefix in the filter such as "B", "C" are fixed value and should not be changed.
It is table alias that is defined in SQL Command.


Load All Member and Member Point Balance

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

    //Set the from and to date to future, so the BalanceBF is actual member point 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, BCE.Data.DBSetting dbSetting)
{
    BCE.AutoCount.Invoicing.Sales.BonusPointTransListing.BonusPointTransactionListing report =
        BCE.AutoCount.Invoicing.Sales.BonusPointTransListing.BonusPointTransactionListing.Create(dbSetting);
    BCE.AutoCount.SearchFilter.Filter filterMember = new BCE.AutoCount.SearchFilter.Filter("B", "MemberNo");
    BCE.AutoCount.SearchFilter.Filter filterMemberType = new BCE.AutoCount.SearchFilter.Filter("B", "MemberType");
    BCE.AutoCount.SearchFilter.Filter filterAgent = new BCE.AutoCount.SearchFilter.Filter("C", "SalesAgent");
    BCE.AutoCount.SearchFilter.Filter filterArea = new BCE.AutoCount.SearchFilter.Filter("B", "AreaCode");
    BCE.AutoCount.SearchFilter.Filter filterDebtor = new BCE.AutoCount.SearchFilter.Filter("B", "DebtorCode");

    //Filter Member by multi-select
    filterMember.Type = BCE.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(), mydbset);


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

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

    //Filter MemberType by range
    filterMemberType.Type = BCE.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