Ejemplo n.º 1
0
        public MainWindow()
        {
            InitializeComponent();
            zam = new Zamestnanecc {
                Name = "Nic", Surname = "Nic", Dob = DateTime.Today, Edu = "Nic", PracPos = "Nic", Mon = 0
            };
            this.DataContext                = zam;
            NameAlert.DataContext           = this;
            SurenameAlert.DataContext       = this;
            this.DobTB.SelectedDate         = DateTime.Today;            //Nevim jak na datePicker
            this.DobTB.SelectedDateChanged += DobTB_SelectedDateChanged; //Nevim jak na datePicker

            EduAlert.DataContext     = this;
            PracPosAlert.DataContext = this;
            MonAlert.DataContext     = this;
        }
Ejemplo n.º 2
0
        private void But_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                MessageBox.Show($@"
          Jmeno: {zam.Name}
       Prijmeni: {zam.Surname}
 Datum Narozeni: {zam.Dob}
       Vzdelani: {zam.Edu}
Pracovni Pozice: {zam.PracPos}
 Hruby plat ($): {zam.Mon}");
                Zamestnanecc.AllZamestameccs.Add(zam);
                zam = new Zamestnanecc {
                    Name = "No", Surname = "Nic", Dob = DateTime.MinValue, Edu = "Nic", PracPos = "Nic", Mon = 1
                };
                this.DataContext = zam;
            }
            catch
            {
                MessageBox.Show("Chyba");
            }
        }