Programmer:Member Type

From AutoCount Resource Center

Technical Specification

  1. Customer's account book must enable Bonus Point module.

Columns Specification

Columns Table
Column Name Data Type Size Mandatory Remark
MemberType string 20 Yes
Description string 20 No
Level short Yes Applicable to AutoCount POS Promotion.
Default: 1

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

API Usage

New

public void NewMemberType(BCE.Data.DBSetting dbSetting)
{
    BCE.AutoCount.GeneralMaint.MemberTypeMaintenance.MemberTypeCommand cmd =
        BCE.AutoCount.GeneralMaint.MemberTypeMaintenance.MemberTypeCommand.Create(dbSetting);
    BCE.AutoCount.GeneralMaint.MemberTypeMaintenance.MemberTypeEntity rec =
        cmd.NewMemberType();

    rec.MemberType = "GOLD";
    rec.Description = "Gold Member";
    rec.Level = 1;

    try
    {
        cmd.SaveMemberType(rec);
        //Log success created
    }
    catch (BCE.Application.AppException ex)
    {
        //Log error
        BCE.Application.AppMessage.ShowMessage(
            string.Format("Fail to create member type.\n{0}", ex.Message));
    }
}

Edit/Update

public void UpdateMemberType(BCE.Data.DBSetting dbSetting)
{
    string memberType = "GOLD";
    BCE.AutoCount.GeneralMaint.MemberTypeMaintenance.MemberTypeCommand cmd =
        BCE.AutoCount.GeneralMaint.MemberTypeMaintenance.MemberTypeCommand.Create(dbSetting);
    BCE.AutoCount.GeneralMaint.MemberTypeMaintenance.MemberTypeEntity rec =
        cmd.GetMemberType(memberType);

    if (rec == null)
        return;

    rec.Description = "Gold Member";
    rec.Level = 2;

    try
    {
        cmd.SaveMemberType(rec);
        //Log success updated
    }
    catch (BCE.Application.AppException ex)
    {
        //Log error
        BCE.Application.AppMessage.ShowMessage(
            string.Format("Fail to update member type.\n{0}", ex.Message));
    }
}

Delete

public void DeleteMemberType(BCE.Data.DBSetting dbSetting)
{
    string memberType = "GOLD";
    BCE.AutoCount.GeneralMaint.MemberTypeMaintenance.MemberTypeCommand cmd =
        BCE.AutoCount.GeneralMaint.MemberTypeMaintenance.MemberTypeCommand.Create(dbSetting);

    try
    {
        //cmd.DeleteRace(memberType);
        cmd.DeleteMemberType(memberType);
        //Log success
    }
    catch (BCE.Application.AppException ex)
    {
        //Log error
        BCE.Application.AppMessage.ShowMessage(
            string.Format("Fail to Delete member type.\n{0}", ex.Message));
    }
}


See Also

Maintenance (Master Data)

Transactions

Reporting

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

    Go to menu

    Go to top
    Resources For AutoCount Software Developers