\documentclass{book}
\usepackage{titlesec,xcolor}
\usepackage{lipsum}
\usepackage{tikz}
\usetikzlibrary{shapes.misc}
\newcommand\titlebar{%
\tikz[baseline] {
    \node [
        fill=red,
        anchor= base east,
        minimum height=5.5ex] at (5cm,0) {
        \textbf{\color{white}\arabic{chapter}-\arabic{section}}
    };
}%
}
\titleformat{\section}[block]{\Large\bfseries\color{red}}{\titlebar}{0.5cm}{}[\vspace*{-1ex}\color{red}\hrule height .3ex]%

\makeatletter
\renewcommand\@seccntformat[1]{\csname the#1\endcsname-\quad}
\renewcommand \thesection {\thechapter-\@arabic\c@section}
\renewcommand\thesubsection   {\thesection-\@arabic\c@subsection}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus .2ex}%
                                     {\normalfont\large\bfseries\color{red}}}
\makeatother
\begin{document}
%\tableofcontents
\chapter{First Chapter}
\section{Section one}\label{a1}
\lipsum[1]
\section{Section two}
\lipsum[2]
\subsection{Hello}\label{a2}
A link to \ref{a1} and \ref{a2} ...
\end{document}