public List<FormFieldValue> GetAllByFormFieldId(int FormFieldId) { FormFieldValueDAC _formFieldValueComponent = new FormFieldValueDAC(); IDataReader reader = _formFieldValueComponent.GetAllFormFieldValue("FormFieldId = " + FormFieldId).CreateDataReader(); List<FormFieldValue> _formFieldValueList = new List<FormFieldValue>(); while (reader.Read()) { if (_formFieldValueList == null) _formFieldValueList = new List<FormFieldValue>(); FormFieldValue _formFieldValue = new FormFieldValue(); if (reader["FormFieldValueId"] != DBNull.Value) _formFieldValue.FormFieldValueId = Convert.ToInt32(reader["FormFieldValueId"]); if (reader["FormFieldId"] != DBNull.Value) _formFieldValue.FormFieldId = Convert.ToInt32(reader["FormFieldId"]); if (reader["FieldValue"] != DBNull.Value) _formFieldValue.FieldValue = Convert.ToString(reader["FieldValue"]); if (reader["FieldValueHelp"] != DBNull.Value) _formFieldValue.FieldValueHelp = Convert.ToString(reader["FieldValueHelp"]); if (reader["FieldGrade"] != DBNull.Value) _formFieldValue.FieldGrade = Convert.ToInt32(reader["FieldGrade"]); if (reader["IsOther"] != DBNull.Value) _formFieldValue.IsOther = Convert.ToBoolean(reader["IsOther"]); if (reader["ScaleStart"] != DBNull.Value) _formFieldValue.ScaleStart = Convert.ToDecimal(reader["ScaleStart"]); if (reader["ScaleEnd"] != DBNull.Value) _formFieldValue.ScaleEnd = Convert.ToDecimal(reader["ScaleEnd"]); _formFieldValue.NewRecord = false; _formFieldValueList.Add(_formFieldValue); } reader.Close(); return _formFieldValueList; }
public bool Insert(FormFieldValue formfieldvalue) { int autonumber = 0; FormFieldValueDAC formfieldvalueComponent = new FormFieldValueDAC(); bool endedSuccessfuly = formfieldvalueComponent.InsertNewFormFieldValue( ref autonumber, formfieldvalue.FormFieldId, formfieldvalue.FieldValue, formfieldvalue.FieldValueHelp, formfieldvalue.FieldGrade, formfieldvalue.IsOther, formfieldvalue.ScaleStart, formfieldvalue.ScaleEnd); if(endedSuccessfuly) { formfieldvalue.FormFieldValueId = autonumber; } return endedSuccessfuly; }
public bool Update(FormFieldValue formfieldvalue ,int old_formFieldValueId) { FormFieldValueDAC formfieldvalueComponent = new FormFieldValueDAC(); return formfieldvalueComponent.UpdateFormFieldValue( formfieldvalue.FormFieldId, formfieldvalue.FieldValue, formfieldvalue.FieldValueHelp, formfieldvalue.FieldGrade, formfieldvalue.IsOther, formfieldvalue.ScaleStart, formfieldvalue.ScaleEnd, old_formFieldValueId); }
public FormFieldValue GetByID(int _formFieldValueId) { FormFieldValueDAC _formFieldValueComponent = new FormFieldValueDAC(); IDataReader reader = _formFieldValueComponent.GetByIDFormFieldValue(_formFieldValueId); FormFieldValue _formFieldValue = null; while(reader.Read()) { _formFieldValue = new FormFieldValue(); if(reader["FormFieldValueId"] != DBNull.Value) _formFieldValue.FormFieldValueId = Convert.ToInt32(reader["FormFieldValueId"]); if(reader["FormFieldId"] != DBNull.Value) _formFieldValue.FormFieldId = Convert.ToInt32(reader["FormFieldId"]); if(reader["FieldValue"] != DBNull.Value) _formFieldValue.FieldValue = Convert.ToString(reader["FieldValue"]); if(reader["FieldValueHelp"] != DBNull.Value) _formFieldValue.FieldValueHelp = Convert.ToString(reader["FieldValueHelp"]); if(reader["FieldGrade"] != DBNull.Value) _formFieldValue.FieldGrade = Convert.ToInt32(reader["FieldGrade"]); if(reader["IsOther"] != DBNull.Value) _formFieldValue.IsOther = Convert.ToBoolean(reader["IsOther"]); if(reader["ScaleStart"] != DBNull.Value) _formFieldValue.ScaleStart = Convert.ToDecimal(reader["ScaleStart"]); if(reader["ScaleEnd"] != DBNull.Value) _formFieldValue.ScaleEnd = Convert.ToDecimal(reader["ScaleEnd"]); _formFieldValue.NewRecord = false; } reader.Close(); return _formFieldValue; }