A man accused of shooting his brother-in-law during a shotgun rampage stabbed his wife 'everywhere he could' after discovering 'flirty' texts on her phone, a court heard.