Example #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_AddJobQuestionnaireFactor");

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

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

        //        if (this._JQFactorTypeID == -1)
        //            commandWrapper.Parameters.Add(new SqlParameter("@JQFactorTypeID", DBNull.Value));
        //        else
        //            commandWrapper.Parameters.Add(new SqlParameter("@JQFactorTypeID", this._JQFactorTypeID));

        //        if (string.IsNullOrWhiteSpace(this._JQFactorTitle))
        //            commandWrapper.Parameters.Add(new SqlParameter("@JQFactorTitle", DBNull.Value));
        //        else
        //            commandWrapper.Parameters.Add(new SqlParameter("@JQFactorTitle", this._JQFactorTitle.Trim()));

        //        if (string.IsNullOrWhiteSpace(this._JQFactorInstruction))
        //            commandWrapper.Parameters.Add(new SqlParameter("@JQFactorInstruction", DBNull.Value));
        //        else
        //            commandWrapper.Parameters.Add(new SqlParameter("@JQFactorInstruction", this._JQFactorInstruction.Trim()));

        //        commandWrapper.Parameters.Add(new SqlParameter("@IsSF", this._isSF));

        //        if (this._JQID == -1)
        //            commandWrapper.Parameters.Add(new SqlParameter("@JQID", DBNull.Value));
        //        else
        //            commandWrapper.Parameters.Add(new SqlParameter("@JQID", this._JQID));

        //        if (this._KSAID == -1)
        //            commandWrapper.Parameters.Add(new SqlParameter("@KSAID", DBNull.Value));
        //        else
        //            commandWrapper.Parameters.Add(new SqlParameter("@KSAID", this._KSAID));

        //        if (this.CreatedByID == -1)
        //            commandWrapper.Parameters.Add(new SqlParameter("@CreatedByID", DBNull.Value));
        //        else
        //            commandWrapper.Parameters.Add(new SqlParameter("CreatedByID", this.CreatedByID));

        //        ExecuteNonQuery(commandWrapper);

        //        this._JQFactorID = (long)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._JQFactorID))
        //    {
        //        DbCommand commandWrapper = GetDbCommand("spr_UpdateJobQuestionnaireFactor");

        //        try
        //        {
        //            if (this._JQFactorID == -1)
        //                commandWrapper.Parameters.Add(new SqlParameter("@JQFactorID", DBNull.Value));
        //            else
        //                commandWrapper.Parameters.Add(new SqlParameter("@JQFactorID", this._JQFactorID));

        //            if (this._JQFactorTypeID == -1)
        //                commandWrapper.Parameters.Add(new SqlParameter("@JQFactorTypeID", DBNull.Value));
        //            else
        //                commandWrapper.Parameters.Add(new SqlParameter("@JQFactorTypeID", this._JQFactorTypeID));

        //            if (string.IsNullOrWhiteSpace(this._JQFactorTitle))
        //                commandWrapper.Parameters.Add(new SqlParameter("@JQFactorTitle", DBNull.Value));
        //            else
        //                commandWrapper.Parameters.Add(new SqlParameter("@JQFactorTitle", this._JQFactorTitle.Trim()));

        //            if (string.IsNullOrWhiteSpace(this._JQFactorInstruction))
        //                commandWrapper.Parameters.Add(new SqlParameter("@JQFactorInstruction", DBNull.Value));
        //            else
        //                commandWrapper.Parameters.Add(new SqlParameter("@JQFactorInstruction", this._JQFactorInstruction.Trim()));

        //            commandWrapper.Parameters.Add(new SqlParameter("@IsSF", this._isSF));

        //            commandWrapper.Parameters.Add(new SqlParameter("@UpdatedByID", this.UpdatedByID));

        //            ExecuteNonQuery(commandWrapper);
        //        }
        //        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 Delete()
        //{
        //    if (base.ValidateKeyField(this._JQFactorID))
        //    {
        //        try
        //        {
        //            ExecuteNonQuery("spr_DeleteJQFactor", this._JQFactorID);
        //        }
        //        catch (Exception ex)
        //        {
        //            HandleException(ex);
        //        }
        //    }
        //}

        #endregion

        #region Collection Methods

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

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

            return(listCollection);
        }
Example #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)
        {
            JQFactor JQFactorobj = obj as JQFactor;

            return((JQFactorobj == null) ? false : (this.JQFactorID == JQFactorobj.JQFactorID));
        }