public String expandBody(MssCFGenContext genContext) {
    final String S_ProcName = "CFAccMssCFBindVendorUnitTenantId.expandBody() ";

    if (genContext == null) {
      throw CFLib.getDefaultExceptionFactory()
          .newNullArgumentException(getClass(), "expandBody", 1, "genContext");
    }

    ICFLibAnyObj genDef = genContext.getGenDef();
    if (genDef == null) {
      throw CFLib.getDefaultExceptionFactory()
          .newNullArgumentException(getClass(), "expandBody", 1, "genContext.getGenDef()");
    }

    String ret;

    if (genDef instanceof ICFAccVendorUnitObj) {
      long tenantId = ((ICFAccVendorUnitObj) genDef).getRequiredTenantId();
      ret = Long.toString(tenantId);
    } else {
      throw CFLib.getDefaultExceptionFactory()
          .newUnsupportedClassException(
              getClass(), "expandBody", "genContext.getGenDef()", genDef, "ICFAccVendorUnitObj");
    }

    return (ret);
  }
 public CFSecurityCursor openFeeDetailCursorByFeeIdx(
     CFSecurityAuthorization Authorization, long TenantId, long FeeId) {
   String sql =
       getSqlSelectFeeDetailBuff()
           + "WHERE "
           + "fedt.tenantid = "
           + Long.toString(TenantId)
           + " "
           + "AND "
           + "fedt.feeid = "
           + Long.toString(FeeId)
           + " "
           + "ORDER BY "
           + "fedt.TenantId ASC"
           + ", "
           + "fedt.FeeDetailId ASC";
   CFAccCursor cursor = new CFAccSybaseCursor(Authorization, schema, sql);
   return (cursor);
 }
 public CFSecurityCursor openMemoDataCursorByMemoDataCtcIdx(
     CFSecurityAuthorization Authorization, long TenantId, long ContactId) {
   String sql =
       getSqlSelectMemoDataBuff()
           + " WHERE "
           + "mmod.tenantid = "
           + Long.toString(TenantId)
           + " "
           + "AND "
           + "mmod.contactid = "
           + Long.toString(ContactId)
           + " "
           + "ORDER BY "
           + "mmod.TenantId ASC"
           + ", "
           + "mmod.MemoId ASC";
   CFCrmCursor cursor = new CFCrmMSSqlCursor(Authorization, schema, sql);
   return (cursor);
 }
 public CFSecurityCursor openTSecGroupCursorByTenantIdx(
     CFSecurityAuthorization Authorization, long TenantId) {
   String sql =
       getSqlSelectTSecGroupBuff()
           + "WHERE "
           + "tgrp.tenantid = "
           + Long.toString(TenantId)
           + " "
           + "ORDER BY "
           + "tgrp.TenantId ASC"
           + ", "
           + "tgrp.TSecGroupId ASC";
   CFCrmCursor cursor = new CFCrmSybaseCursor(Authorization, schema, sql);
   return (cursor);
 }
 public CFSecurityCursor openTSecGroupCursorByTenantVisIdx(
     CFSecurityAuthorization Authorization, long TenantId, boolean IsVisible) {
   String sql =
       getSqlSelectTSecGroupBuff()
           + "WHERE "
           + "tgrp.tenantid = "
           + Long.toString(TenantId)
           + " "
           + "AND "
           + (IsVisible ? "tgrp.isvisible = 'Y' " : "tgrp.isvisible = 'N' ")
           + "ORDER BY "
           + "tgrp.TenantId ASC"
           + ", "
           + "tgrp.TSecGroupId ASC";
   CFCrmCursor cursor = new CFCrmSybaseCursor(Authorization, schema, sql);
   return (cursor);
 }
 public CFSecurityCursor openContactListCursorByTenantIdx(
     CFSecurityAuthorization Authorization, long TenantId) {
   String sql =
       getSqlSelectContactListBuff()
           + "WHERE "
           + "ctl.TenantId = "
           + Long.toString(TenantId)
           + " "
           + ((schema.isSystemUser(Authorization))
               ? ""
               : (" AND ctl.TenantId = " + Authorization.getSecTenantId()))
           + "ORDER BY "
           + "ctl.TenantId ASC"
           + ", "
           + "ctl.ContactListId ASC";
   CFCrmCursor cursor = new CFCrmPgSqlCursor(Authorization, schema, sql);
   return (cursor);
 }