Programmer:Member Race

From AutoCount Resource Center
Jump to navigation Jump to search

Columns Specification

Columns Table
Column Name Data Type Size Mandatory Remark
Race string 10 Yes
Description string 80 No

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 Race Data

public DataTable LoadRaceData(BCE.Data.DBSetting dbSetting)
{
    BCE.AutoCount.GeneralMaint.RaceMaintenance.RaceCommand cmd =
        BCE.AutoCount.GeneralMaint.RaceMaintenance.RaceCommand.Create(dbSetting);
    return cmd.LoadBrowseTable();
}

Check existence

public bool CheckRace(string race, BCE.Data.DBSetting dbSetting)
{
    BCE.AutoCount.GeneralMaint.RaceMaintenance.RaceCommand cmd =
        BCE.AutoCount.GeneralMaint.RaceMaintenance.RaceCommand.Create(dbSetting);
    return cmd.GetRace(race) != null;
}

API Usage

New

public void NewRace(BCE.Data.DBSetting dbSetting)
{
    BCE.AutoCount.GeneralMaint.RaceMaintenance.RaceCommand cmd =
        BCE.AutoCount.GeneralMaint.RaceMaintenance.RaceCommand.Create(dbSetting);
    BCE.AutoCount.GeneralMaint.RaceMaintenance.RaceEntity rec = cmd.NewRace();

    rec.Race = "JAP";
    rec.Description = "Japanese";

    try
    {
        cmd.SaveRace(rec);
        //Log success
        BCE.Application.AppMessage.ShowMessage(
            string.Format("{0} created in race.", rec.Race));
    }
    catch (BCE.Application.AppException ex)
    {
        //Log error
        BCE.Application.AppMessage.ShowMessage(ex.Message);
    }
}

Edit/Update

public void EditRace(BCE.Data.DBSetting dbSetting)
{
    string race = "JAP";
    BCE.AutoCount.GeneralMaint.RaceMaintenance.RaceCommand cmd =
        BCE.AutoCount.GeneralMaint.RaceMaintenance.RaceCommand.Create(dbSetting);
    BCE.AutoCount.GeneralMaint.RaceMaintenance.RaceEntity rec = cmd.GetRace(race);

    if (race == null)
        return;

    rec.Description = "JAPANESE";

    try
    {
        cmd.SaveRace(rec);
        //Log success
        BCE.Application.AppMessage.ShowMessage(
            string.Format("{0} is updated.", rec.Race));
    }
    catch (BCE.Application.AppException ex)
    {
        //Log error
        BCE.Application.AppMessage.ShowMessage(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