Example #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                xml = new Fitness.data.Xml();

                messwert = new Messwert();
                messwert.MesswertDatum = input_datum.Value;
                messwert.Gewicht = Convert.ToDouble(input_gewicht.Text);
                messwert.FettAnteil = Convert.ToDouble(input_fett.Text);
                messwert.WasserAnteil = Convert.ToDouble(input_wasser.Text);
                messwert.MuskelAnteil = Convert.ToDouble(input_muskel.Text);
                messwert.KnochenMasse = Convert.ToDouble(input_knochen.Text);

                if (xml.addEntry(messwert))
                {
                    successfull_saved = true;
                }

                Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message,
                                "Falsches Format",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Information);
            }
        }
Example #2
0
        public bool Contains(Messwert m)
        {
            foreach (Messwert messwert in MesswertListe)
            {
                if (messwert.MesswertDatum.ToShortDateString().Equals(m.MesswertDatum.ToShortDateString()))
                    return true;
            }

            return false;
        }
Example #3
0
        public Boolean removeMesswert(String datum)
        {
            Messwert tmp = new Messwert();
            tmp.MesswertDatum = Convert.ToDateTime(datum);

            foreach (Messwert m in MesswertListe)
            {
                if (m.MesswertDatum.ToShortDateString().Equals(datum))
                {
                    MesswertListe.Remove(m);
                    return true;
                }
            }

            return false;
        }
Example #4
0
 public void addMesswert(Messwert mw)
 {
     this.MesswertListe.Add(mw);
 }
Example #5
0
        private void fillTextboxes(Messwert m)
        {
            a = new AddEntry();
            a.messwert = m;
            //a.InputDatum = m.MesswertDatum;
            //a.InputGewicht = m.Gewicht;
            //a.InputFett = m.FettAnteil;
            //a.InputWasser = m.WasserAnteil;
            //a.InputMuskel = m.MuskelAnteil;
            //a.InputKnochen = m.KnochenMasse;

            a.Show();
            a.FormClosed += new FormClosedEventHandler(a_FormClosed);
        }