private void configRename() { frmInput df = new frmInput(); df.DialogText = "Gib den neuen Konfigurationsname ein:"; df.DialogTitel = "Konfiguration umbenennen"; df.DialogDefaultValue = ds.DataTable1.Rows[cmbKonfiguration.SelectedIndex][ds.DataTable1.ConfigNameColumn.ColumnName].ToString(); df.ShowDialog(); if (df.Konfigurationsname == "") { return; } try { ds.DataTable1.Rows[cmbKonfiguration.SelectedIndex][ds.DataTable1.ConfigNameColumn] = df.Konfigurationsname; ds.WriteXml("./config.xml"); } catch (Exception ex) { webbrowser(ex.Message); } }
private void configAdd() { try { frmInput s = new frmInput(); s.DialogText = "Vergib Deiner Schlachtkonfiguration einen Namen:"; s.DialogTitel = "speichern"; s.ShowDialog(); if (s.Konfigurationsname == "") { return; } DataSet1.DataTable1Row row; row = ds.DataTable1.NewDataTable1Row(); row.ConfigName = s.Konfigurationsname; row.Bandit = rbBandit.Checked; row.Player = rbPlayer.Checked; row.Attacker = txtAngreiferName.Text; row.DefenderName = txtDefenderName.Text; //Angreifer 1 row.AR1 = Convert.ToInt16(txtAR1.Text); row.AB1 = Convert.ToInt16(txtAB1.Text); row.AM1 = Convert.ToInt16(txtAM1.Text); row.AC1 = Convert.ToInt16(txtAC1.Text); row.AL1 = Convert.ToInt16(txtAL1.Text); row.AS1 = Convert.ToInt16(txtAS1.Text); row.AE1 = Convert.ToInt16(txtAE1.Text); row.AA1 = Convert.ToInt16(txtAA1.Text); row.AK1 = Convert.ToInt16(txtAK1.Text); //Angreifer 2 row.AR2 = Convert.ToInt16(txtAR2.Text); row.AB2 = Convert.ToInt16(txtAB2.Text); row.AM2 = Convert.ToInt16(txtAM2.Text); row.AC2 = Convert.ToInt16(txtAC2.Text); row.AL2 = Convert.ToInt16(txtAL2.Text); row.AS2 = Convert.ToInt16(txtAS2.Text); row.AE2 = Convert.ToInt16(txtAE2.Text); row.AA2 = Convert.ToInt16(txtAA2.Text); row.AK2 = Convert.ToInt16(txtAK2.Text); row.AG2 = chkG1.Checked; //Angreifer 3 row.AR3 = Convert.ToInt16(txtAR3.Text); row.AB3 = Convert.ToInt16(txtAB3.Text); row.AM3 = Convert.ToInt16(txtAM3.Text); row.AC3 = Convert.ToInt16(txtAC3.Text); row.AL3 = Convert.ToInt16(txtAL3.Text); row.AS3 = Convert.ToInt16(txtAS3.Text); row.AE3 = Convert.ToInt16(txtAE3.Text); row.AA3 = Convert.ToInt16(txtAA3.Text); row.AK3 = Convert.ToInt16(txtAK3.Text); row.AG3 = chkG3.Checked; //Player row.DR = Convert.ToInt16(txtDR.Text); row.DB = Convert.ToInt16(txtDB.Text); row.DM = Convert.ToInt16(txtDM.Text); row.DC = Convert.ToInt16(txtDC.Text); row.DL = Convert.ToInt16(txtDL.Text); row.DS = Convert.ToInt16(txtDS.Text); row.DE = Convert.ToInt16(txtDE.Text); row.DA = Convert.ToInt16(txtDA.Text); row.DK = Convert.ToInt16(txtDK.Text); row.DG = chkDG.Checked; row.DT = chkDT.Checked; //Banditen row.BanditName = txtBanditName.Text; row.PL = Convert.ToInt16(txtPL.Text); row.SL = Convert.ToInt16(txtSL.Text); row.WH = Convert.ToInt16(txtWH.Text); row.RB = Convert.ToInt16(txtRB.Text); row.SW = Convert.ToInt16(txtSW.Text); row.WL = Convert.ToInt16(txtWL.Text); row.BT = chkBT.Checked; //Boss row.noBoss = rbKeinBoss.Checked; row.ST = rbST.Checked; row.EB = rbEB.Checked; row.CK = rbCK.Checked; row.MG = rbMG.Checked; row.DWW = rbDWW.Checked; ds.DataTable1.AddDataTable1Row(row); cmbKonfiguration.SelectedIndex = cmbKonfiguration.Items.Count - 1; } catch (Exception ex) { webbrowser(ex.Message); } }