Cornerstone.Database.Tables.DatabaseTable.LoadByRow C# (CSharp) Method

LoadByRow() public method

public LoadByRow ( SQLite.NET.SQLiteResultSet row ) : void
row SQLite.NET.SQLiteResultSet
return void
        public void LoadByRow(SQLiteResultSet.Row row)
        {
            RetrievalInProcess = true;
            ReadOnlyCollection<DBField> fieldList = DBField.GetFieldList(this.GetType());

            // load each field one at a time. they should have been retrieved in the
            // ordering in FieldList
            int i;
            for (i = 0; i < fieldList.Count; i++) {
                if (row.fields[i] == "")
                    fieldList[i].SetValue(this, null);
                else
                    fieldList[i].SetValue(this, row.fields[i]);
            }

            // id is always at the end, assign that too
            id = int.Parse(row.fields[i]);

            // all values are in sync with DB so no commit needed.
            commitNeeded = false;
            RetrievalInProcess = false;
        }