Example #1
0
 public OrganizationRank GetOrganizationRank(string OrganizationRankName)
 {
     return(GetSingleOrganizationRank("Select_OrganizationRank", " OrganizationRankName='" + OrganizationRankID.ToString() + "'", ""));
 }
Example #2
0
        public OrganizationRank SaveOrganizationRank()
        {
            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_OrganizationRank";
                command.Parameters.Add(dbconn.GenerateParameterObj("@OrganizationRankID", SqlDbType.Int, OrganizationRankID.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@OrganizationID", SqlDbType.Int, OrganizationID.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@OrganizationRankLevel", SqlDbType.Int, OrganizationRankLevel.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@ScoreMin", SqlDbType.Int, ScoreMin.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@ScoreMax", SqlDbType.Int, ScoreMax.ToString(), 0));
                command.Parameters.Add(dbconn.GenerateParameterObj("@Title", SqlDbType.VarChar, Title, 400));
                command.Parameters.Add(dbconn.GenerateParameterObj("@Benefits", SqlDbType.VarChar, Benefits, 4000));
                command.Parameters.Add(dbconn.GenerateParameterObj("@Duties", SqlDbType.Int, Duties, 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);
        }
Example #3
0
        /// <summary>
        /// Delete the OrganizationRank.
        /// </summary>
        /// <returns>Boolean</returns>
        public bool DeleteOrganizationRank()
        {
            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_OrganizationRank";
                command.Parameters.Add(dbconn.GenerateParameterObj("@OrganizationRankID", SqlDbType.Int, OrganizationRankID.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);
        }