示例#1
0
        private void BtnSave_OnClick(object sender, RoutedEventArgs e)
        {
            CarsInfo car = new CarsInfo
            {
                Modell    = TxtModel.Text,
                Status    = TxtStatus.Text,
                Price     = Convert.ToDouble(TxtPrice.Text),
                Adress    = TxtAdress.Text,
                Insurance = DatepickerInsurance.DisplayDate,
                Sold      = false
            };

            Ownerinfo owner = new Ownerinfo
            {
                Vorname         = TxtFirstName.Text,
                Nachname        = TxtLastName.Text,
                Telephonenumber = TxtTelefoneNumber.Text,
                Emailadress     = TxtEmailAdress.Text
            };

            DataManager.AddNewOffer(car, CarsFotos, owner);
            CarsInfo = DataManager.GetAllOffers();
        }
示例#2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            CarsInfo car = new CarsInfo
            {
                Modell    = textBoxModell.Text,
                Status    = textBoxStatus.Text,
                Price     = Convert.ToDouble(textBoxPrice.Text),
                Adress    = textBoxAdress.Text,
                Insurance = dateTimePickerInsurance.Value,
                Sold      = false
            };

            Ownerinfo owner = new Ownerinfo
            {
                Vorname         = textBoxFirstName.Text,
                Nachname        = textBoxLastName.Text,
                Telephonenumber = textBoxTelephoneNumber.Text,
                Emailadress     = textBoxEmailAdress.Text
            };

            DataManager.AddNewOffer(car, Foto, owner);
            Clearall();
            MessageBox.Show("success");
        }