Esempio n. 1
0
        private void tsiInfo_Click(object sender, EventArgs e)
        {
            buttonClick = true;
            frmCharacter_Sheet frmChar = new frmCharacter_Sheet(CharId);

            OpenAndCloseForm(frmChar, buttonClick);
        }
Esempio n. 2
0
        private void frmCharacter_Sheet_Load(object sender, EventArgs e)
        {
            frmCharacter_Sheet frm1    = new frmCharacter_Sheet(characterID);
            TopBar             charBar = new TopBar(frm1, characterID);

            Controls.Add(charBar.mnsCharSheet);
        }
Esempio n. 3
0
        private void CharErstellen(int id)
        {
            frmCharacter_Sheet charSheet = new frmCharacter_Sheet(id);

            charSheet.Closed += (s, args) => this.Close();
            charSheet.Show();

            //else
            //{
            //    DialogResult dr;
            //    dr = MessageBox.Show("Kann kein SaveGame Laden");

            //    if (dr == DialogResult.OK)
            //    {
            //        //hide frm menue
            //        this.Hide();

            //        //Neue Form Erzeugen und alte schließen
            //        frmMenu frm = new frmMenu();

            //        frm.Closed += (s, args) => this.Close();
            //        frm.Show();
            //    }
            //    else
            //    {
            //        //hide frm menue
            //        this.Hide();

            //        //Neue Form Erzeugen und alte schließen
            //        frmMenu frm = new frmMenu();

            //        frm.Closed += (s, args) => this.Close();
            //        frm.Show();
            //    }
            //}
        }
Esempio n. 4
0
        private void btnCreate_Click(object sender, EventArgs e)
        {
            string charfile     = "failed";
            int    CharacterID  = 0;
            int    raumschiffID = 0;

            try
            {
                Cha.Id      = clbCharSlot.Text;
                Cha.Name    = tbxCharName.Text;
                Cha.Kapital = Convert.ToSingle(tbxStartKapital.Text);
                if (clbNewCharRaumschiffe.Text == raumschiff1.Raumschiff_Name)
                {
                    raumschiffID   = raumschiff1.Raumschiff_ID;
                    Cha.Raumschiff = raumschiff1;
                }
                else
                {
                    raumschiffID   = raumschiff2.Raumschiff_ID;
                    Cha.Raumschiff = raumschiff2;
                }
                DBMethoden.GetLocation(location, 0, true);
                Cha.Location = location;


                //Character ID Konvertieren
                if (Cha.Id == "1")
                {
                    CharacterID = 0;
                    //Ignore
                    charfile = "CharacterOne.xml";
                }
                else if (Cha.Id == "2")
                {
                    CharacterID = 1;
                    //Ignore
                    charfile = "CharacterTwo.xml";
                }
                else if (Cha.Id == "3")
                {
                    CharacterID = 2;
                    //Ignore
                    charfile = "Characterthree.xml";
                }

                //Character in DB abspeichern
                DBMethoden.UpdateCharacter(CharacterID, Cha.Name, Cha.Kapital, location.LocationID, raumschiffID);
                //Ignore
                XMLDatenSicherung.DatenSichern(Cha, charfile);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Charakter Speicherung Fehlgeschlagen: " + ex.Message);
            }

            //Close newChar öffne CharSheet
            this.Hide();

            frmCharacter_Sheet charSheet = new frmCharacter_Sheet(CharacterID);

            charSheet.Closed += (s, args) => this.Close();
            charSheet.Show();
        }