private void Button_Click(object sender, RoutedEventArgs e) { if (lvReports.SelectedItem != null) { var row = lvReports.SelectedItem.ToString(); string[] col = row.Split(','); string id = Regex.Match(col[0], @"\d+").Value; if (Convert.ToInt32(id) == 0) { string[] nameSplit = col[1].Split('='); string name = nameSplit[1].Trim(); string[] destinationSplit = col[2].Split('='); string destination = destinationSplit[1].Trim(); string[] dateSplit = col[3].Split('='); string date = dateSplit[1].Trim(); string[] stateSplit = col[4].Split('='); string state = stateSplit[1].Trim().Substring(0, stateSplit[1].Length - 2); HandleItems.SendRapport(Convert.ToInt32(name), Convert.ToInt32(destination), Convert.ToDateTime(date)); rbFilterAll.IsChecked = true; } } }