private void butDodajPrac_Click(object sender, RoutedEventArgs e) { Pracownik p = new Pracownik(); PracownikWindow okno = new PracownikWindow(p); bool? dodawac = okno.ShowDialog(); //boolpytajnik to nullable bool: true, false i null if (dodawac == true) { _orgCRM.DodajPracownika(p); //dodajemy pracownika lstPracownicy.ItemsSource = new ObservableCollection <Pracownik>(_orgCRM.ListaPracownikow); txtBoxLiczbaPrac.Text = _orgCRM.PodajIloscPracownikow().ToString(); } }
private void butEdytujDane_Click(object sender, RoutedEventArgs e) { if (lstPracownicy.SelectedIndex > -1) { Pracownik p = (Pracownik)lstPracownicy.SelectedItem; Pracownik zmieniony = (Pracownik)p.Clone(); PracownikWindow okno = new PracownikWindow(zmieniony); bool? zmieniac = okno.ShowDialog(); if (zmieniac == true) { _orgCRM.DodajPracownika(zmieniony); _orgCRM.UsunPracownika(p); txtBoxLiczbaPrac.Text = _orgCRM.PodajIloscPracownikow().ToString(); lstPracownicy.ItemsSource = new ObservableCollection <Pracownik>(_orgCRM.ListaPracownikow); } } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.windowPracownik = ((CRM_GUI.PracownikWindow)(target)); return; case 2: this.labImie = ((System.Windows.Controls.Label)(target)); return; case 3: this.labNazwisko = ((System.Windows.Controls.Label)(target)); return; case 4: this.labDatRozp = ((System.Windows.Controls.Label)(target)); return; case 5: this.txtDataRozp = ((System.Windows.Controls.TextBox)(target)); return; case 6: this.txtNazwisko = ((System.Windows.Controls.TextBox)(target)); return; case 7: this.txtImie = ((System.Windows.Controls.TextBox)(target)); return; case 8: this.labPlec = ((System.Windows.Controls.Label)(target)); return; case 9: this.labStanowisko = ((System.Windows.Controls.Label)(target)); return; case 10: this.labNotatki = ((System.Windows.Controls.Label)(target)); return; case 11: this.txtNotatki = ((System.Windows.Controls.TextBox)(target)); return; case 12: this.txtAdres_Copy = ((System.Windows.Controls.TextBox)(target)); return; case 13: this.labTelefon = ((System.Windows.Controls.Label)(target)); return; case 14: this.labMail = ((System.Windows.Controls.Label)(target)); return; case 15: this.txtMail = ((System.Windows.Controls.TextBox)(target)); return; case 16: this.txtTelefon = ((System.Windows.Controls.TextBox)(target)); return; case 17: this.cmbPlec = ((System.Windows.Controls.ComboBox)(target)); return; case 18: this.cmbStanowisko = ((System.Windows.Controls.ComboBox)(target)); return; case 19: this.butZatwierdz = ((System.Windows.Controls.Button)(target)); #line 41 "..\..\PracownikWindow.xaml" this.butZatwierdz.Click += new System.Windows.RoutedEventHandler(this.butZatwierdz_Click); #line default #line hidden return; case 20: this.butAnuluj = ((System.Windows.Controls.Button)(target)); #line 42 "..\..\PracownikWindow.xaml" this.butAnuluj.Click += new System.Windows.RoutedEventHandler(this.butAnuluj_Click); #line default #line hidden return; } this._contentLoaded = true; }