public OrganizationScale GetOrganizationScale(string OrganizationScaleName)
 {
     return(GetSingleOrganizationScale("Select_OrganizationScale", " OrganizationScaleName='" + OrganizationScaleID.ToString() + "'", ""));
 }
        public OrganizationScale SaveOrganizationScale()
        {
            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 = "InsertUpdate_OrganizationScale";
                command.Parameters.Add(dbconn.GenerateParameterObj("@OrganizationScaleID", SqlDbType.Int, OrganizationScaleID.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@OrganizationScaleName", SqlDbType.VarChar, OrganizationScaleName, 200));
                command.Parameters.Add(dbconn.GenerateParameterObj("@OrganizationScaleSample", SqlDbType.VarChar, OrganizationScaleSample, 4000));

                result = command.ExecuteReader();

                result.Read();
                SetReaderToObject(ref result);
            }
            catch
            {
                Exception e = new Exception();
                this._insertUpdateOK = false;
                this._insertUpdateMessage.Append(e.Message.ToString());
                throw e;
            }
            finally
            {
                command.Dispose();
                connection.Close();
            }
            return(this);
        }
        /// <summary>
        /// Delete the OrganizationScale.
        /// </summary>
        /// <returns>Boolean</returns>
        public bool DeleteOrganizationScale()
        {
            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 = "Delete_OrganizationScale";
                command.Parameters.Add(dbconn.GenerateParameterObj("@OrganizationScaleID", SqlDbType.Int, OrganizationScaleID.ToString(), 0));
                result = command.ExecuteReader();
            }
            catch
            {
                Exception e = new Exception();
                this._deleteOK = false;
                this._deletionMessage.Append(e.Message + "                     Inner Exception= " + e.InnerException);
                throw e;
            }
            finally
            {
                command.Dispose();
                connection.Close();
            }
            return(this.DeleteOK);
        }