// ===================================================================================== /// <summary> /// This class provides a list of trial types. /// </summary> /// <returns>string: a value of a selected field name</returns> /// <remarks> /// This method consists of the following steps: /// /// 1. Initialise a fieldname object /// /// 2. Try parse Fieldname string into an enumerated fieldname /// /// 3. Switch fieldname and update value defining by the subject record field names /// </remarks> // ------------------------------------------------------------------------------------ public string getValue(string FieldName) { // // Initialise a fieldname object // SubjectRecordFieldNames fieldname = SubjectRecordFieldNames.Null; // // Try parse Fieldname string into an enumerated fieldname // try { fieldname = (SubjectRecordFieldNames)Enum.Parse(typeof(SubjectRecordFieldNames), FieldName); } catch { fieldname = SubjectRecordFieldNames.Null; } // // Switch fieldname and update value defining by the subject record field names // switch (fieldname) { case SubjectRecordFieldNames.TrialId: return(this._ProjectId); case SubjectRecordFieldNames.SubjectId: return(this._SubjectId); case SubjectRecordFieldNames.VisitId: return(this._VisitId); case SubjectRecordFieldNames.Subject: return(this._Subject); case SubjectRecordFieldNames.Record: return(this._Record); case SubjectRecordFieldNames.RecordDate: return(this._RecordDate.ToString("d MMM yyyy")); case SubjectRecordFieldNames.Status: return(this.StateDesc); default: { return(String.Empty); } //END Default } //END Switch } //END getValue method
} //END getValue method // ===================================================================================== /// <summary> /// This method sets the field value. /// </summary> /// <param name="FieldName">string: a field name</param> /// <param name="Value">string: a retrieved value</param> /// <remarks> /// This method consists of the following steps: /// /// 1. Initialise a fieldname object /// /// 2. Try parse Fieldname string into an enumerated fieldname /// /// 3. Switch fieldname and update value defining by the subject record field names /// </remarks> // ------------------------------------------------------------------------------------ public void setValue(string FieldName, string Value) { // // Initialise the methods variables and objects. // DateTime date = EvcStatics.CONST_DATE_NULL; //float fltValue = 0; //int intValue = 0; //bool bValue = false; SubjectRecordFieldNames fieldname = SubjectRecordFieldNames.Null; // // Try parse FieldName string into an enumerated fieldname object // try { fieldname = (SubjectRecordFieldNames)Enum.Parse(typeof(SubjectRecordFieldNames), FieldName); } catch { fieldname = SubjectRecordFieldNames.Null; } // // Switch fieldname and update value defining by the subject record field names // switch (fieldname) { case SubjectRecordFieldNames.TrialId: this._ProjectId = Value; return; case SubjectRecordFieldNames.SubjectId: this._SubjectId = Value; return; case SubjectRecordFieldNames.VisitId: this._VisitId = Value; return; case SubjectRecordFieldNames.RecordDate: { if (DateTime.TryParse(Value, out date) == true) { this._RecordDate = date; } return; } case SubjectRecordFieldNames.Subject: { this._Subject = Value; return; } case SubjectRecordFieldNames.Record: { this._Record = Value; return; } default: { return; } } //END Switch } //END setValue method