public static List <Mail> GetMails(bool isSender, int chosenID) { List <Mail> mailsList = new List <Mail>(); try { DBServiceClient dws = new DBServiceClient(); mailsList = dws.GetMails(isSender, chosenID); dws.Close(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); } return(mailsList); }