Example #1
0
 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;
 }
Example #2
0
 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;
 }
Example #3
0
 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);
 }
Example #4
0
 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;
 }