private void SetReaderToObject(ref OrganizationScale objOrganizationScale, ref SqlDataReader result)
 {
     if (result.HasRows)
     {
         objOrganizationScale.OrganizationScaleID     = (int)result.GetValue(result.GetOrdinal("OrganizationScaleID"));
         objOrganizationScale.OrganizationScaleName   = result.GetValue(result.GetOrdinal("OrganizationScaleName")).ToString();
         objOrganizationScale.OrganizationScaleSample = result.GetValue(result.GetOrdinal("OrganizationScaleSample")).ToString();
     }
 }
        /// <summary>
        /// Clones the specified LST OrganizationScale.
        /// </summary>
        /// <param name="lstOrganizationScale">The LST OrganizationScale.</param>
        /// <returns>List<OrganizationScale></returns>
        static public List <OrganizationScale> Clone(List <OrganizationScale> lstOrganizationScale)
        {
            List <OrganizationScale> lstCOrganizationScale = new List <OrganizationScale>();

            foreach (OrganizationScale objOrganizationScale in lstOrganizationScale)
            {
                lstCOrganizationScale.Add(OrganizationScale.Clone(objOrganizationScale));
            }

            return(lstCOrganizationScale);
        }
        private List <OrganizationScale> GetOrganizationScaleList(string strSprocName, string strWhere, string strOrderBy)
        {
            List <OrganizationScale> OrganizationScales = new List <OrganizationScale>();

            SqlDataReader      result;
            DatabaseConnection dbconn     = new DatabaseConnection();
            SqlCommand         command    = new SqlCommand();
            SqlConnection      connection = new SqlConnection(dbconn.SQLSEVERConnString);

            try
            {
                connection.Open();
                command.Connection  = connection;
                command.CommandType = CommandType.StoredProcedure;
                command.CommandText = strSprocName;
                command.Parameters.Add(dbconn.GenerateParameterObj("@strWhere", SqlDbType.VarChar, strWhere, 1000));
                command.Parameters.Add(dbconn.GenerateParameterObj("@strOrderBy", SqlDbType.VarChar, strOrderBy, 1000));
                result = command.ExecuteReader();

                while (result.Read())
                {
                    OrganizationScale objOrganizationScale = new OrganizationScale();
                    SetReaderToObject(ref objOrganizationScale, ref result);
                    OrganizationScales.Add(objOrganizationScale);
                }
            }
            catch
            {
                Exception e = new Exception();
                throw e;
            }
            finally
            {
                command.Dispose();
                connection.Close();
            }
            return(OrganizationScales);
        }
        /// <summary>
        /// Clones the specified object OrganizationScale.
        /// </summary>
        /// <param name="objOrganizationScale">The object OrganizationScale.</param>
        /// <returns>OrganizationScale</returns>
        static public OrganizationScale Clone(OrganizationScale objOrganizationScale)
        {
            OrganizationScale objCOrganizationScale = new OrganizationScale(objOrganizationScale.OrganizationScaleID);

            return(objCOrganizationScale);
        }