private void Continue_Exist(object sender, RoutedEventArgs e) { SY_ViewCases wnd = new SY_ViewCases(); wnd.Show(); Close(); }
private void Go_Back(object sender, RoutedEventArgs e) { SY_ViewCases wnd = new SY_ViewCases(); wnd.Show(); this.Close(); }
private void Verify_Next(object sender, RoutedEventArgs e) { //Validation if (!(String.IsNullOrEmpty(case_name.Text))) { if (!(String.IsNullOrEmpty(case_desc.Text))) { if (!(investList.Items.Count == 0)) { CaseDAO db = new CaseDAO(); //Push to next page and ask for network file String CName = case_name.Text; String CDesc = case_desc.Text; if ((CName.Equals(OldCase)) || (db.checkIfCaseName(CName))) { List <String> aList = new List <String>(); for (int i = 0; i < investList.Items.Count; i++) { ListBoxItem item = (ListBoxItem)(investList.ItemContainerGenerator.ContainerFromIndex(i)); aList.Add(item.Content.ToString()); } Case newCase = new Case(CName, CDesc, path); CaseDAO casedb = new CaseDAO(); Boolean checker = casedb.updateToTable(newCase, OldCase); if (checker) { string json = JsonConvert.SerializeObject(aList.ToArray()); System.IO.File.WriteAllText(path, json); } else { System.Console.WriteLine("GAY SHIT"); } SY_ViewCases wnd = new SY_ViewCases(); wnd.Show(); Close(); } else { MessageBox.Show("Case Name Has Already Existed!"); } } else { Console.WriteLine("Null or Empty"); } } else { Console.WriteLine("Null or Empty"); } } else { Console.WriteLine("Null or Empty"); } }