Programmer:Member

From AutoCount Resource Center
Jump to navigation Jump to search

Technical Specification

  1. Customer's account book must enable Bonus Point module.
  2. To learn how AutoCount Bonus Point works, click Bonus Point

Columns Specification

Columns Table
Column Name Data Type Size Mandatory Remark
MemberNo string 20 Yes
MemberType string 20 Yes Value must be maintained at Bonus Point > Member Type Maintenance
ID string 20 No Can be used for member identification
Name string 100 No Name of the membership
Address1 string 40 No
Address2 string 40 No
Address3 string 40 No
Address4 string 40 No
AreaCode string 12 No Value is maintained at General Maintenance > Area Maintenance
Individual string 1 Yes Though is a bool type, applicable value is "T" or "F"
Default: "T"
Race string 10 No Value is maintained at Bonus Point > Race Maintenance
DOB DateTime No
DebtorCode string 12 No Value is maintained at A/R > Debtor Maintenance
Company Name string 100 No
Department string 30 No
Title string 40 No
MobilePhone string 25 No
EmailAddress string 80 No
OpeningPoints decimal 19,2 Yes Total carry forward points that has no transaction
Default:0
Gender string 1 No null, "M" or "F"
RegisterDate DateTime No
ExpiryDate DateTime No
IsActive string 1 Yes Though is a bool type, applicable value is "T" or "F"
Default: "T"

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

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);
}

LoadBrowseTable() method returns a table of members.

public DataTable LoadMemberData(BCE.Data.DBSetting dbSetting)
{
    BCE.AutoCount.GeneralMaint.MemberMaintenance.MemberCommand cmd =
        BCE.AutoCount.GeneralMaint.MemberMaintenance.MemberCommand.Create(dbSetting);
    return cmd.LoadBrowseTable();
}
Click Reporting - Member List and Point Balance for more member data loading.



Member Lookup Builder

BCE.AutoCount.XtraUtils.LookupEditBuilder.MemberLookupEditBuilder

Build Member Lookup Table (Data)

BCE.AutoCount.XtraUtils.LookupEditBuilder.MemberLookupEditBuilder memberBuilder = new BCE.AutoCount.XtraUtils.LookupEditBuilder.MemberLookupEditBuilder();
DataTable memberTable = memberBuilder.BuildDataTable(dbSetting);

Build Member LookupEdit (UI)

BCE.AutoCount.XtraUtils.LookupEditBuilder.MemberLookupEditBuilder memberBuilder = new BCE.AutoCount.XtraUtils.LookupEditBuilder.MemberLookupEditBuilder();
DevExpress.XtraEditors.LookUpEdit lueMember = new DevExpress.XtraEditors.LookUpEdit();
memberBuilder.BuildLookupEdit(lueMember.Properties, dbSetting);


API Usage

New

public void NewMember(BCE.Data.DBSetting dbSetting)
{
    BCE.AutoCount.GeneralMaint.MemberMaintenance.MemberCommand cmd =
        BCE.AutoCount.GeneralMaint.MemberMaintenance.MemberCommand.Create(dbSetting);
    BCE.AutoCount.GeneralMaint.MemberMaintenance.MemberEntity member = cmd.NewMember(false);

    //member.MemberNo = "M000001";
    //Assign auto running number
    member.MemberNo = cmd.GetNextMemberNo();

    member.Name = "THOMAS PETER 1";
    member.ID = "881122-11-1111";

    member.MemberType = "Default";
    member.Address1 = "91, Jalan Nanas,";
    member.Address2 = "Taman Gembira,";
    member.Address3 = "50000 Petaling Jaya,";
    member.Address4 = "Malaysia.";
    //member.DebtorCode = "300-A001";
    member.IsActive = "T";

    try
    {
        cmd.SaveMember(member);
        //Log success
        BCE.Application.AppMessage.ShowMessage(
            string.Format("New member '{0}' is created.", member.Name));
    }
    catch (BCE.Application.AppException ex)
    {
        //Log error
        BCE.Application.AppMessage.ShowMessage(
            string.Format("Fail to create new member.\n{0}", ex.Message));
    }
}

Edit/Update

public void EditMember(BCE.Data.DBSetting dbSetting)
{
    string memberNo = "M000001";
    BCE.AutoCount.GeneralMaint.MemberMaintenance.MemberCommand cmd =
        BCE.AutoCount.GeneralMaint.MemberMaintenance.MemberCommand.Create(dbSetting);
    BCE.AutoCount.GeneralMaint.MemberMaintenance.MemberEntity member = cmd.GetMember(memberNo);

    if (member == null)
        return;

    member.Name = "THOMAS PETER 1";
    member.ID = "881122-11-1234";

    member.MemberType = "Default";
    member.Address1 = "91, Jalan Nanas,";
    member.Address2 = "Taman Gembira,";
    member.Address3 = "50000 Petaling Jaya,";
    member.Address4 = "Malaysia.";
    member.DebtorCode = "300-A001";

    try
    {
        cmd.SaveMember(member);
        //Log success
        BCE.Application.AppMessage.ShowMessage(
            string.Format("Member '{0}' is updated.", member.Name));
    }
    catch (BCE.Application.AppException ex)
    {
        //Log error
        BCE.Application.AppMessage.ShowMessage(
            string.Format("Fail to edit member.\n{0}", ex.Message));
    }
}

Delete

public void DeleteMember(BCE.Data.DBSetting dbSetting)
{
    string memberNo = "M000001";
    BCE.AutoCount.GeneralMaint.MemberMaintenance.MemberCommand cmd =
        BCE.AutoCount.GeneralMaint.MemberMaintenance.MemberCommand.Create(dbSetting);

    try
    {
        cmd.DeleteMember(memberNo);
        //Log success
        BCE.Application.AppMessage.ShowMessage(
            string.Format("Member '{0}' is deleted.", memberNo));
    }
    catch (BCE.Application.AppException ex)
    {
        //Log error
        BCE.Application.AppMessage.ShowMessage(
            string.Format("Fail to delete member '{0}'.\n{1}", memberNo, ex.Message));
    }
}


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