diff --git a/ActiveRecordTest/steinickev4.xml b/ActiveRecordTest/steinickev4.xml new file mode 100644 index 0000000..99b4e51 --- /dev/null +++ b/ActiveRecordTest/steinickev4.xml @@ -0,0 +1,13260 @@ + + + + 2012.021 + + + 1 + 0 + 0 + 0 + 0 + + + + + 0 + 1547248127 + 0 + 0 + 0 + 0 + 16384 + 1 + 0 + + + + My Application + My Application + + 4194304 + 2097152 + 4096 + 2048 + + My Application.exe + 0 + + + + 0 + MyApplication + + 0 + 0 + 8080 + 0 + Launching... + + The application has gone off-line. Please try again later. + + + App + 0 + 1 + Application + 1 + 0 + 1 + + 373139383035373732 + + + + kFileQuitShortcut + + 1 + 134217984 + kFileQuitShortcut + 0 + + 0 + + 1 + 0 + Cmd+Q + + + 5 + 0 + Ctrl+Q + + + + kFileQuit + + 1 + 134217984 + kFileQuit + 0 + &Quit + 0 + + 2 + 0 + E&xit + + + + kEditClear + + 1 + 134217984 + kEditClear + 0 + &Delete + 0 + + 2 + 0 + &Delete + + + 5 + 0 + &Delete + + + + + Window1 + 0 + 1 + Window + 1 + 0 + + True + 719805772 + 30 + True + False + True + True + True + True + False + True + Untitled + + 3136373737323135 + False + False + 30 + 3332303030 + 3332303030 + 3634 + 3634 + 343030 + 363030 + 30 + + + Name + 1 + ID + Window + + + Interfaces + 1 + ID + Window + + + Super + 1 + ID + Window + + + Placement + 1 + Position + 0 + Integer + Enum + Window + + 0 - Default + 1 - Parent Window + 2 - Main Screen + 3 - Parent Window Screen + 4 - Stagger + + + + Width + 1 + Position + 600 + Integer + Window + + + Height + 1 + Position + 400 + Integer + Window + + + MinWidth + 1 + Position + 64 + Integer + Window + + + MinHeight + 1 + Position + 64 + Integer + Window + + + MaxWidth + 1 + Position + 32000 + Integer + Window + + + MaxHeight + 1 + Position + 32000 + Integer + Window + + + Frame + 1 + Appearance + 0 + Integer + Enum + Window + + 0 - Document + 1 - Movable Modal + 2 - Modal Dialog + 3 - Floating Window + 4 - Plain Box + 5 - Shadowed Box + 6 - Rounded Window + 7 - Global Floating Window + 8 - Sheet Window + 9 - Metal Window + 10 - Drawer Window + 11 - Modeless Dialog + + + + Composite + 1 + Appearance + False + Boolean + Window + + + HasBackColor + 1 + Appearance + False + Boolean + Window + + + BackColor + 1 + Appearance + &hFFFFFF + Color + Window + + + Backdrop + 1 + Appearance + Picture + Picture + Window + + + Title + 1 + Appearance + Untitled + String + Window + + + Visible + 1 + Appearance + True + Boolean + Window + + + FullScreen + 1 + Appearance + False + Boolean + Window + + + MenuBarVisible + 1 + Appearance + True + Boolean + Window + + + CloseButton + 1 + Appearance + True + Boolean + Window + + + Resizeable + 1 + Appearance + True + Boolean + Window + + + LiveResize + 1 + Appearance + True + Boolean + Window + + + MaximizeButton + 1 + Appearance + False + Boolean + Window + + + MinimizeButton + 1 + Appearance + True + Boolean + Window + + + MacProcID + 1 + Appearance + 0 + Integer + Window + + + MenuBar + 1 + Appearance + MenuBar + MenuBar + Window + + + ImplicitInstance + 1 + Appearance + True + Boolean + Window + + + + + MenuBar1 + 0 + + 0 + FileMenu + &File + -2147483648 + + 1 + 134217984 + 0 + MenuItem + + 0 + FileQuit + #App.kFileQuit + -2147483648 + #App.kFileQuitShortcut + #App.kFileQuitShortcut + 1 + 134217984 + 0 + QuitMenuItem + + + + 0 + EditMenu + &Edit + -2147483648 + + 1 + 134217984 + 0 + MenuItem + + 0 + EditUndo + &Undo + -2147483648 + Cmd+Z + Z + 1 + 1 + 134217984 + 0 + MenuItem + + + 0 + + - + -2147483648 + + 1 + 134217984 + 0 + MenuItem + + + 0 + EditCut + Cu&t + -2147483648 + Cmd+X + X + 1 + 1 + 134217984 + 0 + MenuItem + + + 0 + EditCopy + &Copy + -2147483648 + Cmd+C + C + 1 + 1 + 134217984 + 0 + MenuItem + + + 0 + EditPaste + &Paste + -2147483648 + Cmd+V + V + 1 + 1 + 134217984 + 0 + MenuItem + + + 0 + EditClear + #App.kEditClear + -2147483648 + + 1 + 134217984 + 0 + MenuItem + + + 0 + + - + -2147483648 + + 1 + 134217984 + 0 + MenuItem + + + 0 + EditSelectAll + Select &All + -2147483648 + Cmd+A + A + 1 + 1 + 134217984 + 0 + MenuItem + + + + + Build Automation + 0 + + + Linux + 1000243259 + + + Build + 586482103 + + + Mac OS X + 1000243259 + + + Build + 1601400869 + + + Windows + 1000243259 + + + Build + 795303613 + + + BKS_ActiveRecord + 0 + 0 + 1 + 0 + + + Begin + + 1 + + 134217984 + Function Begin() As BKS_ActiveRecord.Transaction + return Begin(GetTypeInfo(BKS_ActiveRecord.Base)) + End Function + + 134217984 + + 1 + 0 + + BKS_ActiveRecord.Transaction + + + Begin + + 1 + + 134217984 + Function Begin(ty as Introspection.TypeInfo) As BKS_ActiveRecord.Transaction + 'Start a transaction and return and object for it. + if ty=nil then + raise new NilObjectException + end if + + dim adp as BKS_ActiveRecord.DatabaseAdapter + adp = GetContext.ConnectionAdapter_Get( ty ) + if adp=nil then + raise new ActiveRecordException("No connection available for type: " + ty.FullName) + end if + + return new Transaction(adp) + End Function + + 134217984 + + 1 + 0 + ty as Introspection.TypeInfo + BKS_ActiveRecord.Transaction + + + Connect + + 1 + + 134217984 + Sub Connect(db as Database) + Connect(GetTypeInfo(BKS_ActiveRecord.Base), db) + End Sub + + 134217984 + + 1 + 0 + db as Database + + + + Connect + + 1 + + 134217984 + Sub Connect(ty as Introspection.TypeInfo, db as Database) + if ty=nil or db=nil then + raise new NilObjectException + end if + dim adp as BKS_ActiveRecord.DatabaseAdapter + adp = CreateDatabaseAdapter(db) + GetContext.ConnectionAdapter_Set(ty, adp) + End Sub + + 134217984 + + 1 + 0 + ty as Introspection.TypeInfo, db as Database + + + + CreateDatabaseAdapter + + 1 + + 134217984 + Function CreateDatabaseAdapter(db as Database) As BKS_ActiveRecord.DatabaseAdapter + #if BKS_ActiveRecordConfig.kIncludeREALSQLDatabase + if db isa REALSQLDatabase then + return new REALSQLDatabaseAdapter(db) + end if + #endif + + #if BKS_ActiveRecordConfig.kIncludeSQLiteDatabase and RBVersion>=2013 + if db isa SQLiteDatabase then + return new SQLiteDatabaseAdapter(db) + end if + #endif + + #if BKS_ActiveRecordConfig.kIncludeCubeDatabase + if db isa CubeSQLServer then + return new cubeSQLDatabaseAdapter(db) + end if + #endif + + #if BKS_ActiveRecordConfig.kIncludeMSSQLServer + if db isa MSSQLServerDatabase then + return new MSSQLServerAdapter(db) + end if + #endif + + #if BKS_ActiveRecordConfig.kIncludeMySQLCommunityServer + if db isa MySQLCommunityServer then + return new MySQLCommunityServerAdapter(db) + end if + #endif + + #if BKS_ActiveRecordConfig.kIncludeOracle + if db isa OracleDatabase then + return new OracleAdapter(db) + end if + #endif + + #if BKS_ActiveRecordConfig.kIncludePostgreSQLDatabase + if db isa PostgreSQLDatabase then + return new PostgreSQLDatabaseAdapter(db) + end if + #endif + + dim ex as new UnsupportedOperationException + ex.Message = "Unsupported database type: " + Introspection.GetType(db).FullName + raise ex + End Function + + 134217984 + + 33 + 0 + db as Database + BKS_ActiveRecord.DatabaseAdapter + + + Disconnect + + 1 + + 134217984 + Sub Disconnect() + 'Disconnect the base active record class from the database + Disconnect( GetTypeInfo(BKS_ActiveRecord.Base) ) + End Sub + + 134217984 + + 1 + 0 + + + + + Disconnect + + 1 + + 134217984 + Sub Disconnect(ty as Introspection.TypeInfo) + 'Disconnect a specific active record class from the database + if ty=nil then + raise new NilObjectException + end if + + dim ctx as BKS_ActiveRecord.P.Context = GetContext + ctx.ConnectionAdapter_Remove(ty) + #if RBVersion >= 2011.04 + #if TargetWeb + if ctx.ConnectionAdapter_Count=0 then + 'kill the context + dim lck as new BKS_ActiveRecord.P.ScopedLock(csCtx) + m_dictContext.Remove(Session.Identifier) + end if + #endif + #endif + End Sub + + 134217984 + + 1 + 0 + ty as Introspection.TypeInfo + + + + Field + + 1 + + 134217984 + Function Field(sFieldName as string) As BKS_ActiveRecord.FieldOpt + return new FieldOpt(sFieldName) + End Function + + 134217984 + + 1 + 0 + sFieldName as string + BKS_ActiveRecord.FieldOpt + + + FindFieldProperty + + 1 + + 134217984 + Function FindFieldProperty(tyClass as Introspection.TypeInfo, sField as string) As Introspection.PropertyInfo + dim iPrefixType as integer = 0 //Created By ARGen + + static arsAllowPrefix() as string = Array("dt", "s", "d", "b", "i", "i64", "c", "s") //Created By ARGen + static arsAllowSuffix() as string = Array("_dt", "_s", "_d", "_b", "_i", "_i64", "_c", "_s") //Created By ARGen + + 'Match the field to a property of the class. + + select case iPrefixType + case 0 + //No prefix/Suffix + + for each pi as Introspection.PropertyInfo in tyClass.GetProperties + + if pi.Name = sField then + return pi 'accept exact match + end + next + + return nil + + case 1 + //Prefix + for each pi as Introspection.PropertyInfo in tyClass.GetProperties + if pi.Name.Right(sField.Len) = sField then + 'check for a prefix match + dim sPrefix as string = pi.Name.Mid(1, pi.Name.Len - sField.Len) + if arsAllowPrefix.IndexOf(sPrefix) >-1 then + return pi + end if + end + next + + return nil + + case 2 + //Suffix + for each pi as Introspection.PropertyInfo in tyClass.GetProperties + if pi.name.left(sField.Len) = sField then + 'Check for suffix match + dim sSuffix as string = pi.Name.Right(pi.Name.Len - sField.Len) + if arsAllowSuffix.IndexOf(sSuffix) > -1 then + return pi + end + end if + next + + return nil + + case else + break + end + + End Function + + 134217984 + + 33 + 0 + tyClass as Introspection.TypeInfo, sField as string + Introspection.PropertyInfo + + + FindMatchingTable + + 1 + + 134217984 + Function FindMatchingTable(adp as BKS_ActiveRecord.DatabaseAdapter, sClassName as string) As string + dim sTable as string = sClassName + if adp.HasTable( sTable ) then + return sTable + end if + + sTable = "tbl" + sClassName + if adp.HasTable( sTable ) then + return sTable + end if + + 'if the class is clsSomething, look for Something and tblSomething + 'but not if the letter after cls is lowercase + dim sFourth as string = Mid(sClassName,4,1) + if Left( sClassName, 3 ) = "cls" and _ + StrComp( sFourth, "A", 0 ) >= 0 and _ + StrComp( sFourth, "Z", 0 ) <=0 then + sTable = sClassName.Mid(4) + if adp.HasTable( sTable ) then + return sTable + end if + + sTable = "tbl" + sTable + if adp.HasTable( sTable ) then + return sTable + end if + end if + + return "" + End Function + + 134217984 + + 33 + 0 + adp as BKS_ActiveRecord.DatabaseAdapter, sClassName as string + string + + + GetContext + + 1 + + 134217984 + Function GetContext() As BKS_ActiveRecord.P.Context + if m_ctxDefault is nil then + m_ctxDefault = new BKS_ActiveRecord.P.Context + end if + + #if RBVersion >= 2011.04 + #if TargetWeb + if not Session.Available then + return m_ctxDefault + end if + + dim lck as new BKS_ActiveRecord.P.ScopedLock(csCtx) + + if m_dictContext=nil then + m_dictContext = new Dictionary + end if + + if not m_dictContext.HasKey(Session.Identifier) then + m_dictContext.Value(Session.Identifier) = new BKS_ActiveRecord.P.Context + end if + return m_dictContext.Value(Session.Identifier) + #endif + #endif + + return m_ctxDefault + End Function + + 134217984 + + 33 + 0 + + BKS_ActiveRecord.P.Context + + + GetTableDefs + + 1 + + 134217984 + Function GetTableDefs() As BKS_ActiveRecord.TableDef() + dim aroTableDef() as BKS_ActiveRecord.TableDef + for each oTableInfo as BKS_ActiveRecord.P.TableInfo in GetContext.TableInfo_List + dim aro() as BKS_ActiveRecord.FieldDef + for each oFieldInfo as BKS_ActiveRecord.P.FieldInfo in oTableInfo.aroField + dim o as new BKS_ActiveRecord.FieldDef( _ + oFieldInfo.sFieldName, oFieldInfo.enFieldType, _ + oFieldInfo.bPrimaryKey, oFieldInfo.bForeignKey) + aro.Append(o) + next + dim oTableDef as new BKS_ActiveRecord.TableDef(oTableInfo.sTableName, oTableInfo.sPrimaryKey, aro) + aroTableDef.Append(oTableDef) + next + return aroTableDef + End Function + + 134217984 + + 1 + 0 + + BKS_ActiveRecord.TableDef() + + + GetTableInfo + + 1 + + 134217984 + Function GetTableInfo(ty as Introspection.TypeInfo) As BKS_ActiveRecord.P.TableInfo + 'check the info cache and return the mapping if it exists + dim oTableInfo as BKS_ActiveRecord.P.TableInfo = GetContext.TableInfo_Get(ty) + if oTableInfo<>nil then + return oTableInfo + end if + + 'try to map the class to a table by name + dim adp as BKS_ActiveRecord.DatabaseAdapter = GetContext.ConnectionAdapter_Get( ty ) + if adp<>nil then + dim sTable as string + sTable = FindMatchingTable( adp, ty.Name ) + if sTable<>"" then + Table adp.Db, sTable, ty + return GetContext.TableInfo_Get(ty) + end if + end if + + 'table not registered and not found by name + dim ex as RuntimeException + ex.Message = "Class does not have a table registered for it: " + ty.FullName + raise ex + End Function + + 134217984 + + 33 + 0 + ty as Introspection.TypeInfo + BKS_ActiveRecord.P.TableInfo + + + GetTypeConstructor + + 1 + + 134217984 + Function GetTypeConstructor(oTableInfo as BKS_ActiveRecord.P.TableInfo) As Introspection.ConstructorInfo + dim oConstructor as Introspection.ConstructorInfo + + for each o as Introspection.ConstructorInfo in oTableInfo.tyClass.GetConstructors + dim aroParam() as Introspection.ParameterInfo = o.GetParameters + if aroParam.Ubound = 0 then + if aroParam(0).ParameterType.FullName = "RecordSet" then + oConstructor = o + exit for + end if + end if + next + + return oConstructor + End Function + + 134217984 + + 33 + 0 + oTableInfo as BKS_ActiveRecord.P.TableInfo + Introspection.ConstructorInfo + + + MapFieldInfo + + 1 + + 134217984 + Function MapFieldInfo(tyClass as Introspection.TypeInfo, rs as RecordSet, aroFieldOpt() as FieldOpt) As BKS_ActiveRecord.P.FieldInfo + ' static arsAllowPrefix() as string = Array("m_", "m_id","i","s","dtm","dt","b","d","v","pict") + + dim sField as string = rs.Field("ColumnName").StringValue + + 'extract the field option if one was passed in for this field + dim oFieldOpt as FieldOpt + for each o as FieldOpt in aroFieldOpt + if o.FieldName=sField then + oFieldOpt = o + end if + next + + if oFieldOpt<>nil and oFieldOpt.IsIgnored then + return nil 'ignore this field + end if + + 'Find the database field type + dim enFieldType as DbType + dim iFieldType as integer = rs.Field("FieldType").IntegerValue + select case iFieldType + case 2 'smallint + enFieldType = DbType.DSmallInt + case 3 'integer + enFieldType = DbType.DInteger + case 5 'text or varchar + enFieldType = DbType.DText + case 6 'float + enFieldType = DbType.DFloat + case 7 'double + enFieldType = DbType.DDouble + case 8 'date + enFieldType = DbType.DDate + case 9 'time + enFieldType = DbType.DTime + case 10 'timestamp + enFieldType = DbType.DTimestamp + case 12 'boolean + enFieldType = DbType.DBoolean + case 14 'binary + enFieldType = DbType.DBlob + case 19 'int64 + enFieldType = DbType.DInt64 + case else + break + end select + + 'Match the field to a property of the class. + ' Properties are named with a prefix: <prefix>FieldName = FieldName + dim piFound as Introspection.PropertyInfo + piFound = FindFieldProperty(tyClass, sField) + + if piFound=nil then + BKS_Debug.Assert( false, "No property for field: " + sField ) + return nil + end if + + dim oFieldInfo as new BKS_ActiveRecord.P.FieldInfo(sField, piFound) + oFieldInfo.enFieldType = enFieldType + if rs.Field("IsPrimary") then + oFieldInfo.bPrimaryKey = true + end if + if oFieldOpt=nil then + if sField.Left(2) = "id" or sField.Left(4) = "m_id" then + oFieldInfo.bForeignKey = true + end if + else + oFieldInfo.bForeignKey = oFieldOpt.IsForeignKey + end if + + return oFieldInfo + End Function + + 134217984 + + 33 + 0 + tyClass as Introspection.TypeInfo, rs as RecordSet, aroFieldOpt() as FieldOpt + BKS_ActiveRecord.P.FieldInfo + + + MapTableInfo + + 1 + + 134217984 + Function MapTableInfo(db as Database, sTable as string, tyClass as Introspection.TypeInfo, aroFieldOpt() as FieldOpt) As BKS_ActiveRecord.P.TableInfo + 'Map fields in the database to properties on the class and + 'return a list of <field> : <propertyInfo> pairs. + + dim oTableInfo as BKS_ActiveRecord.P.TableInfo + ' dim pi as Introspection.Propertyinfo + + oTableInfo = new BKS_ActiveRecord.P.TableInfo + oTableInfo.tyClass = tyClass + + dim rs as RecordSet = Db.FieldSchema(sTable) + + BKS_Debug.Assert(rs.EOF=false, "Table not found: " + sTable) + + do until rs.EOF + dim oFieldInfo as BKS_ActiveRecord.P.FieldInfo + oFieldInfo = MapFieldInfo(tyClass, rs, aroFieldOpt) + if oFieldInfo<>nil then + if oFieldInfo.bPrimaryKey then + oTableInfo.sPrimaryKey = oFieldInfo.sFieldName + oTableInfo.piPrimaryKey = oFieldInfo.piFieldProperty + end if + oTableInfo.aroField.Append(oFieldInfo) + end if + + rs.MoveNext + loop + + BKS_Debug.Assert(oTableInfo.sPrimaryKey<>"", "The table needs to have a primary key") + + oTableInfo.sTableName = sTable + + return oTableInfo + End Function + + 134217984 + + 33 + 0 + db as Database, sTable as string, tyClass as Introspection.TypeInfo, aroFieldOpt() as FieldOpt + BKS_ActiveRecord.P.TableInfo + + + MapTableInfo + + 1 + + 134217984 + Function MapTableInfo(tyClass as Introspection.TypeInfo, oTableDef as BKS_ActiveRecord.TableDef) As BKS_ActiveRecord.P.TableInfo + 'Map fields in the database to properties on the class and + 'return a list of <field> : <propertyInfo> pairs. + + dim oTableInfo as BKS_ActiveRecord.P.TableInfo + ' dim pi as Introspection.Propertyinfo + + oTableInfo = new BKS_ActiveRecord.P.TableInfo + oTableInfo.sTableName = oTableDef.sTableName + oTableInfo.sPrimaryKey = oTableDef.sPrimaryKey + oTableInfo.piPrimaryKey = FindFieldProperty(tyClass, oTableInfo.sPrimaryKey) + if oTableInfo.piPrimaryKey=nil then + break + end if + oTableInfo.tyClass = tyClass + + for each oFieldDef as BKS_ActiveRecord.FieldDef in oTableDef.aroField + dim oFieldInfo as new BKS_ActiveRecord.P.FieldInfo( _ + oFieldDef.sFieldName, _ + FindFieldProperty(tyClass, oFieldDef.sFieldName)) + oFieldInfo.bPrimaryKey = oFieldDef.IsPrimaryKey + oFieldInfo.bForeignKey = oFieldDef.IsForeignKey + oFieldInfo.enFieldType = oFieldDef.enFieldType + if oFieldInfo.piFieldProperty=nil then + break + end if + oTableInfo.aroField.Append(oFieldInfo) + next + + return oTableInfo + End Function + + 134217984 + + 33 + 0 + tyClass as Introspection.TypeInfo, oTableDef as BKS_ActiveRecord.TableDef + BKS_ActiveRecord.P.TableInfo + + + Query + + 1 + + 134217984 + Function Query(ty as Introspection.TypeInfo, sCriteria as string = "", sOrder as string = "") As Variant() + dim adp as BKS_ActiveRecord.DatabaseAdapter + adp = GetContext.ConnectionAdapter_Get( ty ) + if adp=nil then + raise new RuntimeException + end if + + if not ty.IsSubclassOf( GetTypeInfo( Base ) ) then + dim ex as new RuntimeException + ex.Message = "Invalid type" + raise ex + end if + + dim aro() as Variant + dim oTableInfo as BKS_ActiveRecord.P.TableInfo = GetTableInfo( ty ) + + dim oConstructor as Introspection.ConstructorInfo + oConstructor = GetTypeConstructor(oTableInfo) + + dim rs as RecordSet + rs = adp.SelectList(oTableInfo.sTableName, sCriteria, sOrder) + + do until rs.EOF + dim arv() as Variant + arv.Append(rs) + dim oBase as Base = oConstructor.Invoke(arv) + aro.Append( oBase ) + rs.MoveNext + loop + + return aro + End Function + + 134217984 + + 1 + 0 + ty as Introspection.TypeInfo, sCriteria as string = "", sOrder as string = "" + Variant() + + + QueryRecordset + + 1 + + 134217984 + Function QueryRecordset(ty as Introspection.TypeInfo, sql as String) As RecordSet + dim adp as BKS_ActiveRecord.DatabaseAdapter + adp = GetContext.ConnectionAdapter_Get( ty ) + if adp=nil then + raise new RuntimeException + end if + + if not ty.IsSubclassOf( GetTypeInfo( Base ) ) then + dim ex as new RuntimeException + ex.Message = "Invalid type" + raise ex + end if + + return adp.SQLSelect(sql) + End Function + + 134217984 + + 1 + 0 + ty as Introspection.TypeInfo, sql as String + RecordSet + + + stringFromDbType + + 1 + + 134217984 + Function stringFromDbType(enDbType as BKS_ActiveRecord.DbType) As string + select case enDbType + case DbType.DInteger + return "DInteger" + case DbType.DSmallInt + return "DSmallInt" + case DbType.DDouble + return "DDouble" + case DbType.DDate + return "DDate" + case DbType.DTime + return "DTime" + case DbType.DTimestamp + return "DTimestamp" + case DbType.DBoolean + return "DBoolean" + case DbType.DBlob + return "DBlob" + case DbType.DText + return "DText" + case DbType.DInt64 + return "DInt64" + case DbType.DFloat + return "DFloat" + case else + break + end select + End Function + + 134217984 + + 0 + 0 + enDbType as BKS_ActiveRecord.DbType + string + + + Table + + 1 + + 134217984 + Sub Table(db as Database, sTable as string, tyClass as Introspection.TypeInfo, ParamArray aroFieldOpt() as FieldOpt) + dim oTableInfo as BKS_ActiveRecord.P.TableInfo + + 'Record the mapping between the type and the table. + oTableInfo = BKS_ActiveRecord.MapTableInfo( db, sTable, tyClass, aroFieldOpt ) + + GetContext.TableInfo_Set(tyClass, oTableInfo) + End Sub + + 134217984 + + 1 + 0 + db as Database, sTable as string, tyClass as Introspection.TypeInfo, ParamArray aroFieldOpt() as FieldOpt + + + + Table + + 1 + + 134217984 + Sub Table(tyClass as Introspection.TypeInfo, oTableDef as BKS_ActiveRecord.TableDef) + dim oTableInfo as BKS_ActiveRecord.P.TableInfo + + 'Record the mapping between the type and the table. + oTableInfo = BKS_ActiveRecord.MapTableInfo(tyClass, oTableDef) + + GetContext.TableInfo_Set(tyClass, oTableInfo) + End Sub + + 134217984 + + 1 + 0 + tyClass as Introspection.TypeInfo, oTableDef as BKS_ActiveRecord.TableDef + + + + csCtx + + 1 + + 134217984 + csCtx As CriticalSection + + + 134217984 + csCtx As CriticalSection + 33 + 0 + + 134217984 + Set + + End Set + + + 134217984 + Get + if m_csCtx=nil then + 'Mutexes work on Mac and Linux but not Windows. + 'CriticalSections work on Windows but not Mac. + '(Verified as of 2011 R4.1) + #if TargetWin32 + m_csCtx = new CriticalSection + #else + m_csCtx = new Mutex("") + #endif + end if + return m_csCtx + End Get + + + + m_csCtx + + 1 + + 134217984 + m_csCtx As CriticalSection + + + 134217984 + m_csCtx As CriticalSection + 33 + 0 + + + m_ctxDefault + + 1 + + 134217984 + m_ctxDefault As BKS_ActiveRecord.P.Context + + + 134217984 + m_ctxDefault As BKS_ActiveRecord.P.Context + 33 + 0 + + + m_dictContext + + 1 + + 134217984 + m_dictContext As Dictionary + + + 134217984 + m_dictContext As Dictionary + 33 + 0 + + + + Name + 1 + ID + Object + + + Index + 1 + ID + -2147483648 + Object + + + Super + 1 + ID + Object + + + Left + 1 + Position + 0 + Object + + + Top + 1 + Position + 0 + Object + + + + kDoubleNullSentinal + + 1 + 134217984 + kDoubleNullSentinal + 2 + 1.7E+308 + 1 + + + 134217984 + DbType + 1 + Integer + DbType + + 1 + + 134217984 + DInteger + DSmallInt + DDouble + DDate + DTime + DTimestamp + DBoolean + DBlob + DText + DInt64 + DFloat + + + + + P + 618102619 + 0 + 2 + 0 + + + + Name + 1 + ID + Object + + + Index + 1 + ID + -2147483648 + Object + + + Super + 1 + ID + Object + + + Left + 1 + Position + 0 + Object + + + Top + 1 + Position + 0 + Object + + + + + Context + 1072333800 + 1 + 1 + 0 + + + ConnectionAdapter_Count + + 1 + + 134217984 + Function ConnectionAdapter_Count() As Integer + dim lck as new BKS_ActiveRecord.P.ScopedLock(m_cs) + #pragma unused lck + + if m_dictTypeDb=nil then + return 0 + end if + return m_dictTypeDb.Count + End Function + + 134217984 + + 0 + 0 + + Integer + + + ConnectionAdapter_Get + + 1 + + 134217984 + Function ConnectionAdapter_Get(ty as Introspection.TypeInfo) As DatabaseAdapter + 'Start with this class and search the hash table in BKS_ActiveRecord for + 'a database to use. + dim lck as new BKS_ActiveRecord.P.ScopedLock(m_cs) + dim adp as BKS_ActiveRecord.DatabaseAdapter + + if m_dictTypeDb=nil then + return nil + end if + + 'start with the given type and walk up the inheritance chain + 'looking for a databsae connection + while ty<>nil + adp = m_dictTypeDb.Lookup(ty.FullName, nil ) + if adp<>nil then + exit while + end if + + ty = ty.BaseType + wend + + return adp + End Function + + 134217984 + + 0 + 0 + ty as Introspection.TypeInfo + DatabaseAdapter + + + ConnectionAdapter_Remove + + 1 + + 134217984 + Sub ConnectionAdapter_Remove(ty as Introspection.TypeInfo) + 'Disconnect a specific active record class from the database + if ty=nil then + raise new NilObjectException + end if + + if not ty.IsSubclassOf( GetTypeInfo(BKS_ActiveRecord.Base) ) then + raise new ActiveRecordException("Invalid type. Expected a subclass of BKS_ActiveRecord.Base") + end if + + dim lck as new BKS_ActiveRecord.P.ScopedLock(m_cs) + if m_dictTypeDb<>nil then + m_dictTypeDb.Remove(ty.FullName) + end if + End Sub + + 134217984 + + 0 + 0 + ty as Introspection.TypeInfo + + + + ConnectionAdapter_Set + + 1 + + 134217984 + Sub ConnectionAdapter_Set(ty as Introspection.TypeInfo, adp as BKS_ActiveRecord.DatabaseAdapter) + 'Connect a specific active record class and all of its subclasses to a database + if ty=nil or adp=nil then + raise new NilObjectException + end if + + if not ty.IsSubclassOf( GetTypeInfo(BKS_ActiveRecord.Base) ) then + raise new ActiveRecordException("Invalid type. Expected a subclass of BKS_ActiveRecord.Base") + end if + + 'add the database using the full type name of the type as a key + 'Base will use this to find the appropriate adapter. + dim lck as new BKS_ActiveRecord.P.ScopedLock(m_cs) + if m_dictTypeDb=nil then + m_dictTypeDb = new Dictionary + end if + m_dictTypeDb.Value(ty.FullName) = adp + End Sub + + 134217984 + + 0 + 0 + ty as Introspection.TypeInfo, adp as BKS_ActiveRecord.DatabaseAdapter + + + + Constructor + + 1 + + 134217984 + Sub Constructor() + 'Mutexes work on Mac and Linux but not Windows. + 'CriticalSections work on Windows but not Mac. + '(Verified as of 2011 R4.1) + #if TargetWin32 + m_cs = new CriticalSection + #else + m_cs = new Mutex("") + #endif + End Sub + + 134217984 + + 0 + 0 + + + + + TableInfo_Get + + 1 + + 134217984 + Function TableInfo_Get(ty as Introspection.TypeInfo) As BKS_ActiveRecord.P.TableInfo + dim lck as new BKS_ActiveRecord.P.ScopedLock(m_cs) + + 'check the info cache and return the mapping if it exists + if m_dictTypeTableInfo=nil then + return nil + end if + + return m_dictTypeTableInfo.Lookup(ty.FullName, nil) + End Function + + 134217984 + + 0 + 0 + ty as Introspection.TypeInfo + BKS_ActiveRecord.P.TableInfo + + + TableInfo_List + + 1 + + 134217984 + Function TableInfo_List() As BKS_ActiveRecord.P.TableInfo() + dim lck as new BKS_ActiveRecord.P.ScopedLock(m_cs) + + 'check the info cache and return the mapping if it exists + dim aro() as BKS_ActiveRecord.P.TableInfo + if m_dictTypeTableInfo=nil then + return aro + end if + + for each sKey as string in m_dictTypeTableInfo.Keys + dim o as BKS_ActiveRecord.P.TableInfo + o = m_dictTypeTableInfo.Value(sKey) + aro.Append(o) + next + return aro + End Function + + 134217984 + + 0 + 0 + + BKS_ActiveRecord.P.TableInfo() + + + TableInfo_Set + + 1 + + 134217984 + Sub TableInfo_Set(ty as Introspection.TypeInfo, oTableInfo as BKS_ActiveRecord.P.TableInfo) + dim lck as new BKS_ActiveRecord.P.ScopedLock(m_cs) + + if m_dictTypeTableInfo=nil then + m_dictTypeTableInfo = new Dictionary + end if + m_dictTypeTableInfo.Value(ty.FullName) = oTableInfo + End Sub + + 134217984 + + 0 + 0 + ty as Introspection.TypeInfo, oTableInfo as BKS_ActiveRecord.P.TableInfo + + + + m_cs + + 1 + + 134217984 + m_cs As CriticalSection + + + 134217984 + m_cs As CriticalSection + 33 + 0 + + + m_dictTypeDb + + 1 + + 134217984 + m_dictTypeDb As Dictionary + + + 134217984 + m_dictTypeDb As Dictionary + 33 + 0 + + + m_dictTypeTableInfo + + 1 + + 134217984 + m_dictTypeTableInfo As Dictionary + + + 134217984 + m_dictTypeTableInfo As Dictionary + 33 + 0 + + + + Name + 1 + ID + Object + + + Index + 1 + ID + -2147483648 + Object + + + Super + 1 + ID + Object + + + Left + 1 + Position + 0 + Object + + + Top + 1 + Position + 0 + Object + + + + + ScopedLock + 1072333800 + 1 + 1 + 0 + + + Constructor + + 1 + + 134217984 + Sub Constructor(cs as CriticalSection) + if cs is nil then + raise new ActiveRecordException("Lock is set to Nil") + end if + m_cs = cs + m_cs.Enter + End Sub + + 134217984 + + 0 + 0 + cs as CriticalSection + + + + Destructor + + 1 + + 134217984 + Sub Destructor() + m_cs.Leave + End Sub + + 134217984 + + 0 + 0 + + + + + Overview + + 1 + + 134217984 + Overview + The Constructor for this class accepts a CriticalSection and immediately calls the Enter method. + The Destructor calls Leave. + + You can use this class to hold a lock for the duration of the object's life. For example, if you + create it at the beginning of a method than the lock will be held until the method is complete. + The advantage of this is that the object will be destroyed regardless of how the method ends, + via a return statement or an exception or whatever. + + 0 + + + m_cs + + 1 + + 134217984 + m_cs As CriticalSection + + + 134217984 + m_cs As CriticalSection + 33 + 0 + + + + Name + 1 + ID + Object + + + Index + 1 + ID + -2147483648 + Object + + + Super + 1 + ID + Object + + + Left + 1 + Position + 0 + Object + + + Top + 1 + Position + 0 + Object + + + + + FieldInfo + 1072333800 + 1 + 1 + 0 + + + Constructor + + 1 + + 134217984 + Sub Constructor(sField as string, pi as Introspection.PropertyInfo) + self.sFieldName = sField + self.piFieldProperty = pi + End Sub + + 134217984 + + 0 + 0 + sField as string, pi as Introspection.PropertyInfo + + + + IsKey + + 1 + + 134217984 + Function IsKey() As Boolean + return (bForeignKey or bPrimaryKey) + End Function + + 134217984 + + 0 + 0 + + Boolean + + + bForeignKey + + 1 + + 134217984 + bForeignKey As boolean + + + 134217984 + bForeignKey As boolean + 0 + 0 + + + bPrimaryKey + + 1 + + 134217984 + bPrimaryKey As boolean + + + 134217984 + bPrimaryKey As boolean + 0 + 0 + + + enFieldType + + 1 + + 134217984 + enFieldType As BKS_ActiveRecord.DbType + + + 134217984 + enFieldType As BKS_ActiveRecord.DbType + 0 + 0 + + + piFieldProperty + + 1 + + 134217984 + piFieldProperty As Introspection.PropertyInfo + + + 134217984 + piFieldProperty As Introspection.PropertyInfo + 0 + 0 + + + sFieldName + + 1 + + 134217984 + sFieldName As String + + + 134217984 + sFieldName As String + 0 + 0 + + + + Name + 1 + ID + Object + + + Index + 1 + ID + -2147483648 + Object + + + Super + 1 + ID + Object + + + Left + 1 + Position + 0 + Object + + + Top + 1 + Position + 0 + Object + + + bForeignKey + Behavior + boolean + + + bPrimaryKey + Behavior + boolean + + + sFieldName + Behavior + String + MultiLineEditor + + + + + TableInfo + 1072333800 + 1 + 1 + 0 + + + aroField() + + 1 + + 134217984 + aroField() As BKS_ActiveRecord.P.FieldInfo + + + 134217984 + aroField() As BKS_ActiveRecord.P.FieldInfo + 0 + 0 + + + piPrimaryKey + + 1 + + 134217984 + piPrimaryKey As Introspection.PropertyInfo + + + 134217984 + piPrimaryKey As Introspection.PropertyInfo + 0 + 0 + + + sPrimaryKey + + 1 + + 134217984 + sPrimaryKey As string + + + 134217984 + sPrimaryKey As string + 0 + 0 + + + sTableName + + 1 + + 134217984 + sTableName As string + + + 134217984 + sTableName As string + 0 + 0 + + + tyClass + + 1 + + 134217984 + tyClass As Introspection.TypeInfo + + + 134217984 + tyClass As Introspection.TypeInfo + 0 + 0 + + + + Name + 1 + ID + Object + + + Index + 1 + ID + -2147483648 + Object + + + Super + 1 + ID + Object + + + Left + 1 + Position + 0 + Object + + + Top + 1 + Position + 0 + Object + + + sPrimaryKey + Behavior + string + MultiLineEditor + + + sTableName + Behavior + string + MultiLineEditor + + + + + Base + 618102619 + 1 + 1 + 0 + + + Clone + + 1 + + 134217984 + Function Clone() As Variant + dim ty as Introspection.TypeInfo = Introspection.GetType( self ) + dim oTableInfo as BKS_ActiveRecord.P.TableInfo = GetTableInfo( ty ) + + dim oSuperConstructor as Introspection.ConstructorInfo + dim oCopyConstructor as Introspection.ConstructorInfo + dim oDefaultConstructor as Introspection.ConstructorInfo + + 'Look for three types of constructors (lowest priority first): + ' (1) Default constructors (i.e. no parameters) + ' (2) Constructors that take a parameter of which self's class is a subtype + ' (3) Constructors that take a parameter which matches this class type + ' + 'For example if there's a class call User derived like this: + ' BKS_ActiveRecord.Base -> clsActiveRecord -> User + 'Then the program will look for constructors like the following: + ' (1) Constructor() + ' (2) Constructor(BKS_ActiveRecord.Base) + ' (3) Constructor(clsActiveRecord) + ' (4) Constructor(User) + 'If it finds more than one it will use the one that's farthest down the list. + 'The point of this is to give users a way of customizing how their objects + 'get cloned, all they need to do is add the appropriate constructor + + for each o as Introspection.ConstructorInfo in ty.GetConstructors + dim aroParam() as Introspection.ParameterInfo + aroParam = o.GetParameters + if aroParam.Ubound < 0 then + 'default constructor + oDefaultConstructor = o + elseif aroParam.Ubound=0 and _ + ty.IsSubclassOf( aroParam(0).ParameterType ) then + 'copy constructor that takes a super class + if oSuperConstructor=nil then + oSuperConstructor = o + else + dim aroCurrentParam() as Introspection.ParameterInfo + aroCurrentParam = oSuperConstructor.GetParameters + if aroParam(0).ParameterType.IsSubclassOf( aroCurrentParam(0).ParameterType ) then + 'if the parameter type of this constructor is derived from the parameter type + 'of the last one, then this one should have priority + oSuperConstructor = o + end if + end if + elseif aroParam.Ubound=0 and _ + aroParam(0).ParameterType is ty then + 'copy constructor that takes this class + oCopyConstructor = o + exit for + end if + next + + 'Create an instance using the constructor we found + dim oClone as Base + dim vSelf as Variant = self + + if oCopyConstructor<>nil then + oClone = oCopyConstructor.Invoke( Array(vSelf) ) + elseif oSuperConstructor<>nil then + oClone = oSuperConstructor.Invoke( Array(vSelf) ) + elseif oDefaultConstructor<>nil then + oClone = oDefaultConstructor.Invoke + else + 'we should always be able to find a default constructor + BKS_Debug.Assert( false, _ + "Class does not have a default constructor" ) + return nil + end if + + 'Copy the properties into the new instance + for each oField as BKS_ActiveRecord.P.FieldInfo in oTableInfo.aroField + dim pi as Introspection.PropertyInfo = oField.piFieldProperty + if not (pi is oTableInfo.piPrimaryKey) then + 'copy every saved property except the primary key + pi.Value(oClone) = pi.Value(self) + end if + next + + return oClone + End Function + + 134217984 + + 0 + 0 + + Variant + + + Constructor + + 1 + + 134217984 + Sub Constructor() + 'Empty + End Sub + + 134217984 + + 0 + 0 + + + + + Constructor + + 1 + + 134217984 + Sub Constructor(rs as RecordSet) + ReadRecord(rs) + End Sub + + 134217984 + + 0 + 0 + rs as RecordSet + + + + Db + + 1 + + 134217984 + Function Db() As Database + return GetDatabaseAdapter.Db + End Function + + 134217984 + + 0 + 0 + + Database + + + Delete + + 1 + + 134217984 + Sub Delete() + if self.IsNew then + return + end if + + dim adp as BKS_ActiveRecord.DatabaseAdapter = GetDatabaseAdapter + adp.BeginTransaction + + BeforeDelete + + adp.DeleteRecord( self ) + + AfterDelete + + adp.CommitTransaction + + catch ex as RuntimeException + + adp.RollbackTransaction + + raise ex + End Sub + + 134217984 + + 0 + 0 + + + + + GetDatabaseAdapter + + 1 + + 134217984 + Function GetDatabaseAdapter() As DatabaseAdapter + return GetContext.ConnectionAdapter_Get(Introspection.GetType(self)) + End Function + + 134217984 + + 1 + 0 + + DatabaseAdapter + + + GetTableName + + 1 + + 134217984 + Function GetTableName() As String + dim oTableInfo as BKS_ActiveRecord.P.TableInfo + oTableInfo = GetTableInfo( Introspection.GetType(self) ) + Return oTableInfo.sTableName + End Function + + 134217984 + + 0 + 0 + + String + + + ID + + 1 + + 134217984 + Function ID() As Int64 + dim oTableInfo as BKS_ActiveRecord.P.TableInfo + oTableInfo = GetTableInfo( Introspection.GetType(self) ) + return oTableInfo.piPrimaryKey.Value(self) + End Function + + 134217984 + + 0 + 0 + + Int64 + + + ID + + 1 + + 134217984 + Sub ID(assigns id as Int64) + dim oTableInfo as BKS_ActiveRecord.P.TableInfo + oTableInfo = GetTableInfo( Introspection.GetType(self) ) + oTableInfo.piPrimaryKey.Value(self) = id + End Sub + + 134217984 + + 0 + 0 + assigns id as Int64 + + + + IsModified + + 1 + + 134217984 + Function IsModified() As boolean + return IsRecordModified + End Function + + 134217984 + + 0 + 0 + + boolean + + + IsNew + + 1 + + 134217984 + Function IsNew() As boolean + return ID<=0 + End Function + + 134217984 + + 0 + 0 + + boolean + + + IsRecordModified + + 1 + + 134217984 + Function IsRecordModified() As boolean + dim bModified as boolean + + dim oTableInfo as BKS_ActiveRecord.P.TableInfo + oTableInfo = GetTableInfo( Introspection.GetType(self) ) + + for each oFieldInfo as BKS_ActiveRecord.P.FieldInfo in oTableInfo.aroField + dim pi as Introspection.PropertyInfo = oFieldInfo.piFieldProperty + dim vProperty as Variant = pi.Value( self ) + dim vSavedValue as Variant + if m_dictSavedPropertyValue<>nil then + vSavedValue = m_dictSavedPropertyValue.Lookup(pi.Name, nil) + end if + + 'cast the saved value so the type matches the property type + select case vProperty.Type + case Variant.TypeInteger + vSavedValue = vSavedValue.IntegerValue + case Variant.TypeLong + vSavedValue = vSavedValue.Int64Value + case Variant.TypeSingle + vSavedValue = vSavedValue.SingleValue + case Variant.TypeDouble + vSavedValue = vSavedValue.DoubleValue + case Variant.TypeCurrency + vSavedValue = vSavedValue.CurrencyValue + case Variant.TypeString + vSavedValue = vSavedValue.StringValue + case Variant.TypeBoolean + vSavedValue = vSavedValue.BooleanValue + case Variant.TypeColor + vSavedValue = vSavedValue.ColorValue + end select + + if vProperty.Type=Variant.TypeString then + 'do a case sensitive compare for strings + if StrComp(vProperty.StringValue, vSavedValue.StringValue, 0)<>0 then + bModified = true + exit for + end if + else + 'use the default comparison operator for everything else + if vProperty<>vSavedValue then + bModified = true + exit for + end if + end if + + next + + return bModified + End Function + + 134217984 + + 33 + 0 + + boolean + + + Load + + 1 + + 134217984 + Function Load(iRecordID as Int64) As boolean + 'Load record with the given ID. Return true if the record is found. + dim rs as RecordSet + + rs = GetDatabaseAdapter.SelectRecord( self, iRecordID ) + if rs.EOF then + return false + end if + + ReadRecord( rs ) + + return true + End Function + + 134217984 + + 0 + 0 + iRecordID as Int64 + boolean + + + Operator_Compare + + 1 + + 134217984 + Function Operator_Compare(rhs as BKS_ActiveRecord.Base) As integer + if rhs is nil then + return 1 + end if + + 'the two records are equal if they are actually the same object or + 'if they're the same type and have the same ID (except if they're new). + if rhs is self or _ + ( Introspection.GetType(self)=Introspection.GetType(rhs) and _ + rhs.ID=ID and not IsNew ) then + return 0 + end if + + 'this ordering is arbitrary. Equality is really the case we're after. + if ID<rhs.ID then + return -1 + else + return 1 + end if + End Function + + 134217984 + + 0 + 0 + rhs as BKS_ActiveRecord.Base + integer + + + ReadRecord + + 1 + + 134217984 + Sub ReadRecord(rs as RecordSet) + 'Read current record out of rs into properties + dim oTableInfo as BKS_ActiveRecord.P.TableInfo + + oTableInfo = GetTableInfo( Introspection.GetType(self) ) + + ReadRecord( rs, oTableInfo, m_dictSavedPropertyValue ) + End Sub + + 134217984 + + 1 + 0 + rs as RecordSet + + + + ReadRecord + + 1 + + 134217984 + Sub ReadRecord(rs as RecordSet, oTableInfo as BKS_ActiveRecord.P.TableInfo, byref dictSavedPropertyValue as Dictionary) + 'Read current record out of rs into properties + dim dictFieldValue as new Dictionary + + for each oFieldInfo as BKS_ActiveRecord.P.FieldInfo in oTableInfo.aroField + dim oField as DatabaseField = rs.Field( oFieldInfo.sFieldName ) + dim pi as Introspection.PropertyInfo = oFieldInfo.piFieldProperty + + if oField is nil then + BKS_Debug.Assert( false, _ + "A field needed to populate this record wasn't provided: " + _ + oFieldInfo.sFieldName ) + continue + end if + + dim vProperty as Variant + + if pi.PropertyType.Name = "Double" then + if oField.Value=nil then + vProperty = BKS_ActiveRecord.kDoubleNullSentinal + else + vProperty = oField.Value + end if + elseif pi.PropertyType.Name = "String" then + dim s as string = oField.StringValue + if Encoding(s) is nil then + s = DefineEncoding(s, Encodings.UTF8) + end if + vProperty = s + elseif pi.PropertyType.IsPrimitive then + vProperty = oField.Value + elseif pi.PropertyType = GetTypeInfo(Date) then + + dim v as Variant = oField.Value + if v = nil or v = "" then + vProperty=nil + else + dim dt as new Date + dim dOffset as double = dt.GMTOffset + dt.GMTOffset = 0 + dt.SQLDateTime = v.StringValue + dt.GMTOffset = dOffset + vProperty=dt + end if + + else + vProperty= oField.Value + end if + + pi.Value(self) = vProperty + dictFieldValue.Value(pi.Name) = vProperty + + next + + dictSavedPropertyValue = dictFieldValue + End Sub + + 134217984 + + 33 + 0 + rs as RecordSet, oTableInfo as BKS_ActiveRecord.P.TableInfo, byref dictSavedPropertyValue as Dictionary + + + + Save + + 1 + + 134217984 + Sub Save() + dim adp as BKS_ActiveRecord.DatabaseAdapter = GetDatabaseAdapter + adp.BeginTransaction + + BeforeSave + + if IsNew then + BeforeCreate + + ID = adp.InsertRecord( self, m_dictSavedPropertyValue ) + + AfterSave + AfterCreate + else + BeforeUpdate + + if IsRecordModified then + adp.UpdateRecord(self, m_dictSavedPropertyValue) + end if + + AfterSave + AfterUpdate + end if + + adp.CommitTransaction + + exception ex as RuntimeException + + adp.RollbackTransaction + + raise ex + End Sub + + 134217984 + + 0 + 0 + + + + + Validate + + 1 + + 134217984 + Function Validate(oError as BKS_ActiveRecord.ValidationErrors) As boolean + RaiseEvent Validate( oError ) + return ( oError.ErrorCount = 0 ) + End Function + + 134217984 + + 0 + 0 + oError as BKS_ActiveRecord.ValidationErrors + boolean + + + AfterCreate + 134217984 + 33 + 0 + + + + + AfterDelete + 134217984 + 33 + 0 + + + + + AfterSave + 134217984 + 33 + 0 + + + + + AfterUpdate + 134217984 + 33 + 0 + + + + + BeforeCreate + 134217984 + 33 + 0 + + + + + BeforeDelete + 134217984 + 33 + 0 + + + + + BeforeSave + 134217984 + 33 + 0 + + + + + BeforeUpdate + 134217984 + 33 + 0 + + + + + Validate + 134217984 + 33 + 0 + oErrors as BKS_ActiveRecord.ValidationErrors + + + + m_dictSavedPropertyValue + + 1 + + 134217984 + m_dictSavedPropertyValue As Dictionary + + + 134217984 + m_dictSavedPropertyValue As Dictionary + 33 + 0 + + + + Name + 1 + ID + Object + + + Index + 1 + ID + -2147483648 + Object + + + Super + 1 + ID + Object + + + Left + 1 + Position + 0 + Object + + + Top + 1 + Position + 0 + Object + + + + + BaseList + 618102619 + 1 + 1 + 0 + + + Constructor + + 1 + + 134217984 + Sub Constructor(ty as Introspection.TypeInfo, sCriteria as string = "", sOrder as string = "") + m_tyElement = ty + + if not ty.IsSubclassOf(GetTypeInfo(BKS_ActiveRecord.Base)) then + dim ex as new RuntimeException + ex.Message = "Invalid type" + raise ex + end if + + dim adp as BKS_ActiveRecord.DatabaseAdapter + adp = GetContext.ConnectionAdapter_Get( ty ) + if adp=nil then + raise new RuntimeException + end if + + dim rs as RecordSet + ' dim aro() as Variant + dim oTableInfo as BKS_ActiveRecord.P.TableInfo = GetTableInfo( ty ) + + dim sql as string = "SELECT " + oTableInfo.sPrimaryKey + _ + " FROM " + oTableInfo.sTableName + if sCriteria<>"" then + sql = sql + " WHERE " + sCriteria + end if + + if sOrder<>"" then + sql = sql + " ORDER BY " + sOrder + end if + + dim arid() as Int64 + + rs = adp.SQLSelect(sql) + + dim oField as DatabaseField = rs.IdxField(1) + do until rs.EOF + arid.Append(oField.Int64Value) + rs.MoveNext + loop + + m_arid = arid + redim m_aro(m_arid.Ubound) + End Sub + + 134217984 + + 0 + 0 + ty as Introspection.TypeInfo, sCriteria as string = "", sOrder as string = "" + + + + ElementType + + 1 + + 134217984 + Function ElementType() As Introspection.TypeInfo + return m_tyElement + End Function + + 134217984 + + 0 + 0 + + Introspection.TypeInfo + + + Item + + 1 + + 134217984 + Function Item(index as integer) As BKS_ActiveRecord.Base + if m_aro(index)<>nil then + return m_aro(index) + end if + + const kBatchSize = 50 + + LoadRange(index, Min(index+kBatchSize-1, m_arid.Ubound)) + + return m_aro(index) + End Function + + 134217984 + + 0 + 0 + index as integer + BKS_ActiveRecord.Base + + + LoadRange + + 1 + + 134217984 + Sub LoadRange(startIndex as integer, endIndex as integer) + dim sPrimaryKey as string = GetTableInfo(m_tyElement).sPrimaryKey + + dim aridix() as integer + dim arid() as Int64 + + for i as integer = startIndex to endIndex + aridix.Append(i) + arid.Append(m_arid(i)) + next + + arid.SortWith(aridix) + + dim arsId() as string + for i as integer = 0 to arid.Ubound + arsId.Append(Str(arid(i))) + next + + dim sCriteria as string + sCriteria = sPrimaryKey + " IN (" + Join(arsId, ",") + ")" + dim arv() as Variant = BKS_ActiveRecord.Query(m_tyElement, sCriteria, sPrimaryKey) + for i as integer = 0 to arv.Ubound + dim oRecord as BKS_ActiveRecord.Base = arv(i) + if oRecord.ID = arid(i) then + m_aro(aridix(i)) = oRecord + else + break + end if + next + End Sub + + 134217984 + + 33 + 0 + startIndex as integer, endIndex as integer + + + + Operator_Subscript + + 1 + + 134217984 + Function Operator_Subscript(index as Integer) As BKS_ActiveRecord.Base + return Item(index) + End Function + + 134217984 + + 0 + 0 + index as Integer + BKS_ActiveRecord.Base + + + Ubound + + 1 + + 134217984 + Function Ubound() As integer + return m_arid.Ubound + End Function + + 134217984 + + 0 + 0 + + integer + + + m_arid() + + 1 + + 134217984 + m_arid() As Int64 + + + 134217984 + m_arid() As Int64 + 33 + 0 + + + m_aro() + + 1 + + 134217984 + m_aro() As BKS_ActiveRecord.Base + + + 134217984 + m_aro() As BKS_ActiveRecord.Base + 33 + 0 + + + m_tyElement + + 1 + + 134217984 + m_tyElement As Introspection.TypeInfo + + + 134217984 + m_tyElement As Introspection.TypeInfo + 33 + 0 + + + + Name + 1 + ID + Object + + + Index + 1 + ID + -2147483648 + Object + + + Super + 1 + ID + Object + + + Left + 1 + Position + 0 + Object + + + Top + 1 + Position + 0 + Object + + + + + FieldDef + 618102619 + 1 + 1 + 0 + + + Constructor + + 1 + + 134217984 + Sub Constructor(sFieldName as string, enFieldType as BKS_ActiveRecord.DbType, bPrimaryKey as boolean, bForeignKey as boolean) + self.sFieldName = sFieldName + self.enFieldType = enFieldType + self.IsPrimaryKey = bPrimaryKey + self.IsForeignKey = bForeignKey + End Sub + + 134217984 + + 0 + 0 + sFieldName as string, enFieldType as BKS_ActiveRecord.DbType, bPrimaryKey as boolean, bForeignKey as boolean + + + + enFieldType + + 1 + + 134217984 + enFieldType As BKS_ActiveRecord.DbType + + + 134217984 + enFieldType As BKS_ActiveRecord.DbType + 0 + 0 + + + IsForeignKey + + 1 + + 134217984 + IsForeignKey As boolean + + + 134217984 + IsForeignKey As boolean + 0 + 0 + + + IsPrimaryKey + + 1 + + 134217984 + IsPrimaryKey As boolean + + + 134217984 + IsPrimaryKey As boolean + 0 + 0 + + + sFieldName + + 1 + + 134217984 + sFieldName As string + + + 134217984 + sFieldName As string + 0 + 0 + + + + Name + 1 + ID + Object + + + Index + 1 + ID + -2147483648 + Object + + + Super + 1 + ID + Object + + + Left + 1 + Position + 0 + Object + + + Top + 1 + Position + 0 + Object + + + IsForeignKey + Behavior + boolean + + + IsPrimaryKey + Behavior + boolean + + + sFieldName + Behavior + string + MultiLineEditor + + + + + TableDef + 618102619 + 1 + 1 + 0 + + + Constructor + + 1 + + 134217984 + Sub Constructor(sTableName as string, sPrimaryKey as string, aroField() as BKS_ActiveRecord.FieldDef) + self.sTableName = sTableName + self.sPrimaryKey = sPrimaryKey + self.aroField = aroField + End Sub + + 134217984 + + 0 + 0 + sTableName as string, sPrimaryKey as string, aroField() as BKS_ActiveRecord.FieldDef + + + + aroField() + + 1 + + 134217984 + aroField() As BKS_ActiveRecord.FieldDef + + + 134217984 + aroField() As BKS_ActiveRecord.FieldDef + 0 + 0 + + + sPrimaryKey + + 1 + + 134217984 + sPrimaryKey As string + + + 134217984 + sPrimaryKey As string + 0 + 0 + + + sTableName + + 1 + + 134217984 + sTableName As string + + + 134217984 + sTableName As string + 0 + 0 + + + + Name + 1 + ID + Object + + + Index + 1 + ID + -2147483648 + Object + + + Super + 1 + ID + Object + + + Left + 1 + Position + 0 + Object + + + Top + 1 + Position + 0 + Object + + + sPrimaryKey + Behavior + string + MultiLineEditor + + + sTableName + Behavior + string + MultiLineEditor + + + + + FieldOpt + 618102619 + 1 + 1 + 0 + + + Constructor + + 1 + + 134217984 + Sub Constructor(sFieldName as string) + m_sFieldName = sFieldName + End Sub + + 134217984 + + 0 + 0 + sFieldName as string + + + + FieldName + + 1 + + 134217984 + Function FieldName() As String + return m_sFieldName + End Function + + 134217984 + + 0 + 0 + + String + + + ForeignKey + + 1 + + 134217984 + Function ForeignKey() As BKS_ActiveRecord.FieldOpt + m_bForeignKey = true + return self + End Function + + 134217984 + + 0 + 0 + + BKS_ActiveRecord.FieldOpt + + + Ignored + + 1 + + 134217984 + Function Ignored() As BKS_ActiveRecord.FieldOpt + m_bIgnored = true + return self + End Function + + 134217984 + + 0 + 0 + + BKS_ActiveRecord.FieldOpt + + + IsForeignKey + + 1 + + 134217984 + Function IsForeignKey() As Boolean + return m_bForeignKey + End Function + + 134217984 + + 0 + 0 + + Boolean + + + IsIgnored + + 1 + + 134217984 + Function IsIgnored() As Boolean + return m_bIgnored + End Function + + 134217984 + + 0 + 0 + + Boolean + + + m_bForeignKey + + 1 + + 134217984 + m_bForeignKey As boolean + + + 134217984 + m_bForeignKey As boolean + 33 + 0 + + + m_bIgnored + + 1 + + 134217984 + m_bIgnored As Boolean + + + 134217984 + m_bIgnored As Boolean + 33 + 0 + + + m_sFieldName + + 1 + + 134217984 + m_sFieldName As string + + + 134217984 + m_sFieldName As string + 33 + 0 + + + + Name + 1 + ID + Object + + + Index + 1 + ID + -2147483648 + Object + + + Super + 1 + ID + Object + + + Left + 1 + Position + 0 + Object + + + Top + 1 + Position + 0 + Object + + + + + ValidationErrors + 618102619 + 1 + 1 + 0 + + + Append + + 1 + + 134217984 + Sub Append(sMessage as string) + m_arsError.Append( sMessage ) + End Sub + + 134217984 + + 0 + 0 + sMessage as string + + + + Clear + + 1 + + 134217984 + Sub Clear() + redim m_arsError( -1 ) + End Sub + + 134217984 + + 0 + 0 + + + + + Error + + 1 + + 134217984 + Function Error(index as Integer) As string + return m_arsError(index) + End Function + + 134217984 + + 0 + 0 + index as Integer + string + + + ErrorCount + + 1 + + 134217984 + Function ErrorCount() As integer + return m_arsError.Ubound + 1 + End Function + + 134217984 + + 0 + 0 + + integer + + + m_arsError() + + 1 + + 134217984 + m_arsError() As string + + + 134217984 + m_arsError() As string + 33 + 0 + + + + Name + 1 + ID + Object + + + Index + 1 + ID + -2147483648 + Object + + + Super + 1 + ID + Object + + + Left + 1 + Position + 0 + Object + + + Top + 1 + Position + 0 + Object + + + + + MSSQLServerAdapter + 618102619 + 1 + BKS_ActiveRecord.DatabaseAdapter + 1 + 0 + + + Constructor + + 1 + + 134217984 + Sub Constructor(oDb as Object) + 'If you are not connecting to MSSQLServer and do not have the MSSQLServer plugin delete this class (MSSQLServerAdapter) + #if BKS_ActiveRecordConfig.kIncludeMSSQLServer + dim db as MSSQLServerDatabase = MSSQLServerDatabase(oDb) + if db=nil then + raise new RuntimeException + end if + m_db = db + #else + raise new UnsupportedOperationException + #endif + End Sub + + 134217984 + + 0 + 0 + oDb as Object + + + + Db + + 1 + + 134217984 + Function Db() As Database + return m_db + End Function + + 134217984 + + 0 + 0 + + Database + + + GetLastInsertID + + 1 + + 134217984 + Function GetLastInsertID() As Int64 + dim rs as RecordSet + rs = SQLSelect("SELECT @@IDENTITY;") + return rs.IdxField(1).Int64Value + End Function + + 134217984 + + 1 + 0 + + Int64 + + + Note + + 1 + + 134217984 + Note + + If you are not connecting to MSSQLServer and do not have the MSSQLServer plugin delete this class (MSSQLServerAdapter) + + 0 + + + m_db + + 1 + + 134217984 + m_db As Database + + + 134217984 + m_db As Database + 33 + 0 + + + + Name + 1 + ID + Object + + + Index + 1 + ID + -2147483648 + Object + + + Super + 1 + ID + Object + + + Left + 1 + Position + 0 + Object + + + Top + 1 + Position + 0 + Object + + + + + MySQLCommunityServerAdapter + 618102619 + 1 + BKS_ActiveRecord.DatabaseAdapter + 1 + 0 + + + Constructor + + 1 + + 134217984 + Sub Constructor(oDb as Object) + 'If you are not connecting to MySQL and do not have the MySQLCommunityPlugin plugin delete this class (MySQLCommunityServerAdapter) + #if BKS_ActiveRecordConfig.kIncludeMySQLCommunityServer + dim db as MySQLCommunityServer = MySQLCommunityServer(oDb) + if db=nil then + raise new RuntimeException + end if + m_db = db + #else + raise new UnsupportedOperationException + #endif + End Sub + + 134217984 + + 0 + 0 + oDb as Object + + + + Db + + 1 + + 134217984 + Function Db() As Database + return m_db + End Function + + 134217984 + + 0 + 0 + + Database + + + GetLastInsertID + + 1 + + 134217984 + Function GetLastInsertID() As Int64 + #if BKS_ActiveRecordConfig.kIncludeMySQLCommunityServer + return MySQLCommunityServer(m_db).GetInsertID + #else + raise new UnsupportedOperationException + #endif + End Function + + 134217984 + + 1 + 0 + + Int64 + + + Note + + 1 + + 134217984 + Note + If you are not connecting to MySQL and + do not have the MySQLCommunityPlugin plugin delete this class (MySQLCommunityServerAdapter) + + 0 + + + m_db + + 1 + + 134217984 + m_db As Database + + + 134217984 + m_db As Database + 33 + 0 + + + + Name + 1 + ID + Object + + + Index + 1 + ID + -2147483648 + Object + + + Super + 1 + ID + Object + + + Left + 1 + Position + 0 + Object + + + Top + 1 + Position + 0 + Object + + + + + PostgreSQLDatabaseAdapter + 618102619 + 1 + BKS_ActiveRecord.DatabaseAdapter + 1 + 0 + + + BindValues + + 1 + + 134217984 + Function BindValues(stmt as PreparedSQLStatement, oRecord as BKS_ActiveRecord.Base, aroField() as BKS_ActiveRecord.P.FieldInfo) As Dictionary + dim dictFieldValue as new Dictionary + + for i as integer = 0 to aroField.Ubound + dim oField as BKS_ActiveRecord.P.FieldInfo = aroField(i) + dim pi as Introspection.PropertyInfo = oField.piFieldProperty + dim v as Variant = pi.Value(oRecord) + + stmt.Bind(i, v) + + dictFieldValue.Value(pi.Name) = v + + next + + return dictFieldValue + End Function + + 134217984 + + 33 + 0 + stmt as PreparedSQLStatement, oRecord as BKS_ActiveRecord.Base, aroField() as BKS_ActiveRecord.P.FieldInfo + Dictionary + + + Constructor + + 1 + + 134217984 + Sub Constructor(oDb as Object) + 'If you are not connecting to PostgreSQL and do not have the PostgreSQLPlugin plugin delete this class (PostgreSQLDatabaseAdapter) + #if BKS_ActiveRecordConfig.kIncludePostgreSQLDatabase + dim db as PostgreSQLDatabase = PostgreSQLDatabase(oDb) + if db=nil then + raise new RuntimeException + end if + m_db = db + #else + raise new UnsupportedOperationException + #endif + End Sub + + 134217984 + + 0 + 0 + oDb as Object + + + + Db + + 1 + + 134217984 + Function Db() As Database + return m_db + End Function + + 134217984 + + 0 + 0 + + Database + + + GetLastInsertID + + 1 + + 134217984 + Function GetLastInsertID() As Int64 + dim rs as RecordSet + rs = SQLSelect("SELECT LASTVAL();") + return rs.IdxField(1).Int64Value + End Function + + 134217984 + + 1 + 0 + + Int64 + + + InsertRecord + + 1 + + 134217984 + Function InsertRecord(oRecord as BKS_ActiveRecord.Base, byref dictSavedPropertyValue as Dictionary) As Int64 + dim oTableInfo as BKS_ActiveRecord.P.TableInfo + + dim dictFieldValue as Dictionary + + oTableInfo = GetTableInfo( Introspection.GetType(oRecord) ) + + dim arsField() as string + dim arsPlaceholder() as string + dim aroField() as BKS_ActiveRecord.P.FieldInfo + + for each oField as BKS_ActiveRecord.P.FieldInfo in oTableInfo.aroField + if oField.bPrimaryKey then + continue + end if + arsField.Append(oField.sFieldName) + arsPlaceholder.Append("$" + str(arsPlaceholder.Ubound + 2) ) + aroField.Append(oField) + next + + dim sql as string + sql = "INSERT INTO " + oTableInfo.sTableName + sql = sql + "(" + Join(arsField, ",") + ")" + sql = sql + " VALUES " + sql = sql + "(" + Join(arsPlaceholder, ",") + ")" + + dim stmt as PreparedSQLStatement + stmt = db.Prepare(sql) + + dictFieldValue = BindValues(stmt, oRecord, aroField) + + stmt.SQLExecute + if db.Error then + raise new BKS_ActiveRecord.DatabaseException(db) + end if + + dim iRecordID as Int64 = GetLastInsertID + dictFieldValue.Value( oTableInfo.piPrimaryKey.Name ) = iRecordID + + 'store the newly saved property values + dictSavedPropertyValue = dictFieldValue + + return iRecordID + End Function + + 134217984 + + 0 + 0 + oRecord as BKS_ActiveRecord.Base, byref dictSavedPropertyValue as Dictionary + Int64 + + + UpdateRecord + + 1 + + 134217984 + Sub UpdateRecord(oRecord as BKS_ActiveRecord.Base, byref dictSavedPropertyValue as Dictionary) + dim oTableInfo as BKS_ActiveRecord.P.TableInfo + + dim dictFieldValue as Dictionary + + oTableInfo = GetTableInfo( Introspection.GetType(oRecord) ) + + dim arsField() as string + dim aroField() as BKS_ActiveRecord.P.FieldInfo + dim oPrimaryKeyField as BKS_ActiveRecord.P.FieldInfo + + for each oField as BKS_ActiveRecord.P.FieldInfo in oTableInfo.aroField + if oField.bPrimaryKey then + oPrimaryKeyField = oField + continue + end if + arsField.Append(oField.sFieldName + "=$" + str(arsField.ubound + 2) ) + aroField.Append(oField) + next + + dim sql as string + sql = "UPDATE " + oTableInfo.sTableName + " SET " + sql = sql + Join(arsField, ",") + sql = sql + " WHERE " + oTableInfo.sPrimaryKey + "=$" + str(arsField.ubound + 2) + + dim stmt as PreparedSQLStatement + stmt = db.Prepare(sql) + + aroField.Append(oPrimaryKeyField) + dictFieldValue = BindValues(stmt, oRecord, aroField) + + stmt.SQLExecute + if db.Error then + raise new BKS_ActiveRecord.DatabaseException(db) + end if + + 'store the newly saved property values + dictSavedPropertyValue = dictFieldValue + End Sub + + 134217984 + + 0 + 0 + oRecord as BKS_ActiveRecord.Base, byref dictSavedPropertyValue as Dictionary + + + + Note + + 1 + + 134217984 + Note + If you are not connecting to PostgreSQL and do not have the PostgreSQLPlugin plugin delete this class (PostgreSQLDatabaseAdapter) + + 0 + + + m_db + + 1 + + 134217984 + m_db As Database + + + 134217984 + m_db As Database + 33 + 0 + + + + Name + 1 + ID + Object + + + Index + 1 + ID + -2147483648 + Object + + + Super + 1 + ID + Object + + + Left + 1 + Position + 0 + Object + + + Top + 1 + Position + 0 + Object + + + + + REALSQLDatabaseAdapter + 618102619 + 1 + BKS_ActiveRecord.DatabaseAdapter + 1 + 0 + + + BeginTransaction + + 1 + + 134217984 + Sub BeginTransaction() + if m_iTransactionCt=0 and not m_db.AutoCommit then + try + m_db.Commit 'commit the auto transaction + catch ex as RuntimeException + 'ignore this one + end try + end if + + if m_iTransactionCt=0 then + SQLExecute( "BEGIN" ) + end if + m_iTransactionCt = m_iTransactionCt + 1 + End Sub + + 134217984 + + 0 + 0 + + + + + CommitTransaction + + 1 + + 134217984 + Sub CommitTransaction() + m_iTransactionCt = m_iTransactionCt - 1 + if m_iTransactionCt=0 then + Db.Commit + if db.Error then + dim ex as new BKS_ActiveRecord.DatabaseException(db, "Commit") + db.Rollback + raise ex + end if + end if + End Sub + + 134217984 + + 0 + 0 + + + + + Constructor + + 1 + + 134217984 + Sub Constructor(oDb as Object) + #if BKS_ActiveRecordConfig.kIncludeREALSQLDatabase + dim db as REALSQLDatabase = REALSQLDatabase(oDb) + if db=nil then + raise new RuntimeException + end if + m_db = db + #else + raise new UnsupportedOperationException + #endif + End Sub + + 134217984 + + 0 + 0 + oDb as Object + + + + Db + + 1 + + 134217984 + Function Db() As Database + return m_db + End Function + + 134217984 + + 0 + 0 + + Database + + + GetLastInsertID + + 1 + + 134217984 + Function GetLastInsertID() As Int64 + return m_db.LastRowID + End Function + + 134217984 + + 1 + 0 + + Int64 + + + RollbackTransaction + + 1 + + 134217984 + Sub RollbackTransaction() + m_iTransactionCt = m_iTransactionCt - 1 + if m_iTransactionCt=0 then + Db.Rollback + end if + End Sub + + 134217984 + + 0 + 0 + + + + + m_db + + 1 + + 134217984 + m_db As REALSQLDatabase + + + 134217984 + m_db As REALSQLDatabase + 33 + 0 + + + m_iTransactionCt + + 1 + + 134217984 + m_iTransactionCt As Integer + + + 134217984 + m_iTransactionCt As Integer + 33 + 0 + + + + Name + 1 + ID + Object + + + Index + 1 + ID + -2147483648 + Object + + + Super + 1 + ID + Object + + + Left + 1 + Position + 0 + Object + + + Top + 1 + Position + 0 + Object + + + + + SQLiteDatabaseAdapter + 618102619 + 1 + BKS_ActiveRecord.DatabaseAdapter + 1 + 0 + + + BeginTransaction + + 1 + + 134217984 + Sub BeginTransaction() + if m_iTransactionCt=0 then + try + m_db.Commit 'commit the auto transaction + catch ex as RuntimeException + 'ignore this one + end try + end if + + if m_iTransactionCt=0 then + SQLExecute( "BEGIN" ) + end if + m_iTransactionCt = m_iTransactionCt + 1 + End Sub + + 134217984 + + 0 + 0 + + + + + CommitTransaction + + 1 + + 134217984 + Sub CommitTransaction() + m_iTransactionCt = m_iTransactionCt - 1 + if m_iTransactionCt=0 then + Db.Commit + if db.Error then + dim ex as new BKS_ActiveRecord.DatabaseException(db, "Commit") + db.Rollback + raise ex + end if + end if + End Sub + + 134217984 + + 0 + 0 + + + + + Constructor + + 1 + + 134217984 + Sub Constructor(oDb as Object) + #if BKS_ActiveRecordConfig.kIncludeSQLiteDatabase and RBVersion>=2013 + dim db as SQLiteDatabase = SQLiteDatabase(oDb) + if db=nil then + raise new RuntimeException + end if + m_db = db + #else + raise new UnsupportedOperationException + #endif + End Sub + + 134217984 + + 0 + 0 + oDb as Object + + + + Db + + 1 + + 134217984 + Function Db() As Database + return m_db + End Function + + 134217984 + + 0 + 0 + + Database + + + GetLastInsertID + + 1 + + 134217984 + Function GetLastInsertID() As Int64 + #if BKS_ActiveRecordConfig.kIncludeSQLiteDatabase and RBVersion>=2013 + return SQLiteDatabase(m_db).LastRowID + #else + raise new UnsupportedOperationException + #endif + End Function + + 134217984 + + 1 + 0 + + Int64 + + + RollbackTransaction + + 1 + + 134217984 + Sub RollbackTransaction() + m_iTransactionCt = m_iTransactionCt - 1 + if m_iTransactionCt=0 then + Db.Rollback + end if + End Sub + + 134217984 + + 0 + 0 + + + + + m_db + + 1 + + 134217984 + m_db As Database + + + 134217984 + m_db As Database + 33 + 0 + + + m_iTransactionCt + + 1 + + 134217984 + m_iTransactionCt As Integer + + + 134217984 + m_iTransactionCt As Integer + 33 + 0 + + + + Name + 1 + ID + Object + + + Index + 1 + ID + -2147483648 + Object + + + Super + 1 + ID + Object + + + Left + 1 + Position + 0 + Object + + + Top + 1 + Position + 0 + Object + + + + + DatabaseAdapter + 618102619 + 1 + 1 + 0 + + + BeginTransaction + + 1 + + 134217984 + Sub BeginTransaction() + SQLExecute( "BEGIN" ) + End Sub + + 134217984 + + 0 + 0 + + + + + BindId + + 1 + + 134217984 + Sub BindId(stmt as PreparedSQLStatement, i as integer, id as Int64) + #if BKS_ActiveRecordConfig.kIncludeREALSQLDatabase + if db isa REALSQLDatabase then + stmt.BindType(i, REALSQLPreparedStatement.SQLITE_INT64) + end if + #endif + + #if BKS_ActiveRecordConfig.kIncludeSQLiteDatabase and RBVersion>=2013 + if db isa SQLiteDatabase then + stmt.BindType(i, SQLitePreparedStatement.SQLITE_INT64) + end if + #endif + + #if BKS_ActiveRecordConfig.kIncludeMySQLCommunityServer + if db isa MySQLCommunityServer then + stmt.BindType(i, MySQLPreparedStatement.MYSQL_TYPE_LONGLONG) + end if + #endif + + #if BKS_ActiveRecordConfig.kIncludePostgreSQLDatabase + if db isa PostgreSQLDatabase then + //PostgreSQL doesn't do binding the same way + end + #endif + + #if BKS_ActiveRecordConfig.kIncludeMSSQLServer + if db isa MSSQLServerDatabase then + stmt.BindType(i, MSSQLServerPreparedStatement.MSSQLSERVER_TYPE_INT) + end + #endif + + #if BKS_ActiveRecordConfig.kIncludeOracle + if db isa OracleDatabase then + stmt.BindType(i, OracleSQLPreparedStatement.SQL_TYPE_INTEGER) + end + #endif + + #If BKS_ActiveRecordConfig.kIncludeCubeDatabase + if db isa CubeSQLServer then + break + end + #endif + + stmt.Bind(i, id) + End Sub + + 134217984 + + 33 + 0 + stmt as PreparedSQLStatement, i as integer, id as Int64 + + + + BindNull + + 1 + + 134217984 + Sub BindNull(stmt as PreparedSQLStatement, i as integer) + #if BKS_ActiveRecordConfig.kIncludeMySQLCommunityServer + if db isa MySQLCommunityServer then + stmt.BindType(i, MySQLPreparedStatement.MYSQL_TYPE_NULL) + end if + #endif + + #if BKS_ActiveRecordConfig.kIncludeREALSQLDatabase + if db isa REALSQLDatabase then + stmt.BindType(i, REALSQLPreparedStatement.SQLITE_NULL) + end if + #endif + + #if BKS_ActiveRecordConfig.kIncludeSQLiteDatabase and RBVersion>=2013 + if db isa SQLiteDatabase then + stmt.BindType(i, SQLitePreparedStatement.SQLITE_NULL) + end if + #endif + + #if BKS_ActiveRecordConfig.kIncludePostgreSQLDatabase + if db isa PostgreSQLDatabase then + //PostgreSQL doesn't do binding the same way + end + #endif + + #if BKS_ActiveRecordConfig.kIncludeMSSQLServer + if db isa MSSQLServerDatabase then + stmt.BindType(i, MSSQLServerPreparedStatement.MSSQLSERVER_TYPE_NULL) + end + #endif + + #if BKS_ActiveRecordConfig.kIncludeOracle + if db isa OracleDatabase then + stmt.BindType(i, OracleSQLPreparedStatement.SQL_TYPE_NULL) + end + #endif + End Sub + + 134217984 + + 33 + 0 + stmt as PreparedSQLStatement, i as integer + + + + BindValues + + 1 + + 134217984 + Function BindValues(stmt as PreparedSQLStatement, oRecord as BKS_ActiveRecord.Base, aroField() as BKS_ActiveRecord.P.FieldInfo) As Dictionary + dim dictFieldValue as new Dictionary + + for i as integer = 0 to aroField.Ubound + dim oField as BKS_ActiveRecord.P.FieldInfo = aroField(i) + dim pi as Introspection.PropertyInfo = oField.piFieldProperty + dim v as Variant = pi.Value(oRecord) + + dim iDbType as integer + + select case db + case nil + 'empty. This just let's it compile if someone turns off all the constants + + #if BKS_ActiveRecordConfig.kIncludeREALSQLDatabase + case isa REALSQLDatabase + select case aroField(i).enFieldType + case DbType.DInteger + iDbType = REALSQLPreparedStatement.SQLITE_INTEGER + case DbType.DSmallInt + iDbType = REALSQLPreparedStatement.SQLITE_INTEGER + case DbType.DDouble + iDbType = REALSQLPreparedStatement.SQLITE_DOUBLE + case DbType.DDate + iDbType = REALSQLPreparedStatement.SQLITE_TEXT + case DbType.DTime + iDbType = REALSQLPreparedStatement.SQLITE_TEXT + case DbType.DTimestamp + iDbType = REALSQLPreparedStatement.SQLITE_TEXT + case DbType.DBoolean + iDbType = REALSQLPreparedStatement.SQLITE_BOOLEAN + case DbType.DBlob + iDbType = REALSQLPreparedStatement.SQLITE_BLOB + case DbType.DText + iDbType = REALSQLPreparedStatement.SQLITE_TEXT + case DbType.DInt64 + iDbType = REALSQLPreparedStatement.SQLITE_INT64 + case DbType.DFloat + iDbType = REALSQLPreparedStatement.SQLITE_DOUBLE + case else + break 'unsupported type + end select + #endif + + #if BKS_ActiveRecordConfig.kIncludeSQLiteDatabase and RBVersion>=2013 + case isa SQLiteDatabase + select case aroField(i).enFieldType + case DbType.DInteger + iDbType = SQLitePreparedStatement.SQLITE_INTEGER + case DbType.DSmallInt + iDbType = SQLitePreparedStatement.SQLITE_INTEGER + case DbType.DDouble + iDbType = SQLitePreparedStatement.SQLITE_DOUBLE + case DbType.DDate + iDbType = SQLitePreparedStatement.SQLITE_TEXT + case DbType.DTime + iDbType = SQLitePreparedStatement.SQLITE_TEXT + case DbType.DTimestamp + iDbType = SQLitePreparedStatement.SQLITE_TEXT + case DbType.DBoolean + iDbType = SQLitePreparedStatement.SQLITE_BOOLEAN + case DbType.DBlob + iDbType = SQLitePreparedStatement.SQLITE_BLOB + case DbType.DText + iDbType = SQLitePreparedStatement.SQLITE_TEXT + case DbType.DInt64 + iDbType = SQLitePreparedStatement.SQLITE_INT64 + case DbType.DFloat + iDbType = SQLitePreparedStatement.SQLITE_DOUBLE + case else + break 'unsupported type + end select + #endif + + #if BKS_ActiveRecordConfig.kIncludeMySQLCommunityServer + case isa MySQLCommunityServer + select case aroField(i).enFieldType + case DbType.DInteger + iDbType = MySQLPreparedStatement.MYSQL_TYPE_LONG + case DbType.DSmallInt + iDbType = MySQLPreparedStatement.MYSQL_TYPE_SHORT + case DbType.DDouble + iDbType = MySQLPreparedStatement.MYSQL_TYPE_DOUBLE + case DbType.DDate + iDbType = MySQLPreparedStatement.MYSQL_TYPE_DATE + case DbType.DTime + iDbType = MySQLPreparedStatement.MYSQL_TYPE_TIME + case DbType.DTimestamp + iDbType = MySQLPreparedStatement.MYSQL_TYPE_TIMESTAMP + case DbType.DBoolean + iDbType = MySQLPreparedStatement.MYSQL_TYPE_TINY + case DbType.DBlob + iDbType = MySQLPreparedStatement.MYSQL_TYPE_BLOB + case DbType.DText + iDbType = MySQLPreparedStatement.MYSQL_TYPE_STRING + case DbType.DInt64 + iDbType = MySQLPreparedStatement.MYSQL_TYPE_LONGLONG + case DbType.DFloat + iDbType = MySQLPreparedStatement.MYSQL_TYPE_DOUBLE + case else + break 'unsupported type + end select + #endif + + //Postgres doesn't use bind types. + + #if BKS_ActiveRecordConfig.kIncludeMSSQLServer + case isa MSSQLServerDatabase + select case aroField(i).enFieldType + case DbType.DInteger + iDbType = MSSQLServerPreparedStatement.MSSQLSERVER_TYPE_BIGINT + case DbType.DSmallInt + iDbType = MSSQLServerPreparedStatement.MSSQLSERVER_TYPE_SMALLINT + case DbType.DDouble + iDbType = MSSQLServerPreparedStatement.MSSQLSERVER_TYPE_DOUBLE + case DbType.DDate + iDbType = MSSQLServerPreparedStatement.MSSQLSERVER_TYPE_DATE + case DbType.DTime + iDbType = MSSQLServerPreparedStatement.MSSQLSERVER_TYPE_TIME + case DbType.DTimestamp + iDbType = MSSQLServerPreparedStatement.MSSQLSERVER_TYPE_DATETIME + case DbType.DBoolean + iDbType = MSSQLServerPreparedStatement.MSSQLSERVER_TYPE_TINYINT + case DbType.DBlob + iDbType = MSSQLServerPreparedStatement.MSSQLSERVER_TYPE_BINARY + case DbType.DText + iDbType = MSSQLServerPreparedStatement.MSSQLSERVER_TYPE_STRING + case DbType.DInt64 + iDbType = MSSQLServerPreparedStatement.MSSQLSERVER_TYPE_BIGINT + case DbType.DFloat + iDbType = MSSQLServerPreparedStatement.MSSQLSERVER_TYPE_FLOAT + case else + break 'unsupported type + end select + #endif + + #if BKS_ActiveRecordConfig.kIncludeOracle + case isa OracleDatabase + select case aroField(i).enFieldType + case DbType.DInteger + iDbType = OracleSQLPreparedStatement.SQL_TYPE_INTEGER + case DbType.DSmallInt + iDbType = OracleSQLPreparedStatement.SQL_TYPE_INTEGER + case DbType.DDouble + iDbType = OracleSQLPreparedStatement.SQL_TYPE_FLOAT + case DbType.DDate + iDbType = OracleSQLPreparedStatement.SQL_TYPE_DATE + case DbType.DTime + iDbType = OracleSQLPreparedStatement.SQL_TYPE_STRING + case DbType.DTimestamp + iDbType = OracleSQLPreparedStatement.SQL_TYPE_DATE + case DbType.DBoolean + iDbType = OracleSQLPreparedStatement.SQL_TYPE_INTEGER + case DbType.DBlob + iDbType = OracleSQLPreparedStatement.SQL_TYPE_CLOB + case DbType.DText + iDbType = OracleSQLPreparedStatement.SQL_TYPE_STRING + case DbType.DInt64 + iDbType = OracleSQLPreparedStatement.SQL_TYPE_INTEGER + case DbType.DFloat + iDbType = OracleSQLPreparedStatement.SQL_TYPE_FLOAT + case else + break 'unsupported type + end select + #endif + + #if BKS_ActiveRecordConfig.kIncludeCubeDatabase + case isa CubeSQLServer + select case aroField(i).enFieldType + case DbType.DInteger + iDbType = REALSQLPreparedStatement.SQLITE_INTEGER + case DbType.DSmallInt + iDbType = REALSQLPreparedStatement.SQLITE_INTEGER + case DbType.DDouble + iDbType = REALSQLPreparedStatement.SQLITE_DOUBLE + case DbType.DDate + iDbType = REALSQLPreparedStatement.SQLITE_TEXT + case DbType.DTime + iDbType = REALSQLPreparedStatement.SQLITE_TEXT + case DbType.DTimestamp + iDbType = REALSQLPreparedStatement.SQLITE_TEXT + case DbType.DBoolean + iDbType = REALSQLPreparedStatement.SQLITE_BOOLEAN + case DbType.DBlob + iDbType = REALSQLPreparedStatement.SQLITE_BLOB + case DbType.DText + iDbType = REALSQLPreparedStatement.SQLITE_TEXT + case DbType.DInt64 + iDbType = REALSQLPreparedStatement.SQLITE_INT64 + case DbType.DFloat + iDbType = REALSQLPreparedStatement.SQLITE_DOUBLE + case else + break 'unsupported type + end select + #endif + + end select + + + stmt.BindType(i, iDbType) + + if oField.IsKey and v.IntegerValue<=0 then + 'if the field is a key and it's 0 or less, then set it to NULL + BindNull(stmt, i) + + elseif pi.PropertyType.Name="Date" or (pi.PropertyType.Name="Variant" and v.Type=Variant.TypeDate) then + + dim dt as Date = v.DateValue + if dt=nil then + BindNull(stmt, i) + else + dim dt1 as new Date + dt1.GMTOffset = dt.GMTOffset + dt1.TotalSeconds = dt.TotalSeconds + v = dt1 'copied for the saved value + + dim dt2 as new Date + dt2.GMTOffset = dt.GMTOffset + dt2.TotalSeconds = dt.TotalSeconds + dt2.GMTOffset = 0 + dt = dt2 + + if oField.enFieldType=BKS_ActiveRecord.DbType.DDate then + stmt.Bind(i, dt.SQLDate) + elseif oField.enFieldType=BKS_ActiveRecord.DbType.DTimestamp then + stmt.Bind(i, dt.SQLDateTime) + else + stmt.Bind(i, dt.SQLDateTime) + end if + end if + + elseif pi.PropertyType.Name="Double" and v.DoubleValue = BKS_ActiveRecord.kDoubleNullSentinal then + BindNull(stmt, i) + else + stmt.Bind(i, v) + end if + + dictFieldValue.Value(pi.Name) = v + + next + + return dictFieldValue + End Function + + 134217984 + + 33 + 0 + stmt as PreparedSQLStatement, oRecord as BKS_ActiveRecord.Base, aroField() as BKS_ActiveRecord.P.FieldInfo + Dictionary + + + CommitTransaction + + 1 + + 134217984 + Sub CommitTransaction() + Db.Commit + End Sub + + 134217984 + + 0 + 0 + + + + + Constructor + + 1 + + 134217984 + Sub Constructor() + 'Empty + End Sub + + 134217984 + + 1 + 0 + + + + + Db + + 1 + + 134217984 + Function Db() As Database + BKS_Debug.Assert( false, "needs to be implemented in subclass" ) + End Function + + 134217984 + + 0 + 0 + + Database + + + DeleteRecord + + 1 + + 134217984 + Sub DeleteRecord(oRecord as BKS_ActiveRecord.Base) + dim sql as string + dim oTableInfo as BKS_ActiveRecord.P.TableInfo + + oTableInfo = GetTableInfo( Introspection.GetType(oRecord) ) + + sql = "DELETE FROM " + oTableInfo.sTableName + _ + " WHERE " + oTableInfo.sPrimaryKey + "=?" + + dim stmt as PreparedSQLStatement + stmt = db.Prepare(sql) + BindId(stmt, 0, oRecord.ID) + + stmt.SQLExecute + if db.Error then + raise new BKS_ActiveRecord.DatabaseException(db) + end if + End Sub + + 134217984 + + 0 + 0 + oRecord as BKS_ActiveRecord.Base + + + + GetLastInsertID + + 1 + + 134217984 + Function GetLastInsertID() As Int64 + BKS_Debug.Assert( false, "needs to be implemented in subclass" ) + End Function + + 134217984 + + 1 + 0 + + Int64 + + + HasTable + + 1 + + 134217984 + Function HasTable(sTableName as String) As boolean + dim rs as RecordSet + rs = Db.TableSchema + while not rs.EOF + if rs.IdxField(1).StringValue = sTableName then + return true + end if + rs.MoveNext + wend + return false + End Function + + 134217984 + + 0 + 0 + sTableName as String + boolean + + + InsertRecord + + 1 + + 134217984 + Function InsertRecord(oRecord as BKS_ActiveRecord.Base, byref dictSavedPropertyValue as Dictionary) As Int64 + dim oTableInfo as BKS_ActiveRecord.P.TableInfo + + dim dictFieldValue as Dictionary + + oTableInfo = GetTableInfo( Introspection.GetType(oRecord) ) + + dim arsField() as string + dim arsPlaceholder() as string + dim aroField() as BKS_ActiveRecord.P.FieldInfo + + for each oField as BKS_ActiveRecord.P.FieldInfo in oTableInfo.aroField + if oField.bPrimaryKey then + continue + end if + arsField.Append(oField.sFieldName) + arsPlaceholder.Append("?") + aroField.Append(oField) + next + + dim sql as string + sql = "INSERT INTO " + oTableInfo.sTableName + sql = sql + "(" + Join(arsField, ",") + ")" + sql = sql + " VALUES " + sql = sql + "(" + Join(arsPlaceholder, ",") + ")" + + dim stmt as PreparedSQLStatement + stmt = db.Prepare(sql) + + dictFieldValue = BindValues(stmt, oRecord, aroField) + + stmt.SQLExecute + if db.Error then + raise new BKS_ActiveRecord.DatabaseException(db) + end if + + dim iRecordID as Int64 = GetLastInsertID + dictFieldValue.Value( oTableInfo.piPrimaryKey.Name ) = iRecordID + + 'store the newly saved property values + dictSavedPropertyValue = dictFieldValue + + return iRecordID + End Function + + 134217984 + + 0 + 0 + oRecord as BKS_ActiveRecord.Base, byref dictSavedPropertyValue as Dictionary + Int64 + + + RollbackTransaction + + 1 + + 134217984 + Sub RollbackTransaction() + Db.Rollback + End Sub + + 134217984 + + 0 + 0 + + + + + SelectList + + 1 + + 134217984 + Function SelectList(sTable as string, sCondition as string = "", sOrder as string = "") As RecordSet + dim sSQL as string = "SELECT * FROM " + sTable + " " + if sCondition<>"" then + sSQL = sSQL + "WHERE " + sCondition + end if + + if sOrder<>"" then + sSQL = sSQL + " ORDER BY " + sOrder + end if + sSQL = sSQL + ";" + + return SQLSelect(sSQL) + End Function + + 134217984 + + 0 + 0 + sTable as string, sCondition as string = "", sOrder as string = "" + RecordSet + + + SelectRecord + + 1 + + 134217984 + Function SelectRecord(oRecord as BKS_ActiveRecord.Base, iRecordID as integer) As RecordSet + dim sql as string + dim rs as RecordSet + dim oTableInfo as BKS_ActiveRecord.P.TableInfo + oTableInfo = GetTableInfo( Introspection.GetType(oRecord) ) + + sql = "SELECT * FROM " + oTableInfo.sTableName + _ + " WHERE " + oTableInfo.sPrimaryKey + "=?" + + dim stmt as PreparedSQLStatement + stmt = db.Prepare(sql) + BindId(stmt, 0, iRecordID) + + rs = stmt.SQLSelect + if db.Error then + raise new BKS_ActiveRecord.DatabaseException(db) + end if + + return rs + End Function + + 134217984 + + 0 + 0 + oRecord as BKS_ActiveRecord.Base, iRecordID as integer + RecordSet + + + SQLExecute + + 1 + + 134217984 + Sub SQLExecute(sql as String) + db.SQLExecute( sql ) + if db.Error then + raise new BKS_ActiveRecord.DatabaseException( db, sql ) + end if + End Sub + + 134217984 + + 0 + 0 + sql as String + + + + SQLSelect + + 1 + + 134217984 + Function SQLSelect(sql as String) As RecordSet + dim rs as RecordSet = db.SQLSelect( sql ) + if db.Error then + raise new BKS_ActiveRecord.DatabaseException( db, sql ) + end if + return rs + End Function + + 134217984 + + 0 + 0 + sql as String + RecordSet + + + UpdateRecord + + 1 + + 134217984 + Sub UpdateRecord(oRecord as BKS_ActiveRecord.Base, byref dictSavedPropertyValue as Dictionary) + dim oTableInfo as BKS_ActiveRecord.P.TableInfo + + dim dictFieldValue as Dictionary + + oTableInfo = GetTableInfo( Introspection.GetType(oRecord) ) + + dim arsField() as string + dim aroField() as BKS_ActiveRecord.P.FieldInfo + dim oPrimaryKeyField as BKS_ActiveRecord.P.FieldInfo + + for each oField as BKS_ActiveRecord.P.FieldInfo in oTableInfo.aroField + if oField.bPrimaryKey then + oPrimaryKeyField = oField + continue + end if + arsField.Append(oField.sFieldName + "=?") + aroField.Append(oField) + next + dim sql as string + sql = "UPDATE " + oTableInfo.sTableName + " SET " + sql = sql + Join(arsField, ",") + sql = sql + " WHERE " + oTableInfo.sPrimaryKey + "=?" + + dim stmt as PreparedSQLStatement + stmt = db.Prepare(sql) + + aroField.Append(oPrimaryKeyField) + dictFieldValue = BindValues(stmt, oRecord, aroField) + + stmt.SQLExecute + if db.Error then + raise new BKS_ActiveRecord.DatabaseException(db) + end if + + 'store the newly saved property values + dictSavedPropertyValue = dictFieldValue + End Sub + + 134217984 + + 0 + 0 + oRecord as BKS_ActiveRecord.Base, byref dictSavedPropertyValue as Dictionary + + + + + Name + 1 + ID + Object + + + Index + 1 + ID + -2147483648 + Object + + + Super + 1 + ID + Object + + + Left + 1 + Position + 0 + Object + + + Top + 1 + Position + 0 + Object + + + + + DatabaseException + 618102619 + 1 + RuntimeException + 1 + 0 + + + Constructor + + 1 + + 134217984 + Sub Constructor(db as Database, sql as string = "") + if db.Error then + ErrorCode = db.ErrorCode + ErrorMessage = db.ErrorMessage + Message = Str( ErrorCode ) + ": " + ErrorMessage + else + ErrorMessage = "Unknown error" + end if + + if sql <> "" then + Message = Message + EndOfLine + " " + sql + end if + End Sub + + 134217984 + + 0 + 0 + db as Database, sql as string = "" + + + + Constructor + + 1 + + 134217984 + Sub Constructor(sMessage as string, sSQL as string) + if sMessage <> "" then + me.Message = sMessage + end if + + if sSQL <> "" then + me.Message = me.Message + EndOfLine + " " + sSQL + end + End Sub + + 134217984 + + 0 + 0 + sMessage as string, sSQL as string + + + + ErrorCode + + 1 + + 134217984 + ErrorCode As Integer + + + 134217984 + ErrorCode As Integer + 0 + 0 + + + ErrorMessage + + 1 + + 134217984 + ErrorMessage As string + + + 134217984 + ErrorMessage As string + 0 + 0 + + + + Name + 1 + ID + Object + + + Index + 1 + ID + -2147483648 + Object + + + Super + 1 + ID + Object + + + Left + 1 + Position + 0 + Object + + + Top + 1 + Position + 0 + Object + + + Message + Behavior + String + MultiLineEditor + RuntimeException + + + ErrorNumber + Behavior + 0 + Integer + RuntimeException + + + ErrorCode + Behavior + 0 + Integer + + + ErrorMessage + Behavior + string + MultiLineEditor + + + + + ActiveRecordException + 618102619 + 1 + RuntimeException + 1 + 0 + + + Constructor + + 1 + + 134217984 + Sub Constructor(s as String) + self.Message = s + End Sub + + 134217984 + + 4096 + 0 + s as String + + + + + Name + 1 + ID + Object + + + Index + 1 + ID + -2147483648 + Object + + + Super + 1 + ID + Object + + + Left + 1 + Position + 0 + Object + + + Top + 1 + Position + 0 + Object + + + Message + Behavior + String + MultiLineEditor + RuntimeException + + + ErrorNumber + Behavior + 0 + Integer + RuntimeException + + + + + Transaction + 618102619 + 1 + 1 + 0 + + + Commit + + 1 + + 134217984 + Sub Commit() + if m_adp=nil then + raise new ActiveRecordException("The transaction was already completed") + end if + m_adp.CommitTransaction + m_adp = nil + End Sub + + 134217984 + + 0 + 0 + + + + + Constructor + + 1 + + 134217984 + Sub Constructor(adp as BKS_ActiveRecord.DatabaseAdapter) + if adp=nil then + raise new ActiveRecordException("Nil argument") + end if + adp.BeginTransaction + m_adp = adp + End Sub + + 134217984 + + 0 + 0 + adp as BKS_ActiveRecord.DatabaseAdapter + + + + Destructor + + 1 + + 134217984 + Sub Destructor() + 'If the user hasn't explictly committed the transaction then do a rollback + if m_adp<>nil then + m_adp.RollbackTransaction + m_adp = nil + end if + End Sub + + 134217984 + + 0 + 0 + + + + + Rollback + + 1 + + 134217984 + Sub Rollback() + if m_adp=nil then + raise new ActiveRecordException("The transaction was already completed") + end if + m_adp.RollbackTransaction + m_adp = nil + End Sub + + 134217984 + + 0 + 0 + + + + + m_adp + + 1 + + 134217984 + m_adp As BKS_ActiveRecord.DatabaseAdapter + + + 134217984 + m_adp As BKS_ActiveRecord.DatabaseAdapter + 33 + 0 + + + + Name + 1 + ID + Object + + + Index + 1 + ID + -2147483648 + Object + + + Super + 1 + ID + Object + + + Left + 1 + Position + 0 + Object + + + Top + 1 + Position + 0 + Object + + + + + OracleAdapter + 618102619 + 1 + BKS_ActiveRecord.DatabaseAdapter + 1 + 0 + + + Constructor + + 1 + + 134217984 + Sub Constructor(oDb as Object) + 'If you are not connecting to Oracle and do not have the OraclePlugin plugin delete this class (OracleAdapter) + #if BKS_ActiveRecordConfig.kIncludeOracle + dim db as OracleDatabase = OracleDatabase(oDb) + if db=nil then + raise new RuntimeException + end if + m_db = db + #else + raise new UnsupportedOperationException + #endif + End Sub + + 134217984 + + 0 + 0 + oDb as Object + + + + Db + + 1 + + 134217984 + Function Db() As Database + return m_db + End Function + + 134217984 + + 0 + 0 + + Database + + + GetLastInsertID + + 1 + + 134217984 + Function GetLastInsertID() As Int64 + dim rs as RecordSet + rs = SQLSelect("SELECT LASTVAL();") + return rs.IdxField(1).Int64Value + End Function + + 134217984 + + 1 + 0 + + Int64 + + + Note + + 1 + + 134217984 + Note + If you are not connecting to Oracle and do not have the OraclePlugin plugin delete this class (OracleAdapter) + + 0 + + + m_db + + 1 + + 134217984 + m_db As Database + + + 134217984 + m_db As Database + 33 + 0 + + + + Name + 1 + ID + Object + + + Index + 1 + ID + -2147483648 + Object + + + Super + 1 + ID + Object + + + Left + 1 + Position + 0 + Object + + + Top + 1 + Position + 0 + Object + + + + + cubeSQLDatabaseAdapter + 618102619 + 1 + BKS_ActiveRecord.DatabaseAdapter + 1 + 0 + + + BeginTransaction + + 1 + + 134217984 + Sub BeginTransaction() + 'If you are not connecting to CubeSQLServer and do not have the CubeSQLServer plugin delete this class (cubeSQLDatabaseAdapter) + #if BKS_ActiveRecordConfig.kIncludeCubeDatabase + dim db as CubeSQLServer = CubeSQLServer(m_db) + if m_iTransactionCt=0 and not db.AutoCommit then + try + m_db.Commit 'commit the auto transaction + catch ex as RuntimeException + 'ignore this one + end try + end if + + if m_iTransactionCt=0 then + SQLExecute( "BEGIN" ) + end if + m_iTransactionCt = m_iTransactionCt + 1 + #endif + End Sub + + 134217984 + + 0 + 0 + + + + + BindValues + + 1 + + 134217984 + Function BindValues(oStmt as Object, oRecord as BKS_ActiveRecord.Base, aroField() as BKS_ActiveRecord.P.FieldInfo) As Dictionary + // Overriding the parent class ... + #if BKS_ActiveRecordConfig.kIncludeCubeDatabase + dim stmt as cubeSQLVM = cubeSQLVM(oStmt) + dim dictFieldValue as new Dictionary + + for i as integer = 0 to aroField.Ubound + dim oField as BKS_ActiveRecord.P.FieldInfo = aroField(i) + dim pi as Introspection.PropertyInfo = oField.piFieldProperty + dim v as Variant = pi.Value(oRecord) + + dim iDbType as integer + select case aroField(i).enFieldType + case DbType.DInteger + iDbType = REALSQLPreparedStatement.SQLITE_INTEGER + case DbType.DSmallInt + iDbType = REALSQLPreparedStatement.SQLITE_INTEGER + case DbType.DDouble + iDbType = REALSQLPreparedStatement.SQLITE_DOUBLE + case DbType.DDate + iDbType = REALSQLPreparedStatement.SQLITE_TEXT + case DbType.DTime + iDbType = REALSQLPreparedStatement.SQLITE_TEXT + case DbType.DTimestamp + iDbType = REALSQLPreparedStatement.SQLITE_TEXT + case DbType.DBoolean + iDbType = REALSQLPreparedStatement.SQLITE_BOOLEAN + case DbType.DBlob + iDbType = REALSQLPreparedStatement.SQLITE_BLOB + case DbType.DText + iDbType = REALSQLPreparedStatement.SQLITE_TEXT + case DbType.DInt64 + iDbType = REALSQLPreparedStatement.SQLITE_INT64 + case DbType.DFloat + iDbType = REALSQLPreparedStatement.SQLITE_DOUBLE + case else + break 'unsupported type + end select + + + if oField.IsKey and v.IntegerValue<=0 then + 'if the field is a key and it's 0 or less, then set it to NULL + iDBType = REALSQLPreparedStatement.SQLITE_NULL + elseif pi.PropertyType.Name="Date" or _ + (pi.PropertyType.Name="Variant" and v.Type=Variant.TypeDate) then + dim dt as Date = v.DateValue + if dt=nil then + iDBType = REALSQLPreparedStatement.SQLITE_NULL + else + dim dt1 as new Date + dt1.GMTOffset = dt.GMTOffset + dt1.TotalSeconds = dt.TotalSeconds + v = dt1 'copied for the saved value + + dim dt2 as new Date + dt2.GMTOffset = dt.GMTOffset + dt2.TotalSeconds = dt.TotalSeconds + dt2.GMTOffset = 0 + dt = dt2 + + if oField.enFieldType=BKS_ActiveRecord.DbType.DDate then + iDBType = REALSQLPreparedStatement.SQLITE_TEXT + elseif oField.enFieldType=BKS_ActiveRecord.DbType.DTimestamp then + iDBType = REALSQLPreparedStatement.SQLITE_TEXT + else + iDBType = REALSQLPreparedStatement.SQLITE_TEXT + end if + end if + elseif pi.PropertyType.Name="Double" and _ + v.DoubleValue = BKS_ActiveRecord.kDoubleNullSentinal then + iDBType = REALSQLPreparedStatement.SQLITE_NULL + else + // stmt.Bind(i, v) + end if + dictFieldValue.Value(pi.Name) = v + + select case iDbType + case REALSQLPreparedStatement.SQLITE_INTEGER + stmt.BindInt(i + 1, v.IntegerValue) + + case REALSQLPreparedStatement.SQLITE_DOUBLE + stmt.BindDouble(i + 1, v.DoubleValue) + + case REALSQLPreparedStatement.SQLITE_TEXT + stmt.BindText(i + 1, v.StringValue) + + case REALSQLPreparedStatement.SQLITE_BOOLEAN + stmt.BindInt(i + 1, v.IntegerValue) + + case REALSQLPreparedStatement.SQLITE_BLOB + stmt.BindBlob(i + 1, v) + + case REALSQLPreparedStatement.SQLITE_INT64 + stmt.BindInt64(i + 1, v.Int64Value) + + end select + next + + return dictFieldValue + #endif + End Function + + 134217984 + + 33 + 0 + oStmt as Object, oRecord as BKS_ActiveRecord.Base, aroField() as BKS_ActiveRecord.P.FieldInfo + Dictionary + + + CommitTransaction + + 1 + + 134217984 + Sub CommitTransaction() + m_iTransactionCt = m_iTransactionCt - 1 + if m_iTransactionCt=0 then + Db.Commit + if db.Error then + dim ex as new BKS_ActiveRecord.DatabaseException(db, "Commit") + db.Rollback + raise ex + end if + end if + End Sub + + 134217984 + + 0 + 0 + + + + + Constructor + + 1 + + 134217984 + Sub Constructor(oDb as Object) + #if BKS_ActiveRecordConfig.kIncludeCubeDatabase + dim db as CubeSQLServer = CubeSQLServer(oDb) + if db=nil then + raise new RuntimeException + end if + m_db = db + #else + dim ex as new UnsupportedOperationException + ex.Message = "CubeSQL is not enabled" + raise ex + #endif + End Sub + + 134217984 + + 0 + 0 + oDb as Object + + + + Db + + 1 + + 134217984 + Function Db() As Database + return m_db + End Function + + 134217984 + + 0 + 0 + + Database + + + DeleteRecord + + 1 + + 134217984 + Sub DeleteRecord(oRecord as BKS_ActiveRecord.Base) + #if BKS_ActiveRecordConfig.kIncludeCubeDatabase + dim db as CubeSQLServer = CubeSQLServer(m_db) + dim sql as string + dim oTableInfo as BKS_ActiveRecord.P.TableInfo + + oTableInfo = GetTableInfo( Introspection.GetType(oRecord) ) + + sql = "DELETE FROM " + oTableInfo.sTableName + _ + " WHERE " + oTableInfo.sPrimaryKey + "=?1" + + dim stmt as CubeSQLVM + stmt = db.VMPrepare(sql) + stmt.BindInt64(1, oRecord.ID) + + stmt.VMExecute + if db.Error then + raise new BKS_ActiveRecord.DatabaseException(db) + end if + + #endif + End Sub + + 134217984 + + 0 + 0 + oRecord as BKS_ActiveRecord.Base + + + + GetLastInsertID + + 1 + + 134217984 + Function GetLastInsertID() As Int64 + #if BKS_ActiveRecordConfig.kIncludeCubeDatabase + dim db as CubeSQLServer = CubeSQLServer(m_db) + return db.LastRowID + #endif + End Function + + 134217984 + + 1 + 0 + + Int64 + + + InsertRecord + + 1 + + 134217984 + Function InsertRecord(oRecord as BKS_ActiveRecord.Base, byref dictSavedPropertyValue as Dictionary) As Int64 + // Overriding the parent class ... + #if BKS_ActiveRecordConfig.kIncludeCubeDatabase + dim db as CubeSQLServer = CubeSQLServer(m_db) + dim oTableInfo as BKS_ActiveRecord.P.TableInfo + + dim dictFieldValue as Dictionary + + oTableInfo = GetTableInfo( Introspection.GetType(oRecord) ) + + dim arsField() as string + dim arsPlaceholder() as string + dim aroField() as BKS_ActiveRecord.P.FieldInfo + + dim i as integer + for each oField as BKS_ActiveRecord.P.FieldInfo in oTableInfo.aroField + if oField.bPrimaryKey then + continue + end if + arsField.Append(oField.sFieldName) + + i = i + 1 + arsPlaceholder.Append("?" + str(i)) + aroField.Append(oField) + next + dim sql as string + sql = "INSERT INTO " + oTableInfo.sTableName + sql = sql + "(" + Join(arsField, ",") + ")" + sql = sql + " VALUES " + sql = sql + "(" + Join(arsPlaceholder, ",") + ")" + + dim stmt as CubeSQLVM + stmt = db.VMPrepare(sql) + + dictFieldValue = BindValues(stmt, oRecord, aroField) + + stmt.VMExecute + if db.Error then + raise new BKS_ActiveRecord.DatabaseException(db) + end if + + dim iRecordID as Int64 = GetLastInsertID + dictFieldValue.Value( oTableInfo.piPrimaryKey.Name ) = iRecordID + + 'store the newly saved property values + dictSavedPropertyValue = dictFieldValue + + return iRecordID + #endif + End Function + + 134217984 + + 0 + 0 + oRecord as BKS_ActiveRecord.Base, byref dictSavedPropertyValue as Dictionary + Int64 + + + RollbackTransaction + + 1 + + 134217984 + Sub RollbackTransaction() + m_iTransactionCt = m_iTransactionCt - 1 + if m_iTransactionCt=0 then + Db.Rollback + end if + End Sub + + 134217984 + + 0 + 0 + + + + + SelectRecord + + 1 + + 134217984 + Function SelectRecord(oRecord as BKS_ActiveRecord.Base, iRecordID as Int64) As RecordSet + // Overriding the parent class ... + #if BKS_ActiveRecordConfig.kIncludeCubeDatabase + dim db as CubeSQLServer = CubeSQLServer(m_db) + dim sql as string + dim rs as RecordSet + dim oTableInfo as BKS_ActiveRecord.P.TableInfo + oTableInfo = GetTableInfo( Introspection.GetType(oRecord) ) + + sql = "SELECT * FROM " + oTableInfo.sTableName + _ + " WHERE " + oTableInfo.sPrimaryKey + "=?1" + + dim stmt as CubeSQLVM + stmt = db.VMPrepare(sql) + // stmt.BindType(0, REALSQLPreparedStatement.SQLITE_INT64) + stmt.BindInt64(1, iRecordID) + + rs = stmt.VMSelect + if db.Error then + raise new BKS_ActiveRecord.DatabaseException(db) + end if + + return rs + #endif + End Function + + 134217984 + + 0 + 0 + oRecord as BKS_ActiveRecord.Base, iRecordID as Int64 + RecordSet + + + UpdateRecord + + 1 + + 134217984 + Sub UpdateRecord(oRecord as BKS_ActiveRecord.Base, byref dictSavedPropertyValue as Dictionary) + // Overriding the parent class ... + #if BKS_ActiveRecordConfig.kIncludeCubeDatabase + dim db as CubeSQLServer = CubeSQLServer(m_db) + dim oTableInfo as BKS_ActiveRecord.P.TableInfo + + dim dictFieldValue as Dictionary + + oTableInfo = GetTableInfo( Introspection.GetType(oRecord) ) + + dim arsField() as string + dim aroField() as BKS_ActiveRecord.P.FieldInfo + dim oPrimaryKeyField as BKS_ActiveRecord.P.FieldInfo + + dim i as integer + + for each oField as BKS_ActiveRecord.P.FieldInfo in oTableInfo.aroField + if oField.bPrimaryKey then + oPrimaryKeyField = oField + continue + end if + i = i + 1 + arsField.Append(oField.sFieldName + "=?" + str(i)) + aroField.Append(oField) + + next + dim sql as string + sql = "UPDATE " + oTableInfo.sTableName + " SET " + sql = sql + Join(arsField, ",") + sql = sql + " WHERE " + oTableInfo.sPrimaryKey + "=?" + + dim stmt as CubeSQLVM + stmt = db.VMPrepare(sql) + + aroField.Append(oPrimaryKeyField) + dictFieldValue = me.BindValues(stmt, oRecord, aroField) + + stmt.VMExecute + if db.Error then + raise new BKS_ActiveRecord.DatabaseException(db) + end if + + 'store the newly saved property values + dictSavedPropertyValue = dictFieldValue + #endif + End Sub + + 134217984 + + 0 + 0 + oRecord as BKS_ActiveRecord.Base, byref dictSavedPropertyValue as Dictionary + + + + CubeSQLServer + + 1 + + 134217984 + CubeSQLServer + If you are not connecting to CubeSQLServer and + do not have the CubeSQLServer plugin delete this class (cubeSQLDatabaseAdapter) + + 0 + + + m_db + + 1 + + 134217984 + m_db As Database + + + 134217984 + m_db As Database + 33 + 0 + + + m_iTransactionCt + + 1 + + 134217984 + m_iTransactionCt As Integer + + + 134217984 + m_iTransactionCt As Integer + 33 + 0 + + + + Name + 1 + ID + Object + + + Index + 1 + ID + -2147483648 + Object + + + Super + 1 + ID + Object + + + Left + 1 + Position + 0 + Object + + + Top + 1 + Position + 0 + Object + + + + + BKS_Database + 0 + 0 + 1 + 0 + + + SQLExecuteRaiseOnError + + 1 + + 134217984 + Sub SQLExecuteRaiseOnError(extends db as Database, sql as String) + db.SQLExecute( sql ) + if db.Error then + raise new BKS_Database.DatabaseException( db.ErrorMessage, sql ) + end if + End Sub + + 134217984 + + 0 + 0 + extends db as Database, sql as String + + + + SQLSelectRaiseOnError + + 1 + + 134217984 + Function SQLSelectRaiseOnError(extends db as Database, sql as String) As RecordSet + dim rs as RecordSet = db.SQLSelect( sql ) + if db.Error then + raise new BKS_Database.DatabaseException( db.ErrorMessage, sql ) + end if + return rs + End Function + + 134217984 + + 0 + 0 + extends db as Database, sql as String + RecordSet + + + + Name + 1 + ID + Object + + + Index + 1 + ID + -2147483648 + Object + + + Super + 1 + ID + Object + + + Left + 1 + Position + 0 + Object + + + Top + 1 + Position + 0 + Object + + + + + DatabaseException + 147339697 + 1 + RuntimeException + 1 + 0 + + + Constructor + + 1 + + 134217984 + Sub Constructor(db as Database, sql as string = "") + if db.Error then + ErrorCode = db.ErrorCode + ErrorMessage = db.ErrorMessage + Message = Str( ErrorCode ) + ": " + ErrorMessage + else + ErrorMessage = "Unknown error" + end if + + if sql <> "" then + Message = Message + EndOfLine + " " + sql + end if + End Sub + + 134217984 + + 0 + 0 + db as Database, sql as string = "" + + + + Constructor + + 1 + + 134217984 + Sub Constructor(sMessage as string, sSQL as string) + if sMessage <> "" then + me.Message = sMessage + end if + + if sSQL <> "" then + me.Message = me.Message + EndOfLine + " " + sSQL + end + End Sub + + 134217984 + + 0 + 0 + sMessage as string, sSQL as string + + + + ErrorCode + + 1 + + 134217984 + ErrorCode As Integer + + + 134217984 + ErrorCode As Integer + 0 + 0 + + + ErrorMessage + + 1 + + 134217984 + ErrorMessage As string + + + 134217984 + ErrorMessage As string + 0 + 0 + + + + Name + 1 + ID + Object + + + Index + 1 + ID + -2147483648 + Object + + + Super + 1 + ID + Object + + + Left + 1 + Position + 0 + Object + + + Top + 1 + Position + 0 + Object + + + Message + Behavior + String + MultiLineEditor + RuntimeException + + + ErrorNumber + Behavior + 0 + Integer + RuntimeException + + + ErrorCode + Behavior + 0 + Integer + + + ErrorMessage + Behavior + string + MultiLineEditor + + + + + BKS_Core + 0 + + + BKS_Debug + 1986983246 + 0 + 1 + 0 + + + Assert + + 1 + + 134217984 + Sub Assert(bCondition as boolean, sMessage as string = "") + #if DebugBuild then + if not bCondition then + Raise new BKS_AssertFailedException(sMessage) + end if + #endif + End Sub + + 134217984 + + 1 + 0 + bCondition as boolean, sMessage as string = "" + + + + + Name + 1 + ID + Object + + + Index + 1 + ID + -2147483648 + Object + + + Super + 1 + ID + Object + + + Left + 1 + Position + 0 + Object + + + Top + 1 + Position + 0 + Object + + + + + BKS_AssertFailedException + 1856721478 + 1 + RuntimeException + 1 + 0 + + + Constructor + + 1 + + 134217984 + Sub Constructor(sMessage as string) + if sMessage <> "" then + Me.Message = sMessage + end if + End Sub + + 134217984 + + 0 + 0 + sMessage as string + + + + + Name + 1 + ID + Object + + + Index + 1 + ID + -2147483648 + Object + + + Super + 1 + ID + Object + + + Left + 1 + Position + 0 + Object + + + Top + 1 + Position + 0 + Object + + + Message + Behavior + String + MultiLineEditor + RuntimeException + + + ErrorNumber + Behavior + 0 + Integer + RuntimeException + + + + + + + 0 + 448 + 3 + 1 + + (Home) + + + + + +BKS_ActiveRecordConfig +0 +0 +1 +0 + + +kIncludeCubeDatabase + +1 +134217984 +kIncludeCubeDatabase +3 +False +1 + + +kIncludeMSSQLServer + +1 +134217984 +kIncludeMSSQLServer +3 +False +1 + + +kIncludeMySQLCommunityServer + +1 +134217984 +kIncludeMySQLCommunityServer +3 +True +1 + + +kIncludeOracle + +1 +134217984 +kIncludeOracle +3 +False +1 + + +kIncludePostgreSQLDatabase + +1 +134217984 +kIncludePostgreSQLDatabase +3 +False +1 + + +kIncludeREALSQLDatabase + +1 +134217984 +kIncludeREALSQLDatabase +3 +False +1 + + +kIncludeSQLiteDatabase + +1 +134217984 +kIncludeSQLiteDatabase +3 +False +1 + + + +DataFile +0 +0 +1 +0 + + +Register + +1 + +134217984 +Sub Register(db as MySQLCommunityServer) +BKS_ActiveRecord.Table( db, "tbl_auslieferungsliste", GetTypeInfo( tbl_auslieferungsliste ) ) +BKS_ActiveRecord.Table( db, "tbl_auslieferungsschein_bestellung", GetTypeInfo( tbl_auslieferungsschein_bestellung ) ) +BKS_ActiveRecord.Table( db, "tbl_auslieferungsscheine", GetTypeInfo( tbl_auslieferungsscheine ) ) +BKS_ActiveRecord.Table( db, "tbl_benutzer", GetTypeInfo( tbl_benutzer ) ) +BKS_ActiveRecord.Table( db, "tbl_bestellungen", GetTypeInfo( tbl_bestellungen ) ) +BKS_ActiveRecord.Table( db, "tbl_cmr", GetTypeInfo( tbl_cmr ) ) +BKS_ActiveRecord.Table( db, "tbl_coa", GetTypeInfo( tbl_coa ) ) +BKS_ActiveRecord.Table( db, "tbl_coa_bestellung", GetTypeInfo( tbl_coa_bestellung ) ) +BKS_ActiveRecord.Table( db, "tbl_hilfswerte_coa", GetTypeInfo( tbl_hilfswerte_coa ) ) +BKS_ActiveRecord.Table( db, "tbl_kunden", GetTypeInfo( tbl_kunden ) ) +BKS_ActiveRecord.Table( db, "tbl_kunden_adressen", GetTypeInfo( tbl_kunden_adressen ) ) +BKS_ActiveRecord.Table( db, "tbl_laenderkennungen", GetTypeInfo( tbl_laenderkennungen ) ) +BKS_ActiveRecord.Table( db, "tbl_mikrobiologie", GetTypeInfo( tbl_mikrobiologie ) ) +BKS_ActiveRecord.Table( db, "tbl_mikrobiologie_auslieferungsschein", GetTypeInfo( tbl_mikrobiologie_auslieferungsschein ) ) +BKS_ActiveRecord.Table( db, "tbl_mikrobiologie_bestellung", GetTypeInfo( tbl_mikrobiologie_bestellung ) ) +BKS_ActiveRecord.Table( db, "tbl_paletten", GetTypeInfo( tbl_paletten ) ) +BKS_ActiveRecord.Table( db, "tbl_speditionen", GetTypeInfo( tbl_speditionen ) ) +BKS_ActiveRecord.Table( db, "tbl_speditionen_adressen", GetTypeInfo( tbl_speditionen_adressen ) ) +BKS_ActiveRecord.Table( db, "tbl_transport_ust", GetTypeInfo( tbl_transport_ust ) ) +BKS_ActiveRecord.Table( db, "tbl_verpackungen", GetTypeInfo( tbl_verpackungen ) ) +BKS_ActiveRecord.Table( db, "tbl_werk", GetTypeInfo( tbl_werk ) ) +BKS_ActiveRecord.Table( db, "tbl_zusammengefasste_bestellungen", GetTypeInfo( tbl_zusammengefasste_bestellungen ) ) +End Sub + +134217984 + +33 +0 +db as MySQLCommunityServer + + + gDB 1 134217984 gDB As MySQLCommunityServer 134217984 gDB As MySQLCommunityServer 0 0 + + OpenDB + + 1 + + 134217984 + Function OpenDB() As Boolean + dim db as new MySQLCommunityServer + + db.Host = "localhost" + db.Port = 3306 + db.DatabaseName = "steinickev4" + db.UserName = "root" + db.Password = "test" //think about obfuscating this string + + if db.Connect = false then + MsgBox "Couldn't Connect" + EndOfLine + db.ErrorMessage + return false + end + + gDB = db + + //Important to tell ActiveRecord what the connection is! + BKS_ActiveRecord.Connect( gdb ) + + //Make any db updates here before registering + + //Register the tables with ActiveRecord + Register( gdb ) + + return true + End Function + + 134217984 + + 0 + 0 + + Boolean + + CloseDB 1 134217984 Sub CloseDB() if gDB <> nil then gDB.close end End Sub 134217984 0 0 + + +ActiveRecordBase +460902990 +1 +BKS_ActiveRecord.Base +1 +0 + + + +tbl_auslieferungsliste +460902990 +1 +DataFile.ActiveRecordBase +1 +0 + + +bestellung_uid + +1 + +134217984 +bestellung_uid As Integer + + +134217984 +bestellung_uid As Integer +0 +0 + + +benutzerwerk_uid + +1 + +134217984 +benutzerwerk_uid As Integer + + +134217984 +benutzerwerk_uid As Integer +0 +0 + + +checked + +1 + +134217984 +checked As Integer + + +134217984 +checked As Integer +0 +0 + + +kunden_titel + +1 + +134217984 +kunden_titel As String + + +134217984 +kunden_titel As String +0 +0 + + +artikel_bezeichnung + +1 + +134217984 +artikel_bezeichnung As String + + +134217984 +artikel_bezeichnung As String +0 +0 + + +artikel_nummer_intern + +1 + +134217984 +artikel_nummer_intern As String + + +134217984 +artikel_nummer_intern As String +0 +0 + + +abruf_nummer + +1 + +134217984 +abruf_nummer As String + + +134217984 +abruf_nummer As String +0 +0 + + +menge + +1 + +134217984 +menge As Double + + +134217984 +menge As Double +0 +0 + + +auslieferungsdatum + +1 + +134217984 +auslieferungsdatum As Date + + +134217984 +auslieferungsdatum As Date +0 +0 + + +bemerkungen + +1 + +134217984 +bemerkungen As String + + +134217984 +bemerkungen As String +0 +0 + + +system_created + +1 + +134217984 +system_created As Date + + +134217984 +system_created As Date +0 +0 + + List 1 134217984 Shared Function List(sCriteria as string = "", sOrderBy as string = "") As DataFile.tbl_auslieferungsliste() //Usage: // dim arotbl_auslieferungsliste() as DataFile.tbl_auslieferungsliste = DataFile.tbl_auslieferungsliste.List("fieldName = somevalue", "fieldName") dim arotbl_auslieferungsliste() as DataFile.tbl_auslieferungsliste dim s as string s = "select * From tbl_auslieferungsliste " if sCriteria <> "" then s = s + " WHERE " + sCriteria end if sOrderBy.trim <> "" then s = s + " ORDER BY " + sOrderBy end dim rs as RecordSet = gDB.SQLSelect(s) If gdb.error then break System.debugLog gDB.ErrorMessage return arotbl_auslieferungsliste end do until rs.EOF dim oRecord as new DataFile.tbl_auslieferungsliste oRecord.ReadRecord(rs) arotbl_auslieferungsliste.Append(oRecord) rs.MoveNext loop return arotbl_auslieferungsliste End Function 134217984 0 1 sCriteria as string = "", sOrderBy as string = "" DataFile.tbl_auslieferungsliste() + + FindByID + + 1 + + 134217984 + Shared Function FindByID(id as Integer) As DataFile.tbl_auslieferungsliste + //Usage: + //dim tbl_auslieferungsliste as DataFile.tbl_auslieferungsliste = DataFile.tbl_auslieferungsliste.FindByID( id ) + dim s as string + s = "Select * from tbl_auslieferungsliste WHERE = " + str(id) + + dim rs as RecordSet = gDB.SQLSelect(s) + + if gdb.error then + System.debugLog gDB.ErrorMessage + return nil + end + if rs.RecordCount = 0 then return nil + + dim tbl_auslieferungsliste as new DataFile.tbl_auslieferungsliste + tbl_auslieferungsliste.ReadRecord(rs) + return tbl_auslieferungsliste + + End Function + + 134217984 + + 0 + 1 + id as Integer + DataFile.tbl_auslieferungsliste + + + + +tbl_auslieferungsschein_bestellung +460902990 +1 +DataFile.ActiveRecordBase +1 +0 + + +uid + +1 + +134217984 +uid As Integer + + +134217984 +uid As Integer +0 +0 + + +kunden_uid + +1 + +134217984 +kunden_uid As Integer + + +134217984 +kunden_uid As Integer +0 +0 + + +bestellung_uid + +1 + +134217984 +bestellung_uid As Integer + + +134217984 +bestellung_uid As Integer +0 +0 + + +kunden_titel + +1 + +134217984 +kunden_titel As String + + +134217984 +kunden_titel As String +0 +0 + + +coa_kontakt + +1 + +134217984 +coa_kontakt As String + + +134217984 +coa_kontakt As String +0 +0 + + +artikel_bezeichnung_extern + +1 + +134217984 +artikel_bezeichnung_extern As String + + +134217984 +artikel_bezeichnung_extern As String +0 +0 + + +artikel_bezeichnung_intern + +1 + +134217984 +artikel_bezeichnung_intern As String + + +134217984 +artikel_bezeichnung_intern As String +0 +0 + + +kontrakt_extern + +1 + +134217984 +kontrakt_extern As String + + +134217984 +kontrakt_extern As String +0 +0 + + +kontrakt_intern + +1 + +134217984 +kontrakt_intern As String + + +134217984 +kontrakt_intern As String +0 +0 + + +artikel_nummer_extern + +1 + +134217984 +artikel_nummer_extern As String + + +134217984 +artikel_nummer_extern As String +0 +0 + + +artikel_nummer_intern + +1 + +134217984 +artikel_nummer_intern As String + + +134217984 +artikel_nummer_intern As String +0 +0 + + +spezial_kunde + +1 + +134217984 +spezial_kunde As String + + +134217984 +spezial_kunde As String +0 +0 + + +sensorik1 + +1 + +134217984 +sensorik1 As String + + +134217984 +sensorik1 As String +0 +0 + + +sensorik2 + +1 + +134217984 +sensorik2 As String + + +134217984 +sensorik2 As String +0 +0 + + +sensorik3 + +1 + +134217984 +sensorik3 As String + + +134217984 +sensorik3 As String +0 +0 + + +schnitt_koernung + +1 + +134217984 +schnitt_koernung As String + + +134217984 +schnitt_koernung As String +0 +0 + + +muster + +1 + +134217984 +muster As String + + +134217984 +muster As String +0 +0 + + +schuettgewicht + +1 + +134217984 +schuettgewicht As String + + +134217984 +schuettgewicht As String +0 +0 + + +stampfvolumen + +1 + +134217984 +stampfvolumen As String + + +134217984 +stampfvolumen As String +0 +0 + + +abruf_nummer + +1 + +134217984 +abruf_nummer As String + + +134217984 +abruf_nummer As String +0 +0 + + +farbe + +1 + +134217984 +farbe As String + + +134217984 +farbe As String +0 +0 + + +aussehen + +1 + +134217984 +aussehen As String + + +134217984 +aussehen As String +0 +0 + + +feuchtigkeit + +1 + +134217984 +feuchtigkeit As String + + +134217984 +feuchtigkeit As String +0 +0 + + +sand + +1 + +134217984 +sand As String + + +134217984 +sand As String +0 +0 + + +asche + +1 + +134217984 +asche As String + + +134217984 +asche As String +0 +0 + + +mhd + +1 + +134217984 +mhd As String + + +134217984 +mhd As String +0 +0 + + +bulkindex + +1 + +134217984 +bulkindex As String + + +134217984 +bulkindex As String +0 +0 + + +attribut_auswahl + +1 + +134217984 +attribut_auswahl As String + + +134217984 +attribut_auswahl As String +0 +0 + + +sieb1 + +1 + +134217984 +sieb1 As String + + +134217984 +sieb1 As String +0 +0 + + +sieb2 + +1 + +134217984 +sieb2 As String + + +134217984 +sieb2 As String +0 +0 + + +sieb3 + +1 + +134217984 +sieb3 As String + + +134217984 +sieb3 As String +0 +0 + + +sieb4 + +1 + +134217984 +sieb4 As String + + +134217984 +sieb4 As String +0 +0 + + +sieb5 + +1 + +134217984 +sieb5 As String + + +134217984 +sieb5 As String +0 +0 + + +sieb6 + +1 + +134217984 +sieb6 As String + + +134217984 +sieb6 As String +0 +0 + + +mikrobiologie + +1 + +134217984 +mikrobiologie As String + + +134217984 +mikrobiologie As String +0 +0 + + +statistiknummer + +1 + +134217984 +statistiknummer As String + + +134217984 +statistiknummer As String +0 +0 + + +bemerkung + +1 + +134217984 +bemerkung As String + + +134217984 +bemerkung As String +0 +0 + + +zusatz + +1 + +134217984 +zusatz As String + + +134217984 +zusatz As String +0 +0 + + +menge + +1 + +134217984 +menge As Double + + +134217984 +menge As Double +0 +0 + + +menge_lbs + +1 + +134217984 +menge_lbs As Double + + +134217984 +menge_lbs As Double +0 +0 + + +menge_brutto + +1 + +134217984 +menge_brutto As Double + + +134217984 +menge_brutto As Double +0 +0 + + +verpackung_uid + +1 + +134217984 +verpackung_uid As Integer + + +134217984 +verpackung_uid As Integer +0 +0 + + +verpackung_anzahl + +1 + +134217984 +verpackung_anzahl As Double + + +134217984 +verpackung_anzahl As Double +0 +0 + + +verpackung_gewicht + +1 + +134217984 +verpackung_gewicht As Double + + +134217984 +verpackung_gewicht As Double +0 +0 + + +paletten_uid + +1 + +134217984 +paletten_uid As Integer + + +134217984 +paletten_uid As Integer +0 +0 + + +paletten_anzahl + +1 + +134217984 +paletten_anzahl As Double + + +134217984 +paletten_anzahl As Double +0 +0 + + +palettenverpackung_anzahl + +1 + +134217984 +palettenverpackung_anzahl As Double + + +134217984 +palettenverpackung_anzahl As Double +0 +0 + + +auslieferungs_auftrags_nummer + +1 + +134217984 +auslieferungs_auftrags_nummer As String + + +134217984 +auslieferungs_auftrags_nummer As String +0 +0 + + +fa_nummer + +1 + +134217984 +fa_nummer As String + + +134217984 +fa_nummer As String +0 +0 + + +letzte_lieferung + +1 + +134217984 +letzte_lieferung As Date + + +134217984 +letzte_lieferung As Date +0 +0 + + +auslieferungsdatum + +1 + +134217984 +auslieferungsdatum As Date + + +134217984 +auslieferungsdatum As Date +0 +0 + + +anlieferungsdatum + +1 + +134217984 +anlieferungsdatum As Date + + +134217984 +anlieferungsdatum As Date +0 +0 + + +auslieferungsschein_titel + +1 + +134217984 +auslieferungsschein_titel As String + + +134217984 +auslieferungsschein_titel As String +0 +0 + + +deleted + +1 + +134217984 +deleted As Integer + + +134217984 +deleted As Integer +0 +0 + + +lastuser_uid + +1 + +134217984 +lastuser_uid As Integer + + +134217984 +lastuser_uid As Integer +0 +0 + + +active + +1 + +134217984 +active As Integer + + +134217984 +active As Integer +0 +0 + + +system_created + +1 + +134217984 +system_created As Date + + +134217984 +system_created As Date +0 +0 + + +system_deleted + +1 + +134217984 +system_deleted As Date + + +134217984 +system_deleted As Date +0 +0 + + +system_lastedit + +1 + +134217984 +system_lastedit As Date + + +134217984 +system_lastedit As Date +0 +0 + + List 1 134217984 Shared Function List(sCriteria as string = "", sOrderBy as string = "") As DataFile.tbl_auslieferungsschein_bestellung() //Usage: // dim arotbl_auslieferungsschein_bestellung() as DataFile.tbl_auslieferungsschein_bestellung = DataFile.tbl_auslieferungsschein_bestellung.List("fieldName = somevalue", "fieldName") dim arotbl_auslieferungsschein_bestellung() as DataFile.tbl_auslieferungsschein_bestellung dim s as string s = "select * From tbl_auslieferungsschein_bestellung " if sCriteria <> "" then s = s + " WHERE " + sCriteria end if sOrderBy.trim <> "" then s = s + " ORDER BY " + sOrderBy end dim rs as RecordSet = gDB.SQLSelect(s) If gdb.error then break System.debugLog gDB.ErrorMessage return arotbl_auslieferungsschein_bestellung end do until rs.EOF dim oRecord as new DataFile.tbl_auslieferungsschein_bestellung oRecord.ReadRecord(rs) arotbl_auslieferungsschein_bestellung.Append(oRecord) rs.MoveNext loop return arotbl_auslieferungsschein_bestellung End Function 134217984 0 1 sCriteria as string = "", sOrderBy as string = "" DataFile.tbl_auslieferungsschein_bestellung() + + FindByID + + 1 + + 134217984 + Shared Function FindByID(id as Integer) As DataFile.tbl_auslieferungsschein_bestellung + //Usage: + //dim tbl_auslieferungsschein_bestellung as DataFile.tbl_auslieferungsschein_bestellung = DataFile.tbl_auslieferungsschein_bestellung.FindByID( id ) + dim s as string + s = "Select * from tbl_auslieferungsschein_bestellung WHERE uid = " + str(id) + + dim rs as RecordSet = gDB.SQLSelect(s) + + if gdb.error then + System.debugLog gDB.ErrorMessage + return nil + end + if rs.RecordCount = 0 then return nil + + dim tbl_auslieferungsschein_bestellung as new DataFile.tbl_auslieferungsschein_bestellung + tbl_auslieferungsschein_bestellung.ReadRecord(rs) + return tbl_auslieferungsschein_bestellung + + End Function + + 134217984 + + 0 + 1 + id as Integer + DataFile.tbl_auslieferungsschein_bestellung + + + + +tbl_auslieferungsscheine +460902990 +1 +DataFile.ActiveRecordBase +1 +0 + + +uid + +1 + +134217984 +uid As Integer + + +134217984 +uid As Integer +0 +0 + + +kunden_uid + +1 + +134217984 +kunden_uid As Integer + + +134217984 +kunden_uid As Integer +0 +0 + + +kunden_titel + +1 + +134217984 +kunden_titel As String + + +134217984 +kunden_titel As String +0 +0 + + +coa_kontakt + +1 + +134217984 +coa_kontakt As String + + +134217984 +coa_kontakt As String +0 +0 + + +artikel_bezeichnung_extern + +1 + +134217984 +artikel_bezeichnung_extern As String + + +134217984 +artikel_bezeichnung_extern As String +0 +0 + + +artikel_bezeichnung_intern + +1 + +134217984 +artikel_bezeichnung_intern As String + + +134217984 +artikel_bezeichnung_intern As String +0 +0 + + +kontrakt_extern + +1 + +134217984 +kontrakt_extern As String + + +134217984 +kontrakt_extern As String +0 +0 + + +kontrakt_intern + +1 + +134217984 +kontrakt_intern As String + + +134217984 +kontrakt_intern As String +0 +0 + + +artikel_nummer_extern + +1 + +134217984 +artikel_nummer_extern As String + + +134217984 +artikel_nummer_extern As String +0 +0 + + +artikel_nummer_intern + +1 + +134217984 +artikel_nummer_intern As String + + +134217984 +artikel_nummer_intern As String +0 +0 + + +spezial_kunde + +1 + +134217984 +spezial_kunde As String + + +134217984 +spezial_kunde As String +0 +0 + + +sensorik1 + +1 + +134217984 +sensorik1 As String + + +134217984 +sensorik1 As String +0 +0 + + +sensorik2 + +1 + +134217984 +sensorik2 As String + + +134217984 +sensorik2 As String +0 +0 + + +sensorik3 + +1 + +134217984 +sensorik3 As String + + +134217984 +sensorik3 As String +0 +0 + + +schnitt_koernung + +1 + +134217984 +schnitt_koernung As String + + +134217984 +schnitt_koernung As String +0 +0 + + +muster + +1 + +134217984 +muster As String + + +134217984 +muster As String +0 +0 + + +schuettgewicht + +1 + +134217984 +schuettgewicht As String + + +134217984 +schuettgewicht As String +0 +0 + + +stampfvolumen + +1 + +134217984 +stampfvolumen As String + + +134217984 +stampfvolumen As String +0 +0 + + +abruf_nummer + +1 + +134217984 +abruf_nummer As String + + +134217984 +abruf_nummer As String +0 +0 + + +farbe + +1 + +134217984 +farbe As String + + +134217984 +farbe As String +0 +0 + + +aussehen + +1 + +134217984 +aussehen As String + + +134217984 +aussehen As String +0 +0 + + +feuchtigkeit + +1 + +134217984 +feuchtigkeit As String + + +134217984 +feuchtigkeit As String +0 +0 + + +sand + +1 + +134217984 +sand As String + + +134217984 +sand As String +0 +0 + + +asche + +1 + +134217984 +asche As String + + +134217984 +asche As String +0 +0 + + +mhd + +1 + +134217984 +mhd As String + + +134217984 +mhd As String +0 +0 + + +bulkindex + +1 + +134217984 +bulkindex As String + + +134217984 +bulkindex As String +0 +0 + + +attribut_auswahl + +1 + +134217984 +attribut_auswahl As String + + +134217984 +attribut_auswahl As String +0 +0 + + +sieb1 + +1 + +134217984 +sieb1 As String + + +134217984 +sieb1 As String +0 +0 + + +sieb2 + +1 + +134217984 +sieb2 As String + + +134217984 +sieb2 As String +0 +0 + + +sieb3 + +1 + +134217984 +sieb3 As String + + +134217984 +sieb3 As String +0 +0 + + +sieb4 + +1 + +134217984 +sieb4 As String + + +134217984 +sieb4 As String +0 +0 + + +sieb5 + +1 + +134217984 +sieb5 As String + + +134217984 +sieb5 As String +0 +0 + + +sieb6 + +1 + +134217984 +sieb6 As String + + +134217984 +sieb6 As String +0 +0 + + +mikrobiologie + +1 + +134217984 +mikrobiologie As String + + +134217984 +mikrobiologie As String +0 +0 + + +statistiknummer + +1 + +134217984 +statistiknummer As String + + +134217984 +statistiknummer As String +0 +0 + + +bemerkung + +1 + +134217984 +bemerkung As String + + +134217984 +bemerkung As String +0 +0 + + +zusatz + +1 + +134217984 +zusatz As String + + +134217984 +zusatz As String +0 +0 + + +menge + +1 + +134217984 +menge As Double + + +134217984 +menge As Double +0 +0 + + +menge_lbs + +1 + +134217984 +menge_lbs As Double + + +134217984 +menge_lbs As Double +0 +0 + + +menge_brutto + +1 + +134217984 +menge_brutto As Double + + +134217984 +menge_brutto As Double +0 +0 + + +verpackung_uid + +1 + +134217984 +verpackung_uid As Integer + + +134217984 +verpackung_uid As Integer +0 +0 + + +verpackung_anzahl + +1 + +134217984 +verpackung_anzahl As Double + + +134217984 +verpackung_anzahl As Double +0 +0 + + +verpackung_gewicht + +1 + +134217984 +verpackung_gewicht As Double + + +134217984 +verpackung_gewicht As Double +0 +0 + + +paletten_uid + +1 + +134217984 +paletten_uid As Integer + + +134217984 +paletten_uid As Integer +0 +0 + + +paletten_anzahl + +1 + +134217984 +paletten_anzahl As Double + + +134217984 +paletten_anzahl As Double +0 +0 + + +palettenverpackung_anzahl + +1 + +134217984 +palettenverpackung_anzahl As Double + + +134217984 +palettenverpackung_anzahl As Double +0 +0 + + +auslieferungs_auftrags_nummer + +1 + +134217984 +auslieferungs_auftrags_nummer As String + + +134217984 +auslieferungs_auftrags_nummer As String +0 +0 + + +fa_nummer + +1 + +134217984 +fa_nummer As String + + +134217984 +fa_nummer As String +0 +0 + + +letzte_lieferung + +1 + +134217984 +letzte_lieferung As Date + + +134217984 +letzte_lieferung As Date +0 +0 + + +auslieferungsdatum + +1 + +134217984 +auslieferungsdatum As Date + + +134217984 +auslieferungsdatum As Date +0 +0 + + +anlieferungsdatum + +1 + +134217984 +anlieferungsdatum As Date + + +134217984 +anlieferungsdatum As Date +0 +0 + + +auslieferungsschein_titel + +1 + +134217984 +auslieferungsschein_titel As String + + +134217984 +auslieferungsschein_titel As String +0 +0 + + +deleted + +1 + +134217984 +deleted As Integer + + +134217984 +deleted As Integer +0 +0 + + +lastuser_uid + +1 + +134217984 +lastuser_uid As Integer + + +134217984 +lastuser_uid As Integer +0 +0 + + +active + +1 + +134217984 +active As Integer + + +134217984 +active As Integer +0 +0 + + +system_created + +1 + +134217984 +system_created As Date + + +134217984 +system_created As Date +0 +0 + + +system_deleted + +1 + +134217984 +system_deleted As Date + + +134217984 +system_deleted As Date +0 +0 + + +system_lastedit + +1 + +134217984 +system_lastedit As Date + + +134217984 +system_lastedit As Date +0 +0 + + List 1 134217984 Shared Function List(sCriteria as string = "", sOrderBy as string = "") As DataFile.tbl_auslieferungsscheine() //Usage: // dim arotbl_auslieferungsscheine() as DataFile.tbl_auslieferungsscheine = DataFile.tbl_auslieferungsscheine.List("fieldName = somevalue", "fieldName") dim arotbl_auslieferungsscheine() as DataFile.tbl_auslieferungsscheine dim s as string s = "select * From tbl_auslieferungsscheine " if sCriteria <> "" then s = s + " WHERE " + sCriteria end if sOrderBy.trim <> "" then s = s + " ORDER BY " + sOrderBy end dim rs as RecordSet = gDB.SQLSelect(s) If gdb.error then break System.debugLog gDB.ErrorMessage return arotbl_auslieferungsscheine end do until rs.EOF dim oRecord as new DataFile.tbl_auslieferungsscheine oRecord.ReadRecord(rs) arotbl_auslieferungsscheine.Append(oRecord) rs.MoveNext loop return arotbl_auslieferungsscheine End Function 134217984 0 1 sCriteria as string = "", sOrderBy as string = "" DataFile.tbl_auslieferungsscheine() + + FindByID + + 1 + + 134217984 + Shared Function FindByID(id as Integer) As DataFile.tbl_auslieferungsscheine + //Usage: + //dim tbl_auslieferungsscheine as DataFile.tbl_auslieferungsscheine = DataFile.tbl_auslieferungsscheine.FindByID( id ) + dim s as string + s = "Select * from tbl_auslieferungsscheine WHERE uid = " + str(id) + + dim rs as RecordSet = gDB.SQLSelect(s) + + if gdb.error then + System.debugLog gDB.ErrorMessage + return nil + end + if rs.RecordCount = 0 then return nil + + dim tbl_auslieferungsscheine as new DataFile.tbl_auslieferungsscheine + tbl_auslieferungsscheine.ReadRecord(rs) + return tbl_auslieferungsscheine + + End Function + + 134217984 + + 0 + 1 + id as Integer + DataFile.tbl_auslieferungsscheine + + + + +tbl_benutzer +460902990 +1 +DataFile.ActiveRecordBase +1 +0 + + +uid + +1 + +134217984 +uid As Integer + + +134217984 +uid As Integer +0 +0 + + +benutzername + +1 + +134217984 +benutzername As String + + +134217984 +benutzername As String +0 +0 + + +benutzerpasswort + +1 + +134217984 +benutzerpasswort As String + + +134217984 +benutzerpasswort As String +0 +0 + + +anrede + +1 + +134217984 +anrede As String + + +134217984 +anrede As String +0 +0 + + +vorname + +1 + +134217984 +vorname As String + + +134217984 +vorname As String +0 +0 + + +nachname + +1 + +134217984 +nachname As String + + +134217984 +nachname As String +0 +0 + + +abteilung + +1 + +134217984 +abteilung As String + + +134217984 +abteilung As String +0 +0 + + +emailadresse + +1 + +134217984 +emailadresse As String + + +134217984 +emailadresse As String +0 +0 + + +durchwahl + +1 + +134217984 +durchwahl As String + + +134217984 +durchwahl As String +0 +0 + + +bemerkungen + +1 + +134217984 +bemerkungen As String + + +134217984 +bemerkungen As String +0 +0 + + +benutzerwerk_uid + +1 + +134217984 +benutzerwerk_uid As Integer + + +134217984 +benutzerwerk_uid As Integer +0 +0 + + +adminuser + +1 + +134217984 +adminuser As Integer + + +134217984 +adminuser As Integer +0 +0 + + +deleted + +1 + +134217984 +deleted As Integer + + +134217984 +deleted As Integer +0 +0 + + +active + +1 + +134217984 +active As Integer + + +134217984 +active As Integer +0 +0 + + +lastuser_uid + +1 + +134217984 +lastuser_uid As Integer + + +134217984 +lastuser_uid As Integer +0 +0 + + +token + +1 + +134217984 +token As String + + +134217984 +token As String +0 +0 + + +system_created + +1 + +134217984 +system_created As Date + + +134217984 +system_created As Date +0 +0 + + +system_deleted + +1 + +134217984 +system_deleted As Date + + +134217984 +system_deleted As Date +0 +0 + + +system_lastedit + +1 + +134217984 +system_lastedit As Date + + +134217984 +system_lastedit As Date +0 +0 + + List 1 134217984 Shared Function List(sCriteria as string = "", sOrderBy as string = "") As DataFile.tbl_benutzer() //Usage: // dim arotbl_benutzer() as DataFile.tbl_benutzer = DataFile.tbl_benutzer.List("fieldName = somevalue", "fieldName") dim arotbl_benutzer() as DataFile.tbl_benutzer dim s as string s = "select * From tbl_benutzer " if sCriteria <> "" then s = s + " WHERE " + sCriteria end if sOrderBy.trim <> "" then s = s + " ORDER BY " + sOrderBy end dim rs as RecordSet = gDB.SQLSelect(s) If gdb.error then break System.debugLog gDB.ErrorMessage return arotbl_benutzer end do until rs.EOF dim oRecord as new DataFile.tbl_benutzer oRecord.ReadRecord(rs) arotbl_benutzer.Append(oRecord) rs.MoveNext loop return arotbl_benutzer End Function 134217984 0 1 sCriteria as string = "", sOrderBy as string = "" DataFile.tbl_benutzer() + + FindByID + + 1 + + 134217984 + Shared Function FindByID(id as Integer) As DataFile.tbl_benutzer + //Usage: + //dim tbl_benutzer as DataFile.tbl_benutzer = DataFile.tbl_benutzer.FindByID( id ) + dim s as string + s = "Select * from tbl_benutzer WHERE uid = " + str(id) + + dim rs as RecordSet = gDB.SQLSelect(s) + + if gdb.error then + System.debugLog gDB.ErrorMessage + return nil + end + if rs.RecordCount = 0 then return nil + + dim tbl_benutzer as new DataFile.tbl_benutzer + tbl_benutzer.ReadRecord(rs) + return tbl_benutzer + + End Function + + 134217984 + + 0 + 1 + id as Integer + DataFile.tbl_benutzer + + + + +tbl_bestellungen +460902990 +1 +DataFile.ActiveRecordBase +1 +0 + + +uid + +1 + +134217984 +uid As Integer + + +134217984 +uid As Integer +0 +0 + + +kunden_uid + +1 + +134217984 +kunden_uid As Integer + + +134217984 +kunden_uid As Integer +0 +0 + + +auslieferungsschein_uid + +1 + +134217984 +auslieferungsschein_uid As Integer + + +134217984 +auslieferungsschein_uid As Integer +0 +0 + + +bearbeiter_uid + +1 + +134217984 +bearbeiter_uid As Integer + + +134217984 +bearbeiter_uid As Integer +0 +0 + + +benutzerwerk_uid + +1 + +134217984 +benutzerwerk_uid As Integer + + +134217984 +benutzerwerk_uid As Integer +0 +0 + + +auslieferungs_datum + +1 + +134217984 +auslieferungs_datum As Date + + +134217984 +auslieferungs_datum As Date +0 +0 + + +anlieferungs_datum + +1 + +134217984 +anlieferungs_datum As Date + + +134217984 +anlieferungs_datum As Date +0 +0 + + +kunden_nummer + +1 + +134217984 +kunden_nummer As String + + +134217984 +kunden_nummer As String +0 +0 + + +abruf_nummer + +1 + +134217984 +abruf_nummer As String + + +134217984 +abruf_nummer As String +0 +0 + + +status + +1 + +134217984 +status As Integer + + +134217984 +status As Integer +0 +0 + + +deleted + +1 + +134217984 +deleted As Integer + + +134217984 +deleted As Integer +0 +0 + + +lastuser_uid + +1 + +134217984 +lastuser_uid As Integer + + +134217984 +lastuser_uid As Integer +0 +0 + + +active + +1 + +134217984 +active As Integer + + +134217984 +active As Integer +0 +0 + + +system_created + +1 + +134217984 +system_created As Date + + +134217984 +system_created As Date +0 +0 + + +system_deleted + +1 + +134217984 +system_deleted As Date + + +134217984 +system_deleted As Date +0 +0 + + +system_lastedit + +1 + +134217984 +system_lastedit As Date + + +134217984 +system_lastedit As Date +0 +0 + + List 1 134217984 Shared Function List(sCriteria as string = "", sOrderBy as string = "") As DataFile.tbl_bestellungen() //Usage: // dim arotbl_bestellungen() as DataFile.tbl_bestellungen = DataFile.tbl_bestellungen.List("fieldName = somevalue", "fieldName") dim arotbl_bestellungen() as DataFile.tbl_bestellungen dim s as string s = "select * From tbl_bestellungen " if sCriteria <> "" then s = s + " WHERE " + sCriteria end if sOrderBy.trim <> "" then s = s + " ORDER BY " + sOrderBy end dim rs as RecordSet = gDB.SQLSelect(s) If gdb.error then break System.debugLog gDB.ErrorMessage return arotbl_bestellungen end do until rs.EOF dim oRecord as new DataFile.tbl_bestellungen oRecord.ReadRecord(rs) arotbl_bestellungen.Append(oRecord) rs.MoveNext loop return arotbl_bestellungen End Function 134217984 0 1 sCriteria as string = "", sOrderBy as string = "" DataFile.tbl_bestellungen() + + FindByID + + 1 + + 134217984 + Shared Function FindByID(id as Integer) As DataFile.tbl_bestellungen + //Usage: + //dim tbl_bestellungen as DataFile.tbl_bestellungen = DataFile.tbl_bestellungen.FindByID( id ) + dim s as string + s = "Select * from tbl_bestellungen WHERE uid = " + str(id) + + dim rs as RecordSet = gDB.SQLSelect(s) + + if gdb.error then + System.debugLog gDB.ErrorMessage + return nil + end + if rs.RecordCount = 0 then return nil + + dim tbl_bestellungen as new DataFile.tbl_bestellungen + tbl_bestellungen.ReadRecord(rs) + return tbl_bestellungen + + End Function + + 134217984 + + 0 + 1 + id as Integer + DataFile.tbl_bestellungen + + + + +tbl_cmr +460902990 +1 +DataFile.ActiveRecordBase +1 +0 + + +bestellung_uid + +1 + +134217984 +bestellung_uid As Integer + + +134217984 +bestellung_uid As Integer +0 +0 + + +benutzerwerk_uid + +1 + +134217984 +benutzerwerk_uid As Integer + + +134217984 +benutzerwerk_uid As Integer +0 +0 + + +deliverynote + +1 + +134217984 +deliverynote As String + + +134217984 +deliverynote As String +0 +0 + + +invoice + +1 + +134217984 +invoice As String + + +134217984 +invoice As String +0 +0 + + +mrn + +1 + +134217984 +mrn As String + + +134217984 +mrn As String +0 +0 + + +statistiknummer + +1 + +134217984 +statistiknummer As String + + +134217984 +statistiknummer As String +0 +0 + + +kunden_adressen_uid + +1 + +134217984 +kunden_adressen_uid As Integer + + +134217984 +kunden_adressen_uid As Integer +0 +0 + + +kunden_uid + +1 + +134217984 +kunden_uid As Integer + + +134217984 +kunden_uid As Integer +0 +0 + + +lastuser_uid + +1 + +134217984 +lastuser_uid As Integer + + +134217984 +lastuser_uid As Integer +0 +0 + + +deleted + +1 + +134217984 +deleted As Integer + + +134217984 +deleted As Integer +0 +0 + + +active + +1 + +134217984 +active As Integer + + +134217984 +active As Integer +0 +0 + + +system_created + +1 + +134217984 +system_created As Date + + +134217984 +system_created As Date +0 +0 + + +system_deleted + +1 + +134217984 +system_deleted As Date + + +134217984 +system_deleted As Date +0 +0 + + +system_lastedit + +1 + +134217984 +system_lastedit As Date + + +134217984 +system_lastedit As Date +0 +0 + + List 1 134217984 Shared Function List(sCriteria as string = "", sOrderBy as string = "") As DataFile.tbl_cmr() //Usage: // dim arotbl_cmr() as DataFile.tbl_cmr = DataFile.tbl_cmr.List("fieldName = somevalue", "fieldName") dim arotbl_cmr() as DataFile.tbl_cmr dim s as string s = "select * From tbl_cmr " if sCriteria <> "" then s = s + " WHERE " + sCriteria end if sOrderBy.trim <> "" then s = s + " ORDER BY " + sOrderBy end dim rs as RecordSet = gDB.SQLSelect(s) If gdb.error then break System.debugLog gDB.ErrorMessage return arotbl_cmr end do until rs.EOF dim oRecord as new DataFile.tbl_cmr oRecord.ReadRecord(rs) arotbl_cmr.Append(oRecord) rs.MoveNext loop return arotbl_cmr End Function 134217984 0 1 sCriteria as string = "", sOrderBy as string = "" DataFile.tbl_cmr() + + FindByID + + 1 + + 134217984 + Shared Function FindByID(id as Integer) As DataFile.tbl_cmr + //Usage: + //dim tbl_cmr as DataFile.tbl_cmr = DataFile.tbl_cmr.FindByID( id ) + dim s as string + s = "Select * from tbl_cmr WHERE = " + str(id) + + dim rs as RecordSet = gDB.SQLSelect(s) + + if gdb.error then + System.debugLog gDB.ErrorMessage + return nil + end + if rs.RecordCount = 0 then return nil + + dim tbl_cmr as new DataFile.tbl_cmr + tbl_cmr.ReadRecord(rs) + return tbl_cmr + + End Function + + 134217984 + + 0 + 1 + id as Integer + DataFile.tbl_cmr + + + + +tbl_coa +460902990 +1 +DataFile.ActiveRecordBase +1 +0 + + +auslieferungsschein_uid + +1 + +134217984 +auslieferungsschein_uid As Integer + + +134217984 +auslieferungsschein_uid As Integer +0 +0 + + +hilfswerte_coa_uid + +1 + +134217984 +hilfswerte_coa_uid As Integer + + +134217984 +hilfswerte_coa_uid As Integer +0 +0 + + +werte + +1 + +134217984 +werte As String + + +134217984 +werte As String +0 +0 + + +deleted + +1 + +134217984 +deleted As Integer + + +134217984 +deleted As Integer +0 +0 + + +lastuser_uid + +1 + +134217984 +lastuser_uid As Integer + + +134217984 +lastuser_uid As Integer +0 +0 + + +active + +1 + +134217984 +active As Integer + + +134217984 +active As Integer +0 +0 + + +system_datum + +1 + +134217984 +system_datum As Date + + +134217984 +system_datum As Date +0 +0 + + +system_deleted + +1 + +134217984 +system_deleted As Date + + +134217984 +system_deleted As Date +0 +0 + + +system_editierdatum + +1 + +134217984 +system_editierdatum As Date + + +134217984 +system_editierdatum As Date +0 +0 + + List 1 134217984 Shared Function List(sCriteria as string = "", sOrderBy as string = "") As DataFile.tbl_coa() //Usage: // dim arotbl_coa() as DataFile.tbl_coa = DataFile.tbl_coa.List("fieldName = somevalue", "fieldName") dim arotbl_coa() as DataFile.tbl_coa dim s as string s = "select * From tbl_coa " if sCriteria <> "" then s = s + " WHERE " + sCriteria end if sOrderBy.trim <> "" then s = s + " ORDER BY " + sOrderBy end dim rs as RecordSet = gDB.SQLSelect(s) If gdb.error then break System.debugLog gDB.ErrorMessage return arotbl_coa end do until rs.EOF dim oRecord as new DataFile.tbl_coa oRecord.ReadRecord(rs) arotbl_coa.Append(oRecord) rs.MoveNext loop return arotbl_coa End Function 134217984 0 1 sCriteria as string = "", sOrderBy as string = "" DataFile.tbl_coa() + + FindByID + + 1 + + 134217984 + Shared Function FindByID(id as Integer) As DataFile.tbl_coa + //Usage: + //dim tbl_coa as DataFile.tbl_coa = DataFile.tbl_coa.FindByID( id ) + dim s as string + s = "Select * from tbl_coa WHERE = " + str(id) + + dim rs as RecordSet = gDB.SQLSelect(s) + + if gdb.error then + System.debugLog gDB.ErrorMessage + return nil + end + if rs.RecordCount = 0 then return nil + + dim tbl_coa as new DataFile.tbl_coa + tbl_coa.ReadRecord(rs) + return tbl_coa + + End Function + + 134217984 + + 0 + 1 + id as Integer + DataFile.tbl_coa + + + + +tbl_coa_bestellung +460902990 +1 +DataFile.ActiveRecordBase +1 +0 + + +bestellung_uid + +1 + +134217984 +bestellung_uid As Integer + + +134217984 +bestellung_uid As Integer +0 +0 + + +hilfswerte_coa_uid + +1 + +134217984 +hilfswerte_coa_uid As Integer + + +134217984 +hilfswerte_coa_uid As Integer +0 +0 + + +werte + +1 + +134217984 +werte As String + + +134217984 +werte As String +0 +0 + + +werte_coa + +1 + +134217984 +werte_coa As String + + +134217984 +werte_coa As String +0 +0 + + +deleted + +1 + +134217984 +deleted As Integer + + +134217984 +deleted As Integer +0 +0 + + +active + +1 + +134217984 +active As Integer + + +134217984 +active As Integer +0 +0 + + +lastuser_uid + +1 + +134217984 +lastuser_uid As Integer + + +134217984 +lastuser_uid As Integer +0 +0 + + +system_created + +1 + +134217984 +system_created As Date + + +134217984 +system_created As Date +0 +0 + + +system_deleted + +1 + +134217984 +system_deleted As Date + + +134217984 +system_deleted As Date +0 +0 + + +system_lastedit + +1 + +134217984 +system_lastedit As Date + + +134217984 +system_lastedit As Date +0 +0 + + List 1 134217984 Shared Function List(sCriteria as string = "", sOrderBy as string = "") As DataFile.tbl_coa_bestellung() //Usage: // dim arotbl_coa_bestellung() as DataFile.tbl_coa_bestellung = DataFile.tbl_coa_bestellung.List("fieldName = somevalue", "fieldName") dim arotbl_coa_bestellung() as DataFile.tbl_coa_bestellung dim s as string s = "select * From tbl_coa_bestellung " if sCriteria <> "" then s = s + " WHERE " + sCriteria end if sOrderBy.trim <> "" then s = s + " ORDER BY " + sOrderBy end dim rs as RecordSet = gDB.SQLSelect(s) If gdb.error then break System.debugLog gDB.ErrorMessage return arotbl_coa_bestellung end do until rs.EOF dim oRecord as new DataFile.tbl_coa_bestellung oRecord.ReadRecord(rs) arotbl_coa_bestellung.Append(oRecord) rs.MoveNext loop return arotbl_coa_bestellung End Function 134217984 0 1 sCriteria as string = "", sOrderBy as string = "" DataFile.tbl_coa_bestellung() + + FindByID + + 1 + + 134217984 + Shared Function FindByID(id as Integer) As DataFile.tbl_coa_bestellung + //Usage: + //dim tbl_coa_bestellung as DataFile.tbl_coa_bestellung = DataFile.tbl_coa_bestellung.FindByID( id ) + dim s as string + s = "Select * from tbl_coa_bestellung WHERE = " + str(id) + + dim rs as RecordSet = gDB.SQLSelect(s) + + if gdb.error then + System.debugLog gDB.ErrorMessage + return nil + end + if rs.RecordCount = 0 then return nil + + dim tbl_coa_bestellung as new DataFile.tbl_coa_bestellung + tbl_coa_bestellung.ReadRecord(rs) + return tbl_coa_bestellung + + End Function + + 134217984 + + 0 + 1 + id as Integer + DataFile.tbl_coa_bestellung + + + + +tbl_hilfswerte_coa +460902990 +1 +DataFile.ActiveRecordBase +1 +0 + + +uid + +1 + +134217984 +uid As Integer + + +134217984 +uid As Integer +0 +0 + + +title + +1 + +134217984 +title As String + + +134217984 +title As String +0 +0 + + +deleted + +1 + +134217984 +deleted As Integer + + +134217984 +deleted As Integer +0 +0 + + +active + +1 + +134217984 +active As Integer + + +134217984 +active As Integer +0 +0 + + +lastuser_uid + +1 + +134217984 +lastuser_uid As Integer + + +134217984 +lastuser_uid As Integer +0 +0 + + +system_created + +1 + +134217984 +system_created As Date + + +134217984 +system_created As Date +0 +0 + + +system_deleted + +1 + +134217984 +system_deleted As Date + + +134217984 +system_deleted As Date +0 +0 + + +system_lastedit + +1 + +134217984 +system_lastedit As Date + + +134217984 +system_lastedit As Date +0 +0 + + List 1 134217984 Shared Function List(sCriteria as string = "", sOrderBy as string = "") As DataFile.tbl_hilfswerte_coa() //Usage: // dim arotbl_hilfswerte_coa() as DataFile.tbl_hilfswerte_coa = DataFile.tbl_hilfswerte_coa.List("fieldName = somevalue", "fieldName") dim arotbl_hilfswerte_coa() as DataFile.tbl_hilfswerte_coa dim s as string s = "select * From tbl_hilfswerte_coa " if sCriteria <> "" then s = s + " WHERE " + sCriteria end if sOrderBy.trim <> "" then s = s + " ORDER BY " + sOrderBy end dim rs as RecordSet = gDB.SQLSelect(s) If gdb.error then break System.debugLog gDB.ErrorMessage return arotbl_hilfswerte_coa end do until rs.EOF dim oRecord as new DataFile.tbl_hilfswerte_coa oRecord.ReadRecord(rs) arotbl_hilfswerte_coa.Append(oRecord) rs.MoveNext loop return arotbl_hilfswerte_coa End Function 134217984 0 1 sCriteria as string = "", sOrderBy as string = "" DataFile.tbl_hilfswerte_coa() + + FindByID + + 1 + + 134217984 + Shared Function FindByID(id as Integer) As DataFile.tbl_hilfswerte_coa + //Usage: + //dim tbl_hilfswerte_coa as DataFile.tbl_hilfswerte_coa = DataFile.tbl_hilfswerte_coa.FindByID( id ) + dim s as string + s = "Select * from tbl_hilfswerte_coa WHERE uid = " + str(id) + + dim rs as RecordSet = gDB.SQLSelect(s) + + if gdb.error then + System.debugLog gDB.ErrorMessage + return nil + end + if rs.RecordCount = 0 then return nil + + dim tbl_hilfswerte_coa as new DataFile.tbl_hilfswerte_coa + tbl_hilfswerte_coa.ReadRecord(rs) + return tbl_hilfswerte_coa + + End Function + + 134217984 + + 0 + 1 + id as Integer + DataFile.tbl_hilfswerte_coa + + + + +tbl_kunden +460902990 +1 +DataFile.ActiveRecordBase +1 +0 + + +uid + +1 + +134217984 +uid As Integer + + +134217984 +uid As Integer +0 +0 + + +kunden_nummer + +1 + +134217984 +kunden_nummer As String + + +134217984 +kunden_nummer As String +0 +0 + + +titel + +1 + +134217984 +titel As String + + +134217984 +titel As String +0 +0 + + +zahlungsbedingung + +1 + +134217984 +zahlungsbedingung As String + + +134217984 +zahlungsbedingung As String +0 +0 + + +coa_kontakt + +1 + +134217984 +coa_kontakt As String + + +134217984 +coa_kontakt As String +0 +0 + + +mhd + +1 + +134217984 +mhd As String + + +134217984 +mhd As String +0 +0 + + +kontrakt_extern + +1 + +134217984 +kontrakt_extern As String + + +134217984 +kontrakt_extern As String +0 +0 + + +kontrakt_intern + +1 + +134217984 +kontrakt_intern As String + + +134217984 +kontrakt_intern As String +0 +0 + + +bemerkungen + +1 + +134217984 +bemerkungen As String + + +134217984 +bemerkungen As String +0 +0 + + +deleted + +1 + +134217984 +deleted As Integer + + +134217984 +deleted As Integer +0 +0 + + +active + +1 + +134217984 +active As Integer + + +134217984 +active As Integer +0 +0 + + +lastuser_uid + +1 + +134217984 +lastuser_uid As Integer + + +134217984 +lastuser_uid As Integer +0 +0 + + +system_created + +1 + +134217984 +system_created As Date + + +134217984 +system_created As Date +0 +0 + + +system_deleted + +1 + +134217984 +system_deleted As Date + + +134217984 +system_deleted As Date +0 +0 + + +system_lastedit + +1 + +134217984 +system_lastedit As Date + + +134217984 +system_lastedit As Date +0 +0 + + List 1 134217984 Shared Function List(sCriteria as string = "", sOrderBy as string = "") As DataFile.tbl_kunden() //Usage: // dim arotbl_kunden() as DataFile.tbl_kunden = DataFile.tbl_kunden.List("fieldName = somevalue", "fieldName") dim arotbl_kunden() as DataFile.tbl_kunden dim s as string s = "select * From tbl_kunden " if sCriteria <> "" then s = s + " WHERE " + sCriteria end if sOrderBy.trim <> "" then s = s + " ORDER BY " + sOrderBy end dim rs as RecordSet = gDB.SQLSelect(s) If gdb.error then break System.debugLog gDB.ErrorMessage return arotbl_kunden end do until rs.EOF dim oRecord as new DataFile.tbl_kunden oRecord.ReadRecord(rs) arotbl_kunden.Append(oRecord) rs.MoveNext loop return arotbl_kunden End Function 134217984 0 1 sCriteria as string = "", sOrderBy as string = "" DataFile.tbl_kunden() + + FindByID + + 1 + + 134217984 + Shared Function FindByID(id as Integer) As DataFile.tbl_kunden + //Usage: + //dim tbl_kunden as DataFile.tbl_kunden = DataFile.tbl_kunden.FindByID( id ) + dim s as string + s = "Select * from tbl_kunden WHERE uid = " + str(id) + + dim rs as RecordSet = gDB.SQLSelect(s) + + if gdb.error then + System.debugLog gDB.ErrorMessage + return nil + end + if rs.RecordCount = 0 then return nil + + dim tbl_kunden as new DataFile.tbl_kunden + tbl_kunden.ReadRecord(rs) + return tbl_kunden + + End Function + + 134217984 + + 0 + 1 + id as Integer + DataFile.tbl_kunden + + + + +tbl_kunden_adressen +460902990 +1 +DataFile.ActiveRecordBase +1 +0 + + +uid + +1 + +134217984 +uid As Integer + + +134217984 +uid As Integer +0 +0 + + +kunden_uid + +1 + +134217984 +kunden_uid As Integer + + +134217984 +kunden_uid As Integer +0 +0 + + +name1 + +1 + +134217984 +name1 As String + + +134217984 +name1 As String +0 +0 + + +name2 + +1 + +134217984 +name2 As String + + +134217984 +name2 As String +0 +0 + + +name3 + +1 + +134217984 +name3 As String + + +134217984 +name3 As String +0 +0 + + +land + +1 + +134217984 +land As String + + +134217984 +land As String +0 +0 + + +plz + +1 + +134217984 +plz As String + + +134217984 +plz As String +0 +0 + + +ort + +1 + +134217984 +ort As String + + +134217984 +ort As String +0 +0 + + +strasse + +1 + +134217984 +strasse As String + + +134217984 +strasse As String +0 +0 + + +telefon + +1 + +134217984 +telefon As String + + +134217984 +telefon As String +0 +0 + + +telefax + +1 + +134217984 +telefax As String + + +134217984 +telefax As String +0 +0 + + +email + +1 + +134217984 +email As String + + +134217984 +email As String +0 +0 + + +adressenart + +1 + +134217984 +adressenart As Integer + + +134217984 +adressenart As Integer +0 +0 + + +bemerkungen + +1 + +134217984 +bemerkungen As String + + +134217984 +bemerkungen As String +0 +0 + + +dummy_uid + +1 + +134217984 +dummy_uid As Integer + + +134217984 +dummy_uid As Integer +0 +0 + + +deleted + +1 + +134217984 +deleted As Integer + + +134217984 +deleted As Integer +0 +0 + + +active + +1 + +134217984 +active As Integer + + +134217984 +active As Integer +0 +0 + + +lastuser_uid + +1 + +134217984 +lastuser_uid As Integer + + +134217984 +lastuser_uid As Integer +0 +0 + + +system_created + +1 + +134217984 +system_created As Date + + +134217984 +system_created As Date +0 +0 + + +system_deleted + +1 + +134217984 +system_deleted As Date + + +134217984 +system_deleted As Date +0 +0 + + +system_lastedit + +1 + +134217984 +system_lastedit As Date + + +134217984 +system_lastedit As Date +0 +0 + + List 1 134217984 Shared Function List(sCriteria as string = "", sOrderBy as string = "") As DataFile.tbl_kunden_adressen() //Usage: // dim arotbl_kunden_adressen() as DataFile.tbl_kunden_adressen = DataFile.tbl_kunden_adressen.List("fieldName = somevalue", "fieldName") dim arotbl_kunden_adressen() as DataFile.tbl_kunden_adressen dim s as string s = "select * From tbl_kunden_adressen " if sCriteria <> "" then s = s + " WHERE " + sCriteria end if sOrderBy.trim <> "" then s = s + " ORDER BY " + sOrderBy end dim rs as RecordSet = gDB.SQLSelect(s) If gdb.error then break System.debugLog gDB.ErrorMessage return arotbl_kunden_adressen end do until rs.EOF dim oRecord as new DataFile.tbl_kunden_adressen oRecord.ReadRecord(rs) arotbl_kunden_adressen.Append(oRecord) rs.MoveNext loop return arotbl_kunden_adressen End Function 134217984 0 1 sCriteria as string = "", sOrderBy as string = "" DataFile.tbl_kunden_adressen() + + FindByID + + 1 + + 134217984 + Shared Function FindByID(id as Integer) As DataFile.tbl_kunden_adressen + //Usage: + //dim tbl_kunden_adressen as DataFile.tbl_kunden_adressen = DataFile.tbl_kunden_adressen.FindByID( id ) + dim s as string + s = "Select * from tbl_kunden_adressen WHERE uid = " + str(id) + + dim rs as RecordSet = gDB.SQLSelect(s) + + if gdb.error then + System.debugLog gDB.ErrorMessage + return nil + end + if rs.RecordCount = 0 then return nil + + dim tbl_kunden_adressen as new DataFile.tbl_kunden_adressen + tbl_kunden_adressen.ReadRecord(rs) + return tbl_kunden_adressen + + End Function + + 134217984 + + 0 + 1 + id as Integer + DataFile.tbl_kunden_adressen + + + + +tbl_laenderkennungen +460902990 +1 +DataFile.ActiveRecordBase +1 +0 + + +uid + +1 + +134217984 +uid As Integer + + +134217984 +uid As Integer +0 +0 + + +bezeichnung + +1 + +134217984 +bezeichnung As String + + +134217984 +bezeichnung As String +0 +0 + + +postkuerzel + +1 + +134217984 +postkuerzel As String + + +134217984 +postkuerzel As String +0 +0 + + +deleted + +1 + +134217984 +deleted As Integer + + +134217984 +deleted As Integer +0 +0 + + +active + +1 + +134217984 +active As Integer + + +134217984 +active As Integer +0 +0 + + +lastuser_uid + +1 + +134217984 +lastuser_uid As Integer + + +134217984 +lastuser_uid As Integer +0 +0 + + +system_created + +1 + +134217984 +system_created As Date + + +134217984 +system_created As Date +0 +0 + + +system_deleted + +1 + +134217984 +system_deleted As Date + + +134217984 +system_deleted As Date +0 +0 + + +system_lastedit + +1 + +134217984 +system_lastedit As Date + + +134217984 +system_lastedit As Date +0 +0 + + List 1 134217984 Shared Function List(sCriteria as string = "", sOrderBy as string = "") As DataFile.tbl_laenderkennungen() //Usage: // dim arotbl_laenderkennungen() as DataFile.tbl_laenderkennungen = DataFile.tbl_laenderkennungen.List("fieldName = somevalue", "fieldName") dim arotbl_laenderkennungen() as DataFile.tbl_laenderkennungen dim s as string s = "select * From tbl_laenderkennungen " if sCriteria <> "" then s = s + " WHERE " + sCriteria end if sOrderBy.trim <> "" then s = s + " ORDER BY " + sOrderBy end dim rs as RecordSet = gDB.SQLSelect(s) If gdb.error then break System.debugLog gDB.ErrorMessage return arotbl_laenderkennungen end do until rs.EOF dim oRecord as new DataFile.tbl_laenderkennungen oRecord.ReadRecord(rs) arotbl_laenderkennungen.Append(oRecord) rs.MoveNext loop return arotbl_laenderkennungen End Function 134217984 0 1 sCriteria as string = "", sOrderBy as string = "" DataFile.tbl_laenderkennungen() + + FindByID + + 1 + + 134217984 + Shared Function FindByID(id as Integer) As DataFile.tbl_laenderkennungen + //Usage: + //dim tbl_laenderkennungen as DataFile.tbl_laenderkennungen = DataFile.tbl_laenderkennungen.FindByID( id ) + dim s as string + s = "Select * from tbl_laenderkennungen WHERE uid = " + str(id) + + dim rs as RecordSet = gDB.SQLSelect(s) + + if gdb.error then + System.debugLog gDB.ErrorMessage + return nil + end + if rs.RecordCount = 0 then return nil + + dim tbl_laenderkennungen as new DataFile.tbl_laenderkennungen + tbl_laenderkennungen.ReadRecord(rs) + return tbl_laenderkennungen + + End Function + + 134217984 + + 0 + 1 + id as Integer + DataFile.tbl_laenderkennungen + + + + +tbl_mikrobiologie +460902990 +1 +DataFile.ActiveRecordBase +1 +0 + + +uid + +1 + +134217984 +uid As Integer + + +134217984 +uid As Integer +0 +0 + + +mikrobiologie_bezeichnung + +1 + +134217984 +mikrobiologie_bezeichnung As String + + +134217984 +mikrobiologie_bezeichnung As String +0 +0 + + +deleted + +1 + +134217984 +deleted As Integer + + +134217984 +deleted As Integer +0 +0 + + +active + +1 + +134217984 +active As Integer + + +134217984 +active As Integer +0 +0 + + +lastuser_uid + +1 + +134217984 +lastuser_uid As Integer + + +134217984 +lastuser_uid As Integer +0 +0 + + +system_created + +1 + +134217984 +system_created As Date + + +134217984 +system_created As Date +0 +0 + + +system_deleted + +1 + +134217984 +system_deleted As Date + + +134217984 +system_deleted As Date +0 +0 + + +system_lastedit + +1 + +134217984 +system_lastedit As Date + + +134217984 +system_lastedit As Date +0 +0 + + List 1 134217984 Shared Function List(sCriteria as string = "", sOrderBy as string = "") As DataFile.tbl_mikrobiologie() //Usage: // dim arotbl_mikrobiologie() as DataFile.tbl_mikrobiologie = DataFile.tbl_mikrobiologie.List("fieldName = somevalue", "fieldName") dim arotbl_mikrobiologie() as DataFile.tbl_mikrobiologie dim s as string s = "select * From tbl_mikrobiologie " if sCriteria <> "" then s = s + " WHERE " + sCriteria end if sOrderBy.trim <> "" then s = s + " ORDER BY " + sOrderBy end dim rs as RecordSet = gDB.SQLSelect(s) If gdb.error then break System.debugLog gDB.ErrorMessage return arotbl_mikrobiologie end do until rs.EOF dim oRecord as new DataFile.tbl_mikrobiologie oRecord.ReadRecord(rs) arotbl_mikrobiologie.Append(oRecord) rs.MoveNext loop return arotbl_mikrobiologie End Function 134217984 0 1 sCriteria as string = "", sOrderBy as string = "" DataFile.tbl_mikrobiologie() + + FindByID + + 1 + + 134217984 + Shared Function FindByID(id as Integer) As DataFile.tbl_mikrobiologie + //Usage: + //dim tbl_mikrobiologie as DataFile.tbl_mikrobiologie = DataFile.tbl_mikrobiologie.FindByID( id ) + dim s as string + s = "Select * from tbl_mikrobiologie WHERE uid = " + str(id) + + dim rs as RecordSet = gDB.SQLSelect(s) + + if gdb.error then + System.debugLog gDB.ErrorMessage + return nil + end + if rs.RecordCount = 0 then return nil + + dim tbl_mikrobiologie as new DataFile.tbl_mikrobiologie + tbl_mikrobiologie.ReadRecord(rs) + return tbl_mikrobiologie + + End Function + + 134217984 + + 0 + 1 + id as Integer + DataFile.tbl_mikrobiologie + + + + +tbl_mikrobiologie_auslieferungsschein +460902990 +1 +DataFile.ActiveRecordBase +1 +0 + + +auslieferungsschein_uid + +1 + +134217984 +auslieferungsschein_uid As Integer + + +134217984 +auslieferungsschein_uid As Integer +0 +0 + + +mikrobiologie_uid + +1 + +134217984 +mikrobiologie_uid As Integer + + +134217984 +mikrobiologie_uid As Integer +0 +0 + + +mikrobiologie_werte + +1 + +134217984 +mikrobiologie_werte As String + + +134217984 +mikrobiologie_werte As String +0 +0 + + +mikrobiologie_spezifikation + +1 + +134217984 +mikrobiologie_spezifikation As String + + +134217984 +mikrobiologie_spezifikation As String +0 +0 + + +mikrobiologie_coa_checked + +1 + +134217984 +mikrobiologie_coa_checked As Integer + + +134217984 +mikrobiologie_coa_checked As Integer +0 +0 + + +lastuser_uid + +1 + +134217984 +lastuser_uid As Integer + + +134217984 +lastuser_uid As Integer +0 +0 + + +active + +1 + +134217984 +active As Integer + + +134217984 +active As Integer +0 +0 + + +deleted + +1 + +134217984 +deleted As Integer + + +134217984 +deleted As Integer +0 +0 + + +system_created + +1 + +134217984 +system_created As Date + + +134217984 +system_created As Date +0 +0 + + +system_deleted + +1 + +134217984 +system_deleted As Date + + +134217984 +system_deleted As Date +0 +0 + + +system_lastedit + +1 + +134217984 +system_lastedit As Date + + +134217984 +system_lastedit As Date +0 +0 + + List 1 134217984 Shared Function List(sCriteria as string = "", sOrderBy as string = "") As DataFile.tbl_mikrobiologie_auslieferungsschein() //Usage: // dim arotbl_mikrobiologie_auslieferungsschein() as DataFile.tbl_mikrobiologie_auslieferungsschein = DataFile.tbl_mikrobiologie_auslieferungsschein.List("fieldName = somevalue", "fieldName") dim arotbl_mikrobiologie_auslieferungsschein() as DataFile.tbl_mikrobiologie_auslieferungsschein dim s as string s = "select * From tbl_mikrobiologie_auslieferungsschein " if sCriteria <> "" then s = s + " WHERE " + sCriteria end if sOrderBy.trim <> "" then s = s + " ORDER BY " + sOrderBy end dim rs as RecordSet = gDB.SQLSelect(s) If gdb.error then break System.debugLog gDB.ErrorMessage return arotbl_mikrobiologie_auslieferungsschein end do until rs.EOF dim oRecord as new DataFile.tbl_mikrobiologie_auslieferungsschein oRecord.ReadRecord(rs) arotbl_mikrobiologie_auslieferungsschein.Append(oRecord) rs.MoveNext loop return arotbl_mikrobiologie_auslieferungsschein End Function 134217984 0 1 sCriteria as string = "", sOrderBy as string = "" DataFile.tbl_mikrobiologie_auslieferungsschein() + + FindByID + + 1 + + 134217984 + Shared Function FindByID(id as Integer) As DataFile.tbl_mikrobiologie_auslieferungsschein + //Usage: + //dim tbl_mikrobiologie_auslieferungsschein as DataFile.tbl_mikrobiologie_auslieferungsschein = DataFile.tbl_mikrobiologie_auslieferungsschein.FindByID( id ) + dim s as string + s = "Select * from tbl_mikrobiologie_auslieferungsschein WHERE = " + str(id) + + dim rs as RecordSet = gDB.SQLSelect(s) + + if gdb.error then + System.debugLog gDB.ErrorMessage + return nil + end + if rs.RecordCount = 0 then return nil + + dim tbl_mikrobiologie_auslieferungsschein as new DataFile.tbl_mikrobiologie_auslieferungsschein + tbl_mikrobiologie_auslieferungsschein.ReadRecord(rs) + return tbl_mikrobiologie_auslieferungsschein + + End Function + + 134217984 + + 0 + 1 + id as Integer + DataFile.tbl_mikrobiologie_auslieferungsschein + + + + +tbl_mikrobiologie_bestellung +460902990 +1 +DataFile.ActiveRecordBase +1 +0 + + +bestellung_uid + +1 + +134217984 +bestellung_uid As Integer + + +134217984 +bestellung_uid As Integer +0 +0 + + +mikrobiologie_uid + +1 + +134217984 +mikrobiologie_uid As Integer + + +134217984 +mikrobiologie_uid As Integer +0 +0 + + +mikrobiologie_werte + +1 + +134217984 +mikrobiologie_werte As String + + +134217984 +mikrobiologie_werte As String +0 +0 + + +mikrobiologie_spezifikation + +1 + +134217984 +mikrobiologie_spezifikation As String + + +134217984 +mikrobiologie_spezifikation As String +0 +0 + + +mikrobiologie_coa_checked + +1 + +134217984 +mikrobiologie_coa_checked As Integer + + +134217984 +mikrobiologie_coa_checked As Integer +0 +0 + + +lastuser_uid + +1 + +134217984 +lastuser_uid As Integer + + +134217984 +lastuser_uid As Integer +0 +0 + + +deleted + +1 + +134217984 +deleted As Integer + + +134217984 +deleted As Integer +0 +0 + + +active + +1 + +134217984 +active As Integer + + +134217984 +active As Integer +0 +0 + + +system_created + +1 + +134217984 +system_created As Date + + +134217984 +system_created As Date +0 +0 + + +system_deleted + +1 + +134217984 +system_deleted As Date + + +134217984 +system_deleted As Date +0 +0 + + +system_lastedit + +1 + +134217984 +system_lastedit As Date + + +134217984 +system_lastedit As Date +0 +0 + + List 1 134217984 Shared Function List(sCriteria as string = "", sOrderBy as string = "") As DataFile.tbl_mikrobiologie_bestellung() //Usage: // dim arotbl_mikrobiologie_bestellung() as DataFile.tbl_mikrobiologie_bestellung = DataFile.tbl_mikrobiologie_bestellung.List("fieldName = somevalue", "fieldName") dim arotbl_mikrobiologie_bestellung() as DataFile.tbl_mikrobiologie_bestellung dim s as string s = "select * From tbl_mikrobiologie_bestellung " if sCriteria <> "" then s = s + " WHERE " + sCriteria end if sOrderBy.trim <> "" then s = s + " ORDER BY " + sOrderBy end dim rs as RecordSet = gDB.SQLSelect(s) If gdb.error then break System.debugLog gDB.ErrorMessage return arotbl_mikrobiologie_bestellung end do until rs.EOF dim oRecord as new DataFile.tbl_mikrobiologie_bestellung oRecord.ReadRecord(rs) arotbl_mikrobiologie_bestellung.Append(oRecord) rs.MoveNext loop return arotbl_mikrobiologie_bestellung End Function 134217984 0 1 sCriteria as string = "", sOrderBy as string = "" DataFile.tbl_mikrobiologie_bestellung() + + FindByID + + 1 + + 134217984 + Shared Function FindByID(id as Integer) As DataFile.tbl_mikrobiologie_bestellung + //Usage: + //dim tbl_mikrobiologie_bestellung as DataFile.tbl_mikrobiologie_bestellung = DataFile.tbl_mikrobiologie_bestellung.FindByID( id ) + dim s as string + s = "Select * from tbl_mikrobiologie_bestellung WHERE = " + str(id) + + dim rs as RecordSet = gDB.SQLSelect(s) + + if gdb.error then + System.debugLog gDB.ErrorMessage + return nil + end + if rs.RecordCount = 0 then return nil + + dim tbl_mikrobiologie_bestellung as new DataFile.tbl_mikrobiologie_bestellung + tbl_mikrobiologie_bestellung.ReadRecord(rs) + return tbl_mikrobiologie_bestellung + + End Function + + 134217984 + + 0 + 1 + id as Integer + DataFile.tbl_mikrobiologie_bestellung + + + + +tbl_paletten +460902990 +1 +DataFile.ActiveRecordBase +1 +0 + + +uid + +1 + +134217984 +uid As Integer + + +134217984 +uid As Integer +0 +0 + + +paletten_bezeichnung + +1 + +134217984 +paletten_bezeichnung As String + + +134217984 +paletten_bezeichnung As String +0 +0 + + +paletten_gewicht + +1 + +134217984 +paletten_gewicht As Double + + +134217984 +paletten_gewicht As Double +0 +0 + + +deleted + +1 + +134217984 +deleted As Double + + +134217984 +deleted As Double +0 +0 + + +active + +1 + +134217984 +active As Double + + +134217984 +active As Double +0 +0 + + +lastuser_uid + +1 + +134217984 +lastuser_uid As Double + + +134217984 +lastuser_uid As Double +0 +0 + + +system_created + +1 + +134217984 +system_created As String + + +134217984 +system_created As String +0 +0 + + +system_deleted + +1 + +134217984 +system_deleted As String + + +134217984 +system_deleted As String +0 +0 + + +system_lastedit + +1 + +134217984 +system_lastedit As String + + +134217984 +system_lastedit As String +0 +0 + + List 1 134217984 Shared Function List(sCriteria as string = "", sOrderBy as string = "") As DataFile.tbl_paletten() //Usage: // dim arotbl_paletten() as DataFile.tbl_paletten = DataFile.tbl_paletten.List("fieldName = somevalue", "fieldName") dim arotbl_paletten() as DataFile.tbl_paletten dim s as string s = "select * From tbl_paletten " if sCriteria <> "" then s = s + " WHERE " + sCriteria end if sOrderBy.trim <> "" then s = s + " ORDER BY " + sOrderBy end dim rs as RecordSet = gDB.SQLSelect(s) If gdb.error then break System.debugLog gDB.ErrorMessage return arotbl_paletten end do until rs.EOF dim oRecord as new DataFile.tbl_paletten oRecord.ReadRecord(rs) arotbl_paletten.Append(oRecord) rs.MoveNext loop return arotbl_paletten End Function 134217984 0 1 sCriteria as string = "", sOrderBy as string = "" DataFile.tbl_paletten() + + FindByID + + 1 + + 134217984 + Shared Function FindByID(id as Integer) As DataFile.tbl_paletten + //Usage: + //dim tbl_paletten as DataFile.tbl_paletten = DataFile.tbl_paletten.FindByID( id ) + dim s as string + s = "Select * from tbl_paletten WHERE uid = " + str(id) + + dim rs as RecordSet = gDB.SQLSelect(s) + + if gdb.error then + System.debugLog gDB.ErrorMessage + return nil + end + if rs.RecordCount = 0 then return nil + + dim tbl_paletten as new DataFile.tbl_paletten + tbl_paletten.ReadRecord(rs) + return tbl_paletten + + End Function + + 134217984 + + 0 + 1 + id as Integer + DataFile.tbl_paletten + + + + +tbl_speditionen +460902990 +1 +DataFile.ActiveRecordBase +1 +0 + + +uid + +1 + +134217984 +uid As Integer + + +134217984 +uid As Integer +0 +0 + + +titel + +1 + +134217984 +titel As String + + +134217984 +titel As String +0 +0 + + +email1 + +1 + +134217984 +email1 As String + + +134217984 +email1 As String +0 +0 + + +email2 + +1 + +134217984 +email2 As String + + +134217984 +email2 As String +0 +0 + + +email3 + +1 + +134217984 +email3 As String + + +134217984 +email3 As String +0 +0 + + +email4 + +1 + +134217984 +email4 As String + + +134217984 +email4 As String +0 +0 + + +email5 + +1 + +134217984 +email5 As String + + +134217984 +email5 As String +0 +0 + + +email6 + +1 + +134217984 +email6 As String + + +134217984 +email6 As String +0 +0 + + +deleted + +1 + +134217984 +deleted As Integer + + +134217984 +deleted As Integer +0 +0 + + +active + +1 + +134217984 +active As Integer + + +134217984 +active As Integer +0 +0 + + +lastuser_uid + +1 + +134217984 +lastuser_uid As Integer + + +134217984 +lastuser_uid As Integer +0 +0 + + +system_created + +1 + +134217984 +system_created As Date + + +134217984 +system_created As Date +0 +0 + + +system_deleted + +1 + +134217984 +system_deleted As Date + + +134217984 +system_deleted As Date +0 +0 + + +system_lastedit + +1 + +134217984 +system_lastedit As Date + + +134217984 +system_lastedit As Date +0 +0 + + List 1 134217984 Shared Function List(sCriteria as string = "", sOrderBy as string = "") As DataFile.tbl_speditionen() //Usage: // dim arotbl_speditionen() as DataFile.tbl_speditionen = DataFile.tbl_speditionen.List("fieldName = somevalue", "fieldName") dim arotbl_speditionen() as DataFile.tbl_speditionen dim s as string s = "select * From tbl_speditionen " if sCriteria <> "" then s = s + " WHERE " + sCriteria end if sOrderBy.trim <> "" then s = s + " ORDER BY " + sOrderBy end dim rs as RecordSet = gDB.SQLSelect(s) If gdb.error then break System.debugLog gDB.ErrorMessage return arotbl_speditionen end do until rs.EOF dim oRecord as new DataFile.tbl_speditionen oRecord.ReadRecord(rs) arotbl_speditionen.Append(oRecord) rs.MoveNext loop return arotbl_speditionen End Function 134217984 0 1 sCriteria as string = "", sOrderBy as string = "" DataFile.tbl_speditionen() + + FindByID + + 1 + + 134217984 + Shared Function FindByID(id as Integer) As DataFile.tbl_speditionen + //Usage: + //dim tbl_speditionen as DataFile.tbl_speditionen = DataFile.tbl_speditionen.FindByID( id ) + dim s as string + s = "Select * from tbl_speditionen WHERE uid = " + str(id) + + dim rs as RecordSet = gDB.SQLSelect(s) + + if gdb.error then + System.debugLog gDB.ErrorMessage + return nil + end + if rs.RecordCount = 0 then return nil + + dim tbl_speditionen as new DataFile.tbl_speditionen + tbl_speditionen.ReadRecord(rs) + return tbl_speditionen + + End Function + + 134217984 + + 0 + 1 + id as Integer + DataFile.tbl_speditionen + + + + +tbl_speditionen_adressen +460902990 +1 +DataFile.ActiveRecordBase +1 +0 + + +uid + +1 + +134217984 +uid As Integer + + +134217984 +uid As Integer +0 +0 + + +spedition_uid + +1 + +134217984 +spedition_uid As Integer + + +134217984 +spedition_uid As Integer +0 +0 + + +titel + +1 + +134217984 +titel As String + + +134217984 +titel As String +0 +0 + + +name1 + +1 + +134217984 +name1 As String + + +134217984 +name1 As String +0 +0 + + +strasse + +1 + +134217984 +strasse As String + + +134217984 +strasse As String +0 +0 + + +plz + +1 + +134217984 +plz As String + + +134217984 +plz As String +0 +0 + + +ort + +1 + +134217984 +ort As String + + +134217984 +ort As String +0 +0 + + +land + +1 + +134217984 +land As String + + +134217984 +land As String +0 +0 + + +telefon + +1 + +134217984 +telefon As String + + +134217984 +telefon As String +0 +0 + + +telefax + +1 + +134217984 +telefax As String + + +134217984 +telefax As String +0 +0 + + +ansprechpartner + +1 + +134217984 +ansprechpartner As String + + +134217984 +ansprechpartner As String +0 +0 + + +deleted + +1 + +134217984 +deleted As Integer + + +134217984 +deleted As Integer +0 +0 + + +active + +1 + +134217984 +active As Integer + + +134217984 +active As Integer +0 +0 + + +lastuser_uid + +1 + +134217984 +lastuser_uid As Integer + + +134217984 +lastuser_uid As Integer +0 +0 + + +system_created + +1 + +134217984 +system_created As Date + + +134217984 +system_created As Date +0 +0 + + +system_deleted + +1 + +134217984 +system_deleted As Date + + +134217984 +system_deleted As Date +0 +0 + + +system_lastedit + +1 + +134217984 +system_lastedit As Date + + +134217984 +system_lastedit As Date +0 +0 + + List 1 134217984 Shared Function List(sCriteria as string = "", sOrderBy as string = "") As DataFile.tbl_speditionen_adressen() //Usage: // dim arotbl_speditionen_adressen() as DataFile.tbl_speditionen_adressen = DataFile.tbl_speditionen_adressen.List("fieldName = somevalue", "fieldName") dim arotbl_speditionen_adressen() as DataFile.tbl_speditionen_adressen dim s as string s = "select * From tbl_speditionen_adressen " if sCriteria <> "" then s = s + " WHERE " + sCriteria end if sOrderBy.trim <> "" then s = s + " ORDER BY " + sOrderBy end dim rs as RecordSet = gDB.SQLSelect(s) If gdb.error then break System.debugLog gDB.ErrorMessage return arotbl_speditionen_adressen end do until rs.EOF dim oRecord as new DataFile.tbl_speditionen_adressen oRecord.ReadRecord(rs) arotbl_speditionen_adressen.Append(oRecord) rs.MoveNext loop return arotbl_speditionen_adressen End Function 134217984 0 1 sCriteria as string = "", sOrderBy as string = "" DataFile.tbl_speditionen_adressen() + + FindByID + + 1 + + 134217984 + Shared Function FindByID(id as Integer) As DataFile.tbl_speditionen_adressen + //Usage: + //dim tbl_speditionen_adressen as DataFile.tbl_speditionen_adressen = DataFile.tbl_speditionen_adressen.FindByID( id ) + dim s as string + s = "Select * from tbl_speditionen_adressen WHERE uid = " + str(id) + + dim rs as RecordSet = gDB.SQLSelect(s) + + if gdb.error then + System.debugLog gDB.ErrorMessage + return nil + end + if rs.RecordCount = 0 then return nil + + dim tbl_speditionen_adressen as new DataFile.tbl_speditionen_adressen + tbl_speditionen_adressen.ReadRecord(rs) + return tbl_speditionen_adressen + + End Function + + 134217984 + + 0 + 1 + id as Integer + DataFile.tbl_speditionen_adressen + + + + +tbl_transport_ust +460902990 +1 +DataFile.ActiveRecordBase +1 +0 + + +bestellung_uid + +1 + +134217984 +bestellung_uid As Integer + + +134217984 +bestellung_uid As Integer +0 +0 + + +kunden_adressen_uid + +1 + +134217984 +kunden_adressen_uid As Integer + + +134217984 +kunden_adressen_uid As Integer +0 +0 + + +spedition_uid + +1 + +134217984 +spedition_uid As Integer + + +134217984 +spedition_uid As Integer +0 +0 + + +benutzerwerk_uid + +1 + +134217984 +benutzerwerk_uid As Integer + + +134217984 +benutzerwerk_uid As Integer +0 +0 + + +spedition_adresse + +1 + +134217984 +spedition_adresse As String + + +134217984 +spedition_adresse As String +0 +0 + + +liefer_adresse + +1 + +134217984 +liefer_adresse As String + + +134217984 +liefer_adresse As String +0 +0 + + +mengen_angaben + +1 + +134217984 +mengen_angaben As String + + +134217984 +mengen_angaben As String +0 +0 + + +gewicht_angaben + +1 + +134217984 +gewicht_angaben As String + + +134217984 +gewicht_angaben As String +0 +0 + + +artikel_beschreibung + +1 + +134217984 +artikel_beschreibung As String + + +134217984 +artikel_beschreibung As String +0 +0 + + +auslieferungs_datum + +1 + +134217984 +auslieferungs_datum As Date + + +134217984 +auslieferungs_datum As Date +0 +0 + + +anlieferungs_datum + +1 + +134217984 +anlieferungs_datum As Date + + +134217984 +anlieferungs_datum As Date +0 +0 + + +frachtzahler + +1 + +134217984 +frachtzahler As String + + +134217984 +frachtzahler As String +0 +0 + + +warenwert + +1 + +134217984 +warenwert As String + + +134217984 +warenwert As String +0 +0 + + +anrede + +1 + +134217984 +anrede As String + + +134217984 +anrede As String +0 +0 + + +bemerkungen + +1 + +134217984 +bemerkungen As String + + +134217984 +bemerkungen As String +0 +0 + + +kunden_uid + +1 + +134217984 +kunden_uid As Integer + + +134217984 +kunden_uid As Integer +0 +0 + + +lastuser_uid + +1 + +134217984 +lastuser_uid As Integer + + +134217984 +lastuser_uid As Integer +0 +0 + + +deleted + +1 + +134217984 +deleted As Integer + + +134217984 +deleted As Integer +0 +0 + + +active + +1 + +134217984 +active As Integer + + +134217984 +active As Integer +0 +0 + + +system_created + +1 + +134217984 +system_created As Date + + +134217984 +system_created As Date +0 +0 + + +system_deleted + +1 + +134217984 +system_deleted As Date + + +134217984 +system_deleted As Date +0 +0 + + +system_lastedit + +1 + +134217984 +system_lastedit As Date + + +134217984 +system_lastedit As Date +0 +0 + + List 1 134217984 Shared Function List(sCriteria as string = "", sOrderBy as string = "") As DataFile.tbl_transport_ust() //Usage: // dim arotbl_transport_ust() as DataFile.tbl_transport_ust = DataFile.tbl_transport_ust.List("fieldName = somevalue", "fieldName") dim arotbl_transport_ust() as DataFile.tbl_transport_ust dim s as string s = "select * From tbl_transport_ust " if sCriteria <> "" then s = s + " WHERE " + sCriteria end if sOrderBy.trim <> "" then s = s + " ORDER BY " + sOrderBy end dim rs as RecordSet = gDB.SQLSelect(s) If gdb.error then break System.debugLog gDB.ErrorMessage return arotbl_transport_ust end do until rs.EOF dim oRecord as new DataFile.tbl_transport_ust oRecord.ReadRecord(rs) arotbl_transport_ust.Append(oRecord) rs.MoveNext loop return arotbl_transport_ust End Function 134217984 0 1 sCriteria as string = "", sOrderBy as string = "" DataFile.tbl_transport_ust() + + FindByID + + 1 + + 134217984 + Shared Function FindByID(id as Integer) As DataFile.tbl_transport_ust + //Usage: + //dim tbl_transport_ust as DataFile.tbl_transport_ust = DataFile.tbl_transport_ust.FindByID( id ) + dim s as string + s = "Select * from tbl_transport_ust WHERE = " + str(id) + + dim rs as RecordSet = gDB.SQLSelect(s) + + if gdb.error then + System.debugLog gDB.ErrorMessage + return nil + end + if rs.RecordCount = 0 then return nil + + dim tbl_transport_ust as new DataFile.tbl_transport_ust + tbl_transport_ust.ReadRecord(rs) + return tbl_transport_ust + + End Function + + 134217984 + + 0 + 1 + id as Integer + DataFile.tbl_transport_ust + + + + +tbl_verpackungen +460902990 +1 +DataFile.ActiveRecordBase +1 +0 + + +uid + +1 + +134217984 +uid As Integer + + +134217984 +uid As Integer +0 +0 + + +verpackung_bezeichnung + +1 + +134217984 +verpackung_bezeichnung As String + + +134217984 +verpackung_bezeichnung As String +0 +0 + + +verpackung_gewicht + +1 + +134217984 +verpackung_gewicht As Double + + +134217984 +verpackung_gewicht As Double +0 +0 + + +verpackung_faktor + +1 + +134217984 +verpackung_faktor As Double + + +134217984 +verpackung_faktor As Double +0 +0 + + +deleted + +1 + +134217984 +deleted As Integer + + +134217984 +deleted As Integer +0 +0 + + +active + +1 + +134217984 +active As Integer + + +134217984 +active As Integer +0 +0 + + +lastuser_uid + +1 + +134217984 +lastuser_uid As Integer + + +134217984 +lastuser_uid As Integer +0 +0 + + +system_created + +1 + +134217984 +system_created As Date + + +134217984 +system_created As Date +0 +0 + + +system_deleted + +1 + +134217984 +system_deleted As Date + + +134217984 +system_deleted As Date +0 +0 + + +system_lastedit + +1 + +134217984 +system_lastedit As Date + + +134217984 +system_lastedit As Date +0 +0 + + List 1 134217984 Shared Function List(sCriteria as string = "", sOrderBy as string = "") As DataFile.tbl_verpackungen() //Usage: // dim arotbl_verpackungen() as DataFile.tbl_verpackungen = DataFile.tbl_verpackungen.List("fieldName = somevalue", "fieldName") dim arotbl_verpackungen() as DataFile.tbl_verpackungen dim s as string s = "select * From tbl_verpackungen " if sCriteria <> "" then s = s + " WHERE " + sCriteria end if sOrderBy.trim <> "" then s = s + " ORDER BY " + sOrderBy end dim rs as RecordSet = gDB.SQLSelect(s) If gdb.error then break System.debugLog gDB.ErrorMessage return arotbl_verpackungen end do until rs.EOF dim oRecord as new DataFile.tbl_verpackungen oRecord.ReadRecord(rs) arotbl_verpackungen.Append(oRecord) rs.MoveNext loop return arotbl_verpackungen End Function 134217984 0 1 sCriteria as string = "", sOrderBy as string = "" DataFile.tbl_verpackungen() + + FindByID + + 1 + + 134217984 + Shared Function FindByID(id as Integer) As DataFile.tbl_verpackungen + //Usage: + //dim tbl_verpackungen as DataFile.tbl_verpackungen = DataFile.tbl_verpackungen.FindByID( id ) + dim s as string + s = "Select * from tbl_verpackungen WHERE uid = " + str(id) + + dim rs as RecordSet = gDB.SQLSelect(s) + + if gdb.error then + System.debugLog gDB.ErrorMessage + return nil + end + if rs.RecordCount = 0 then return nil + + dim tbl_verpackungen as new DataFile.tbl_verpackungen + tbl_verpackungen.ReadRecord(rs) + return tbl_verpackungen + + End Function + + 134217984 + + 0 + 1 + id as Integer + DataFile.tbl_verpackungen + + + + +tbl_werk +460902990 +1 +DataFile.ActiveRecordBase +1 +0 + + +uid + +1 + +134217984 +uid As Integer + + +134217984 +uid As Integer +0 +0 + + +namebezeichnung + +1 + +134217984 +namebezeichnung As String + + +134217984 +namebezeichnung As String +0 +0 + + +namezusatz + +1 + +134217984 +namezusatz As String + + +134217984 +namezusatz As String +0 +0 + + +strasse + +1 + +134217984 +strasse As String + + +134217984 +strasse As String +0 +0 + + +strassezusatz + +1 + +134217984 +strassezusatz As String + + +134217984 +strassezusatz As String +0 +0 + + +plz + +1 + +134217984 +plz As String + + +134217984 +plz As String +0 +0 + + +ort + +1 + +134217984 +ort As String + + +134217984 +ort As String +0 +0 + + +laenderid + +1 + +134217984 +laenderid As String + + +134217984 +laenderid As String +0 +0 + + +deleted + +1 + +134217984 +deleted As Integer + + +134217984 +deleted As Integer +0 +0 + + +active + +1 + +134217984 +active As Integer + + +134217984 +active As Integer +0 +0 + + +lastuser_uid + +1 + +134217984 +lastuser_uid As Integer + + +134217984 +lastuser_uid As Integer +0 +0 + + +system_created + +1 + +134217984 +system_created As Date + + +134217984 +system_created As Date +0 +0 + + +system_deleted + +1 + +134217984 +system_deleted As Date + + +134217984 +system_deleted As Date +0 +0 + + +system_lastedit + +1 + +134217984 +system_lastedit As Date + + +134217984 +system_lastedit As Date +0 +0 + + List 1 134217984 Shared Function List(sCriteria as string = "", sOrderBy as string = "") As DataFile.tbl_werk() //Usage: // dim arotbl_werk() as DataFile.tbl_werk = DataFile.tbl_werk.List("fieldName = somevalue", "fieldName") dim arotbl_werk() as DataFile.tbl_werk dim s as string s = "select * From tbl_werk " if sCriteria <> "" then s = s + " WHERE " + sCriteria end if sOrderBy.trim <> "" then s = s + " ORDER BY " + sOrderBy end dim rs as RecordSet = gDB.SQLSelect(s) If gdb.error then break System.debugLog gDB.ErrorMessage return arotbl_werk end do until rs.EOF dim oRecord as new DataFile.tbl_werk oRecord.ReadRecord(rs) arotbl_werk.Append(oRecord) rs.MoveNext loop return arotbl_werk End Function 134217984 0 1 sCriteria as string = "", sOrderBy as string = "" DataFile.tbl_werk() + + FindByID + + 1 + + 134217984 + Shared Function FindByID(id as Integer) As DataFile.tbl_werk + //Usage: + //dim tbl_werk as DataFile.tbl_werk = DataFile.tbl_werk.FindByID( id ) + dim s as string + s = "Select * from tbl_werk WHERE uid = " + str(id) + + dim rs as RecordSet = gDB.SQLSelect(s) + + if gdb.error then + System.debugLog gDB.ErrorMessage + return nil + end + if rs.RecordCount = 0 then return nil + + dim tbl_werk as new DataFile.tbl_werk + tbl_werk.ReadRecord(rs) + return tbl_werk + + End Function + + 134217984 + + 0 + 1 + id as Integer + DataFile.tbl_werk + + + + +tbl_zusammengefasste_bestellungen +460902990 +1 +DataFile.ActiveRecordBase +1 +0 + + +master_uid + +1 + +134217984 +master_uid As Integer + + +134217984 +master_uid As Integer +0 +0 + + +child_uid + +1 + +134217984 +child_uid As Integer + + +134217984 +child_uid As Integer +0 +0 + + +lastuser_uid + +1 + +134217984 +lastuser_uid As Integer + + +134217984 +lastuser_uid As Integer +0 +0 + + +system_created + +1 + +134217984 +system_created As Date + + +134217984 +system_created As Date +0 +0 + + +system_lastedit + +1 + +134217984 +system_lastedit As Date + + +134217984 +system_lastedit As Date +0 +0 + + List 1 134217984 Shared Function List(sCriteria as string = "", sOrderBy as string = "") As DataFile.tbl_zusammengefasste_bestellungen() //Usage: // dim arotbl_zusammengefasste_bestellungen() as DataFile.tbl_zusammengefasste_bestellungen = DataFile.tbl_zusammengefasste_bestellungen.List("fieldName = somevalue", "fieldName") dim arotbl_zusammengefasste_bestellungen() as DataFile.tbl_zusammengefasste_bestellungen dim s as string s = "select * From tbl_zusammengefasste_bestellungen " if sCriteria <> "" then s = s + " WHERE " + sCriteria end if sOrderBy.trim <> "" then s = s + " ORDER BY " + sOrderBy end dim rs as RecordSet = gDB.SQLSelect(s) If gdb.error then break System.debugLog gDB.ErrorMessage return arotbl_zusammengefasste_bestellungen end do until rs.EOF dim oRecord as new DataFile.tbl_zusammengefasste_bestellungen oRecord.ReadRecord(rs) arotbl_zusammengefasste_bestellungen.Append(oRecord) rs.MoveNext loop return arotbl_zusammengefasste_bestellungen End Function 134217984 0 1 sCriteria as string = "", sOrderBy as string = "" DataFile.tbl_zusammengefasste_bestellungen() + + FindByID + + 1 + + 134217984 + Shared Function FindByID(id as Integer) As DataFile.tbl_zusammengefasste_bestellungen + //Usage: + //dim tbl_zusammengefasste_bestellungen as DataFile.tbl_zusammengefasste_bestellungen = DataFile.tbl_zusammengefasste_bestellungen.FindByID( id ) + dim s as string + s = "Select * from tbl_zusammengefasste_bestellungen WHERE = " + str(id) + + dim rs as RecordSet = gDB.SQLSelect(s) + + if gdb.error then + System.debugLog gDB.ErrorMessage + return nil + end + if rs.RecordCount = 0 then return nil + + dim tbl_zusammengefasste_bestellungen as new DataFile.tbl_zusammengefasste_bestellungen + tbl_zusammengefasste_bestellungen.ReadRecord(rs) + return tbl_zusammengefasste_bestellungen + + End Function + + 134217984 + + 0 + 1 + id as Integer + DataFile.tbl_zusammengefasste_bestellungen + + + + \ No newline at end of file diff --git a/ActiveRecordTest/steinickev4.xojo_binary_project b/ActiveRecordTest/steinickev4.xojo_binary_project index 476fedd..1aade4c 100644 Binary files a/ActiveRecordTest/steinickev4.xojo_binary_project and b/ActiveRecordTest/steinickev4.xojo_binary_project differ diff --git a/Log/Logistik.log b/Log/Logistik.log index ec5d628..4e6d1ac 100644 --- a/Log/Logistik.log +++ b/Log/Logistik.log @@ -70,3 +70,7 @@ 2016-04-20 12:51:43 1 MAIN Erfolgreich Initialisiert 2016-04-20 12:53:19 1 MAIN Erfolgreich Initialisiert 2016-04-20 12:55:24 1 MAIN Erfolgreich Initialisiert +2016-04-27 08:08:55 1 MAIN Erfolgreich Initialisiert +2016-04-27 08:31:23 1 MAIN Erfolgreich Initialisiert +2016-04-27 08:31:24 1 MAIN Erfolgreich Initialisiert +2016-04-27 10:16:55 1 MAIN Erfolgreich Initialisiert diff --git a/Steinicke-Logistik.xojo_binary_project b/Steinicke-Logistik.xojo_binary_project index 42536eb..5da026f 100644 Binary files a/Steinicke-Logistik.xojo_binary_project and b/Steinicke-Logistik.xojo_binary_project differ diff --git a/TODO.txt b/TODO.txt index e60a45c..48710e8 100644 --- a/TODO.txt +++ b/TODO.txt @@ -139,6 +139,7 @@ kundenstamm tbl_kunden SQL: Export in TempDatenbank analysenzertifikatzuauslieferungsschein tbl_coa Neues Feld deleted SMALLINT + Neues Feld active SMALLINT Neues Feld lastuser_uid SMALLINT Anpassung Feld system_datum -> system_created DATETIME Anpassung Feld system_deleted DATETIME @@ -148,6 +149,7 @@ analysenzertifikatzuauslieferungsschein tbl_coa Neues Feld deleted SMALLINT analysenzertifikatzuauslieferungsscheinbestellung tbl_coa_bestellung Neues Feld deleted SMALLINT Neues Feld lastuser_uid SMALLINT + Neues Feld active SMALLINT Anpassung Feld system_datum -> system_created DATETIME Anpassung Feld system_deleted DATETIME Anpassung Feld system_editierdatum -> system_lastedit DATETIME @@ -178,7 +180,9 @@ speditionen_adressen tbl_speditionen_adressen Neues Feld deleted SMALLINT Entfernung Feld speditionemail6 -> email6 speditionen tbl_speditionen Neues Feld deleted SMALLINT + Neues Feld active SMALLINT Neues Feld lastuser_uid SMALLINT + Neues Feld active SMALLINT Anpassung Feld speditionname -> titel Anpassung Feld speditionnamezusatz -> name1 Anpassung Feld speditionstrasse -> strasse @@ -215,6 +219,7 @@ speditionen tbl_speditionen Neues Feld deleted SMALLINT bestellungen tbl_bestellungen Neues Feld deleted SMALLINT Neues Feld lastuser_uid SMALLINT + Neues Feld active SMALLINT SQL: update tbl_bestellungen SET system_deleted = Null, system_editierdatum=Null,system_datum= Null Anpassung Feld system_datum -> system_created DATETIME Anpassung Feld system_deleted DATETIME @@ -240,6 +245,7 @@ bestellungen tbl_bestellungen Neues Feld deleted SMALLINT auslieferungsscheinezubestellungen tbl_auslieferungsschein_bestellung Neues Feld deleted SMALLINT Neues Feld lastuser_uid SMALLINT + Neues Feld active SMALLINT SQL: update tbl_auslieferungsschein_bestellung SET system_deleted = Null, system_editierdatum=Null,system_datum= Null Anpassung Feld system_datum -> system_created DATETIME Anpassung Feld system_deleted DATETIME @@ -349,6 +355,7 @@ auslieferungsscheinezubestellungen tbl_auslieferungsschein_bestellung Neues Fel auslieferungsscheine tbl_auslieferungsscheine Neues Feld deleted SMALLINT Neues Feld lastuser_uid SMALLINT + Neues Feld active SMALLINT '############### @@ -509,7 +516,10 @@ mikrobiologiezuauslieferungsschein tbl_mikrobiologie_auslieferungsschein Anpassung Feld mikrobiologie_spezifikation_text -> mikrobiologie_spezifikation Anpassung Feld mikrobiologie_coa_checked -> mikrobiologie_coa_checked SMALLINT Neues Feld lastuser_uid SMALLINT + Neues Feld deleted SMALLINT + Neues Feld active SMALLINT Neues Feld system_created DATETIME + Neues Feld system_deleted DATETIME Neues Feld system_lastedit DATETIME mikrobiologiezuauslieferungsscheinbestellung tbl_mikrobiologie_bestellung @@ -517,16 +527,44 @@ mikrobiologiezuauslieferungsscheinbestellung tbl_mikrobiologie_bestellung Anpassung Feld mikrobiologie_spezifikation_text -> mikrobiologie_spezifikation Anpassung Feld mikrobiologie_coa_checked -> mikrobiologie_coa_checked SMALLINT Neues Feld lastuser_uid SMALLINT + Neues Feld deleted SMALLINT + Neues Feld active SMALLINT Neues Feld system_created DATETIME + Neues Feld system_deleted DATETIME Neues Feld system_lastedit DATETIME -cmrzubestellung tbl_cmr_bestellung - SQL: UPDATE cmrzubestellung AS CMR, tbl_kunden_adressen AS ADR ,tbl_bestellungen AS BST SET CMR.kundenanschrift_uid = ADR.uid WHERE CMR.bestellung_uid=BST.uid and ADR.kunden_uid = BST.kunden_uid and CMR.kundenanschrift_uid=ADR.dummy_uid +cmrzubestellung tbl_cmr Neues Feld kunden_uid INT + SQL: UPDATE cmrzubestellung AS CMR, tbl_bestellungen AS BST SET CMR.kunden_uid = BST.kunden_uid WHERE CMR.bestellung_uid=BST.uid + SQL: UPDATE cmrzubestellung AS CMR, tbl_kunden_adressen AS BST SET CMR.kundenanschrift_uid = BST.uid WHERE CMR.kunden_uid=BST.kunden_uid AND CMR.kundenanschrift_uid=BST.dummy_uid Anpassung Feld werk_uid -> benutzerwerk_uid Anpassung Feld mikrobiologie_spezifikation_text -> mikrobiologie_spezifikation Neues Feld kundenanschrift_uid -> kunden_adressen_uid INT + Neues Feld lastuser_uid SMALLINT + Neues Feld deleted SMALLINT + Neues Feld active SMALLINT Neues Feld system_created DATETIME + Neues Feld system_deleted DATETIME Neues Feld system_lastedit DATETIME - + +transport_ust_zubestellung tbl_transport_ust Neues Feld kunden_uid INT + SQL: UPDATE transport_ust_zubestellung AS CMR, tbl_bestellungen AS BST SET CMR.kunden_uid = BST.kunden_uid WHERE CMR.bestellung_uid=BST.uid + SQL: UPDATE transport_ust_zubestellung AS CMR, tbl_kunden_adressen AS BST SET CMR.kundenanschrift_uid = BST.uid WHERE CMR.kunden_uid=BST.kunden_uid AND CMR.kundenanschrift_uid=BST.dummy_uid + Anpassung Feld werk_uid -> benutzerwerk_uid INT + Anpassung Feld spedition_uid INT + Anpassung Feld speditionsanschrift_text -> spedition_adresse + Anpassung Feld lieferanschrift_text -> liefer_adresse + Anpassung Feld artikel_bestellung_uid -> artikel_beschreibung + Anpassung Feld auslieferungsdatum -> auslieferungs_datum + Anpassung Feld lieferungamdatum -> anlieferungs_datum + SQL: UPDATE tbl_transport_ust SET anlieferungs_datum=Null WHERE anlieferungs_datum='' + Anpassung Feld menge -> mengen_angaben + Anpassung Feld gewicht -> gewicht_angaben + Neues Feld kundenanschrift_uid -> kunden_adressen_uid INT + Neues Feld lastuser_uid SMALLINT + Neues Feld deleted SMALLINT + Neues Feld active SMALLINT + Neues Feld system_created DATETIME + Neues Feld system_deleted DATETIME + Neues Feld system_lastedit DATETIME \ No newline at end of file diff --git a/Xojo-Restful-Server/Builds - Restful-Service.xojo_binary_project/Windows/Steinicke-Logistik-Webservice/Log/Errors.log b/Xojo-Restful-Server/Builds - Restful-Service.xojo_binary_project/Windows/Steinicke-Logistik-Webservice/Log/Errors.log index 14ba325..8afa6bf 100644 --- a/Xojo-Restful-Server/Builds - Restful-Service.xojo_binary_project/Windows/Steinicke-Logistik-Webservice/Log/Errors.log +++ b/Xojo-Restful-Server/Builds - Restful-Service.xojo_binary_project/Windows/Steinicke-Logistik-Webservice/Log/Errors.log @@ -10,3 +10,4 @@ 2016-04-20 11:40:43 1 Unauthorisierter (Benutzer nicht existent) Aufruf von IP: 127.0.0.1 . 2016-04-20 11:42:01 1 MySQL server has gone away 2016-04-20 11:42:01 1 Unauthorisierter (Benutzer nicht existent) Aufruf von IP: 127.0.0.1 . +2016-04-27 10:16:43 1 Unauthorisierter (Benutzer nicht existent) Aufruf von IP: 127.0.0.1 . diff --git a/Xojo-Restful-Server/Builds - Restful-Service.xojo_binary_project/Windows/Steinicke-Logistik-Webservice/Log/Logistik.log b/Xojo-Restful-Server/Builds - Restful-Service.xojo_binary_project/Windows/Steinicke-Logistik-Webservice/Log/Logistik.log index 20f6b7c..753da7e 100644 --- a/Xojo-Restful-Server/Builds - Restful-Service.xojo_binary_project/Windows/Steinicke-Logistik-Webservice/Log/Logistik.log +++ b/Xojo-Restful-Server/Builds - Restful-Service.xojo_binary_project/Windows/Steinicke-Logistik-Webservice/Log/Logistik.log @@ -25,3 +25,11 @@ 2016-04-20 12:51:43 1 USER Benutzeranmeldung von: sbecker 2016-04-20 12:53:19 1 USER Benutzeranmeldung von: sbecker 2016-04-20 12:55:22 1 USER Benutzeranmeldung von: sbecker +2016-04-27 08:07:36 1 DB Datenbank Verbindung erfolgreich. +2016-04-27 08:07:36 1 WEBSERVICE Erfolgreich Initialisiert +2016-04-27 08:08:10 1 DB Datenbank Verbindung erfolgreich. +2016-04-27 08:08:10 1 WEBSERVICE Erfolgreich Initialisiert +2016-04-27 08:08:44 1 USER Benutzeranmeldung von: sbecker +2016-04-27 08:08:44 1 ADMIN Benutzeranmeldung von: sbecker +2016-04-27 10:16:55 1 USER Benutzeranmeldung von: sbecker +2016-04-27 10:16:55 1 ADMIN Benutzeranmeldung von: sbecker diff --git a/Xojo-Restful-Server/Builds - Restful-Service.xojo_binary_project/Windows/Steinicke-Logistik-Webservice/Steinicke-Logistik-Webservice.exe b/Xojo-Restful-Server/Builds - Restful-Service.xojo_binary_project/Windows/Steinicke-Logistik-Webservice/Steinicke-Logistik-Webservice.exe index 2dca1f1..5dd72c4 100644 Binary files a/Xojo-Restful-Server/Builds - Restful-Service.xojo_binary_project/Windows/Steinicke-Logistik-Webservice/Steinicke-Logistik-Webservice.exe and b/Xojo-Restful-Server/Builds - Restful-Service.xojo_binary_project/Windows/Steinicke-Logistik-Webservice/Steinicke-Logistik-Webservice.exe differ diff --git a/Xojo-Restful-Server/Restful-Service.xojo_binary_project b/Xojo-Restful-Server/Restful-Service.xojo_binary_project index fe87f23..bbef568 100644 Binary files a/Xojo-Restful-Server/Restful-Service.xojo_binary_project and b/Xojo-Restful-Server/Restful-Service.xojo_binary_project differ diff --git a/config.ini b/config.ini index a5946b9..095f37d 100644 --- a/config.ini +++ b/config.ini @@ -1,6 +1,17 @@ [Messages] RunOnce0=1 -[Webservice] +[Prod-Webservice] +WS-Label=Produktiv-System WS-Port=8080 WS-URL=127.0.0.1 + +[Test-Webservice] +WSTEST-Label=Test-System +WSTEST-Port=8081 +WSTEST-URL=127.0.0.1 + + +[Logging] +Loglevel=1 +#LogLevel 1=Voll, 2=Nur Fehler, 0=aus