;;****************************************************************************
;; WARNING: This code was code generated. Any changes that you
;; make to this code will be overwritten if the code is regenerated!
;;
;; Template author: Richard C. Morris : RCP Consultants.
;;
;; Template Name: Symphony Framework : SYMPHONY_FILEIO_V3_2.tpl
;;****************************************************************************
import System
import System.Collections.Generic
import System.Text
import Symphony.Core
import Symphony.Conductor.Model
import Symphony.Conductor.DataIO
import ControlLibrary.Data
namespace ControlLibrary.Data
;;we will define a tag value, if we have tags defined for the structure
public class Part_FileIO extends FileIO
;;; <summary>
;;; Default constructor openes the data file in input mode
;;; </summary>
public method Part_FileIO
endparams
parent(700)
proc
mOpenMode = FileOpenMode.Input
openTheFile("SYMPHONYDATA:parts.ism", ^typeof(ControlLibrary.Data.Part_Data_IOHook))
endmethod
;;; <summary>
;;; Alternate constructor accepts the file open mode
;;; </summary>
public method Part_FileIO
in req openMode ,FileOpenMode
endparams
parent(700)
proc
mOpenMode = openMode
openTheFile("SYMPHONYDATA:parts.ism", ^typeof(ControlLibrary.Data.Part_Data_IOHook))
endmethod
protected override method checkInRange ,boolean
in req partArg ,a
endparams
.include 'part' repository , stack record = "part", end
proc
part = partArg
;;do any tag values
.ifdef FILE_HAS_TAGS
if (
& ) then
mreturn true
else
mreturn false
.endc
;;if we get here, we have no tag field!
mreturn true
endmethod
;;this fixes when you are using tags as filters.
.ifdef QAWSEDRFTGYH
.undefine QAWSEDRFTGYH
.endc
;;this logic is only compiled if the structure has a tag value
.ifdef FILE_HAS_TAGS
;;; <summary>
;;; Read the first record from the file and assign the located record to a Symphony Data Object.
;;; </summary>
;;; <param name="dataObject">The _DATAOBJECT_ to propogate with the located data.</param>
;;; <remarks>
;;; The file will be read on the key index that was set by the last read operation, or the default of primary if no previous operation was performed. The record will be locked if the file is opened in update mode and the record is successfully located.
;;; </remarks>
public override method ReadFirstRecord ,FileAccessResults
in req dataObject ,@DataObjectBase
endparams
proc
dataObject.InitData()
mreturn parent.ReadRecord(dataObject)
endmethod
;;; <summary>
;;; Read the first record from the file and assign the located record to a Symphony Data Object.
;;; </summary>
;;; <param name="dataObject">The _DATAOBJECT_ to propogate with the located data.</param>
;;; <remarks>
;;; The file will be read on the key index that was set by the last read operation, or the default of primary if no previous operation was performed.
;;; The record will not be locked. To update the record you should use the UpdateRecordUsingGRFA method.
;;; </remarks>
public override method ReadFirstRecord ,FileAccessResults
in req dataObject ,@DataObjectBase
in req noLock ,Boolean
endparams
proc
dataObject.InitData()
mreturn parent.ReadRecord(dataObject, noLock)
endmethod
;;; <summary>
;;; Read the last record from the file and assign the located record to a Symphony Data Object.
;;; </summary>
;;; <param name="dataObject">The _DATAOBJECT_ to propogate with the located data.</param>
;;; <remarks>
;;; The file will be read on the key index that was set by the last read operation, or the default of primary if no previous operation was performed. The record will be locked if the file is opened in update mode and the record is successfully located.
;;; </remarks>
public override method ReadLastRecord ,FileAccessResults
in req dataObject ,@DataObjectBase
endparams
proc
dataObject.InitData()
((@Part_Data)dataObject).Id = "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ"
parent.ReadRecord(dataObject, true)
mreturn parent.ReadPrevRecord(dataObject)
endmethod
;;; <summary>
;;; Read the last record from the file and assign the located record to a Symphony Data Object.
;;; </summary>
;;; <param name="dataObject">The _DATAOBJECT_ to propogate with the located data.</param>
;;; <remarks>
;;; The file will be read on the key index that was set by the last read operation, or the default of primary if no previous operation was performed.
;;; The record will not be locked. To update the record you should use the UpdateRecordUsingGRFA method.
;;; </remarks>
public override method ReadLastRecord ,FileAccessResults
in req dataObject ,@DataObjectBase
in req noLock ,Boolean
endparams
record
far ,FileAccessResults
endrecord
proc
dataObject.InitData()
((@Part_Data)dataObject).Id = "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ"
parent.ReadRecord(dataObject, true)
mreturn parent.ReadPrevRecord(dataObject)
endmethod
;;; <summary>
;;; Read a record from the file and assign the located record to a Symphony Data Object.
;;; </summary>
;;; <param name="dataObject">The _DATAOBJECT_ to use as the key value and to propogate with the located data.</param>
;;; <remarks>
;;; Given the passed _DATAOBJECT_ the key value will be extracted. This key value will then be used to locate the matching record in the file. The file will be read on the primary key index.
;;; The record will be locked if the file is opened in update mode and the record is successfully located.
;;; </remarks>
public override method ReadRecord ,FileAccessResults
in req dataObject ,@DataObjectBase
endparams
proc
mreturn parent.ReadRecord(dataObject)
endmethod
;;; <summary>
;;; Read a record from the file and assign the located record to a Symphony Data Object, but do not lock the record.
;;; </summary>
;;; <param name="dataObject">The _DATAOBJECT_ to use as the key value and to propogate with the located data.</param>
;;; <remarks>
;;; Given the passed _DATAOBJECT_ the key value will be extracted. This key value will them be used to locate the matching record in the file. The file will be read on the primary key index. The
;;; record will not be locked. To subsequently perform an update, call the UpdateRecordUsingGRFA method.
;;; </remarks>
public override method ReadRecord ,FileAccessResults
in req dataObject ,@DataObjectBase
in req noLock ,Boolean
endparams
proc
mreturn parent.ReadRecord(dataObject, noLock)
endmethod
;;; <summary>
;;; Update the currently locked record the file.
;;; </summary>
;;; <param name="dataObject">The _DATAOBJECT_ to use as the value and to update the locked record.</param>
;;; <remarks>
;;; Given the passed _DATAOBJECT_ the data will be extracted and used to update the currently locked record.
;;; </remarks>
public override method UpdateRecord ,FileAccessResults
in req dataObject ,@DataObjectBase
endparams
proc
mreturn parent.UpdateRecord(dataObject)
endmethod
;;; <summary>
;;; Update the record to referecned by it's Global RFA.
;;; </summary>
;;; <param name="dataObject">The _DATAOBJECT_ to use as the value and to locate and updated the record.</param>
;;; <remarks>
;;; Given the passed _DATAOBJECT_ the data will be extracted and used to loate and update the record.
;;; </remarks>
public override method UpdateRecordUsingGRFA ,FileAccessResults
in req dataObject ,@DataObjectBase
endparams
proc
mreturn parent.UpdateRecordUsingGRFA(dataObject)
endmethod
;;; <summary>
;;; Create a new record within the data files.
;;; </summary>
;;; <remarks>
;;; The passed-in _DATAOBJECT_ will will be created in the data files.
;;; </remarks>
public override method CreateRecord ,FileAccessResults
in req dataObject ,@DataObjectBase
endparams
proc
mreturn parent.CreateRecord(dataObject)
endmethod
.ifdef FILE_HAS_TAGS
.undefine FILE_HAS_TAGS
.endc
.endc
endclass
endnamespace