internal override MaterialFamily ConvertRow(IRfcStructure row) { MaterialFamily output = new MaterialFamily(); string[] data = row.GetString("WA").Split(_separator); string fullcode = data[0]; if (fullcode.Length != 18) { return(null); } string l1code = fullcode.Substring(0, 6), l2code = fullcode.Substring(6, 6), l3code = fullcode.Substring(12, 6); MaterialFamilyLevel l1 = new MaterialFamilyLevel() { Level = 1, Code = l1code }; MaterialFamilyLevel l2 = new MaterialFamilyLevel() { Level = 2, Code = l2code }; MaterialFamilyLevel l3 = new MaterialFamilyLevel() { Level = 3, Code = l3code }; output = new MaterialFamily() { L1 = l1, L2 = l2, L3 = l3 }; return(output); }
protected override MaterialFamilyLevel SetPrimaryKeyForExistingRecord(MaterialFamilyLevel record) { record.ID = RecordIndex[GetIndexKey(record)].ID; return(base.SetPrimaryKeyForExistingRecord(record)); }
protected override Tuple <int, string> GetIndexKey(MaterialFamilyLevel record) => new Tuple <int, string>(record.Level, record.Code);