Exemple #1
0
        // disabled this method since is not being used anywhere in the system and it adds more overhead to this object
//    public void Add()
//    {


//        DbCommand commandWrapper = GetDbCommand("spr_AddRatingScaleResponse");

//        try
//        {
//            SqlParameter returnParam = new SqlParameter("@newJQResponseID", SqlDbType.Int);
//            returnParam.Direction = ParameterDirection.Output;

//            // get the new JQResponseID of the record
//            commandWrapper.Parameters.Add(returnParam);

//commandWrapper.Parameters.Add(new SqlParameter("@jQResponseNo", this._JQResponseNo));
//commandWrapper.Parameters.Add(new SqlParameter("@jQResponseLetter", this._JQResponseLetter));
//commandWrapper.Parameters.Add(new SqlParameter("@jQResponseText", this._JQResponseText.Trim()));
//commandWrapper.Parameters.Add(new SqlParameter("@jQRatingScaleID", this._JQRatingScaleID));

//            ExecuteNonQuery(commandWrapper);

//            this._JQResponseID  = (int) returnParam.Value;
//          }
//        catch (Exception ex)
//        {
//            HandleException(ex);
//         }
//    }

        // disabled this method since is not being used anywhere in the system and it adds more overhead to this object
//    public void Update()
//    {

//        if (base.ValidateKeyField(this._JQResponseID))
//        {
//            DbCommand commandWrapper = GetDbCommand("spr_UpdateRatingScaleResponse");

//            try
//            {
//commandWrapper.Parameters.Add(new SqlParameter("@jQResponseID", this._JQResponseID));
//commandWrapper.Parameters.Add(new SqlParameter("@jQResponseNo", this._JQResponseNo));
//commandWrapper.Parameters.Add(new SqlParameter("@jQResponseLetter", this._JQResponseLetter));
//commandWrapper.Parameters.Add(new SqlParameter("@jQResponseText", this._JQResponseText.Trim()));
//commandWrapper.Parameters.Add(new SqlParameter("@jQRatingScaleID", this._JQRatingScaleID));

//                ExecuteNonQuery(commandWrapper);
//            }
//            catch (Exception ex)
//            {
//                HandleException(ex);
//            }
//        }
//    }

//    public void Delete()
//    {
//        if (base.ValidateKeyField(this._JQResponseID))
//        {
//            try
//            {
//                ExecuteNonQuery("spr_DeleteRatingScaleResponse", this._JQResponseID);
//            }
//            catch (Exception ex)
//            {
//                HandleException(ex);
//            }
//        }
//    }

        #endregion

        #region Collection Helper Methods

        internal static List <RatingScaleResponse> GetCollection(DataTable dataItems)
        {
            List <RatingScaleResponse> listCollection = new List <RatingScaleResponse>();
            RatingScaleResponse        current        = null;

            if (dataItems != null)
            {
                for (int i = 0; i < dataItems.Rows.Count; i++)
                {
                    current = new RatingScaleResponse(dataItems.Rows[i]);
                    listCollection.Add(current);
                }
            }
            else
            {
                throw new Exception("You cannot create a RatingScaleResponse collection from a null data table.");
            }

            return(listCollection);
        }
Exemple #2
0
        /// <summary>
        /// Determines whether the specified System.Object is equal to the current object.
        /// </summary>
        /// <param name="obj">The System.Object to compare with the current object.</param>
        /// <returns>Returns true if the specified System.Object is equal to the current object; otherwise, false.</returns>
        public override bool Equals(Object obj)
        {
            RatingScaleResponse RatingScaleResponseobj = obj as RatingScaleResponse;

            return((RatingScaleResponseobj == null) ? false : (this.JQResponseID == RatingScaleResponseobj.JQResponseID));
        }