Beispiel #1
0
        public void openCopyDialog()
        {
            if (SelectedKontakt != null)
            {
                int eValue = (int)SelectedKontakt.Sex;
                EditCreateWindow editCreateWindow = new EditCreateWindow("Kopieren eines Kontaktes", SelectedKontakt.DisplayName, SelectedKontakt.Surname, SelectedKontakt.Name, SelectedKontakt.Title, SelectedKontakt.Address.Street, SelectedKontakt.Address.HouseNoumber, SelectedKontakt.Address.PostalCode, SelectedKontakt.Address.City, SelectedKontakt.Address.EMail, SelectedKontakt.Address.MobileNr, SelectedKontakt.Address.PhoneNr, SelectedKontakt.Address.FaxNr, SelectedKontakt.Address1.Street, SelectedKontakt.Address1.HouseNoumber, SelectedKontakt.Address1.PostalCode, SelectedKontakt.Address1.City, SelectedKontakt.Address1.EMail, SelectedKontakt.Address1.MobileNr, SelectedKontakt.Address1.PhoneNr, SelectedKontakt.Address1.FaxNr, SelectedKontakt.Address2.Street, SelectedKontakt.Address2.HouseNoumber, SelectedKontakt.Address2.PostalCode, SelectedKontakt.Address2.City, SelectedKontakt.Address2.EMail, SelectedKontakt.Address2.MobileNr, SelectedKontakt.Address2.PhoneNr, SelectedKontakt.Address2.FaxNr);
                editCreateWindow.CBSex.SelectedIndex = eValue;

                if (editCreateWindow.ShowDialog() == true)
                {
                    var check = Kontakte.SingleOrDefault(i => i.DisplayName == editCreateWindow.tbDisplayName.Text);
                    if (check == null)
                    {
                        Kontakte.Add(new Kontakt()
                        {
                            Sex = (Sex)Enum.Parse(typeof(Sex), editCreateWindow.CBSex.Text), DisplayName = editCreateWindow.tbDisplayName.Text, Surname = editCreateWindow.tbSurName.Text, Name = editCreateWindow.tbName.Text, Title = editCreateWindow.tbTitle.Text, Address = new Address {
                                City = editCreateWindow.tbCity.Text, HouseNoumber = editCreateWindow.tbHouseNumber.Text, PostalCode = editCreateWindow.tbPostalCode.Text, Street = editCreateWindow.tbStreet.Text, EMail = editCreateWindow.tbEmail.Text, MobileNr = editCreateWindow.tbMobileNr.Text, PhoneNr = editCreateWindow.tbPhoneNr.Text, FaxNr = editCreateWindow.tbFaxNr.Text
                            }, Address1 = new Address {
                                City = editCreateWindow.tbCity1.Text, HouseNoumber = editCreateWindow.tbHouseNumber1.Text, PostalCode = editCreateWindow.tbPostalCode1.Text, Street = editCreateWindow.tbStreet1.Text, EMail = editCreateWindow.tbEmail1.Text, MobileNr = editCreateWindow.tbMobileNr1.Text, PhoneNr = editCreateWindow.tbPhoneNr1.Text, FaxNr = editCreateWindow.tbFaxNr1.Text
                            }, Address2 = new Address {
                                City = editCreateWindow.tbCity2.Text, HouseNoumber = editCreateWindow.tbHouseNumber2.Text, PostalCode = editCreateWindow.tbPostalCode2.Text, Street = editCreateWindow.tbStreet2.Text, EMail = editCreateWindow.tbEmail2.Text, MobileNr = editCreateWindow.tbMobileNr2.Text, PhoneNr = editCreateWindow.tbPhoneNr2.Text, FaxNr = editCreateWindow.tbFaxNr2.Text
                            }
                        });
                    }
                    else
                    {
                        MessageBox.Show("Es dürfen keine zwei Kontakte mit dem Gleichen Anzeigenamen existieren");
                    }
                }
            }
            else
            {
                MessageBox.Show("Wählen sie einen Kontakt aus");
            }
        }
Beispiel #2
0
        public void openCreateDialog()
        {
            EditCreateWindow editCreateWindow = new EditCreateWindow("Hinzufügen eines Kontaktes");

            if (editCreateWindow.ShowDialog() == true)
            {
                var check = Kontakte.SingleOrDefault(i => i.DisplayName == editCreateWindow.tbDisplayName.Text);
                if (check == null)
                {
                    Kontakte.Add(new Kontakt()
                    {
                        Sex = (Sex)Enum.Parse(typeof(Sex), editCreateWindow.CBSex.Text), DisplayName = editCreateWindow.tbDisplayName.Text, Surname = editCreateWindow.tbSurName.Text, Name = editCreateWindow.tbName.Text, Title = editCreateWindow.tbTitle.Text, Address = new Address {
                            City = editCreateWindow.tbCity.Text, HouseNoumber = editCreateWindow.tbHouseNumber.Text, PostalCode = editCreateWindow.tbPostalCode.Text, Street = editCreateWindow.tbStreet.Text, EMail = editCreateWindow.tbEmail.Text, MobileNr = editCreateWindow.tbMobileNr.Text, PhoneNr = editCreateWindow.tbPhoneNr.Text, FaxNr = editCreateWindow.tbFaxNr.Text
                        }, Address1 = new Address {
                            City = editCreateWindow.tbCity1.Text, HouseNoumber = editCreateWindow.tbHouseNumber1.Text, PostalCode = editCreateWindow.tbPostalCode1.Text, Street = editCreateWindow.tbStreet1.Text, EMail = editCreateWindow.tbEmail1.Text, MobileNr = editCreateWindow.tbMobileNr1.Text, PhoneNr = editCreateWindow.tbPhoneNr1.Text, FaxNr = editCreateWindow.tbFaxNr1.Text
                        }, Address2 = new Address {
                            City = editCreateWindow.tbCity2.Text, HouseNoumber = editCreateWindow.tbHouseNumber2.Text, PostalCode = editCreateWindow.tbPostalCode2.Text, Street = editCreateWindow.tbStreet2.Text, EMail = editCreateWindow.tbEmail2.Text, MobileNr = editCreateWindow.tbMobileNr2.Text, PhoneNr = editCreateWindow.tbPhoneNr2.Text, FaxNr = editCreateWindow.tbFaxNr2.Text
                        }
                    });
                }
                else
                {
                    MessageBox.Show("Es dürfen keine zwei Kontakte mit dem Gleichen Anzeigenamen existieren");
                }
            }
        }
Beispiel #3
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.EditCreateWindowUi = ((Kontaktverwaltung.EditCreateWindow)(target));
                return;

            case 2:
                this.tbDisplayName = ((System.Windows.Controls.TextBox)(target));
                return;

            case 3:
                this.tbSurName = ((System.Windows.Controls.TextBox)(target));
                return;

            case 4:
                this.tbName = ((System.Windows.Controls.TextBox)(target));
                return;

            case 5:
                this.CBSex = ((System.Windows.Controls.ComboBox)(target));
                return;

            case 6:
                this.tbTitle = ((System.Windows.Controls.TextBox)(target));
                return;

            case 7:
                this.SpAdress0 = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 8:
                this.tbStreet = ((System.Windows.Controls.TextBox)(target));
                return;

            case 9:
                this.tbHouseNumber = ((System.Windows.Controls.TextBox)(target));
                return;

            case 10:
                this.tbPostalCode = ((System.Windows.Controls.TextBox)(target));
                return;

            case 11:
                this.tbCity = ((System.Windows.Controls.TextBox)(target));
                return;

            case 12:
                this.tbEmail = ((System.Windows.Controls.TextBox)(target));
                return;

            case 13:
                this.tbMobileNr = ((System.Windows.Controls.TextBox)(target));
                return;

            case 14:
                this.tbPhoneNr = ((System.Windows.Controls.TextBox)(target));
                return;

            case 15:
                this.tbFaxNr = ((System.Windows.Controls.TextBox)(target));
                return;

            case 16:
                this.SpAdress1 = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 17:
                this.tbStreet1 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 18:
                this.tbHouseNumber1 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 19:
                this.tbPostalCode1 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 20:
                this.tbCity1 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 21:
                this.tbEmail1 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 22:
                this.tbMobileNr1 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 23:
                this.tbPhoneNr1 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 24:
                this.tbFaxNr1 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 25:
                this.SpAdress2 = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 26:
                this.tbStreet2 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 27:
                this.tbHouseNumber2 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 28:
                this.tbPostalCode2 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 29:
                this.tbCity2 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 30:
                this.tbEmail2 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 31:
                this.tbMobileNr2 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 32:
                this.tbPhoneNr2 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 33:
                this.tbFaxNr2 = ((System.Windows.Controls.TextBox)(target));
                return;

            case 34:
                this.btEditDialogOk = ((System.Windows.Controls.Button)(target));

            #line 141 "..\..\..\EditCreateWindow.xaml"
                this.btEditDialogOk.Click += new System.Windows.RoutedEventHandler(this.btEditDialogOk_Click);

            #line default
            #line hidden
                return;

            case 35:
                this.btEditDialogCancel = ((System.Windows.Controls.Button)(target));
                return;

            case 36:
                this.btEditDialogAddAdress = ((System.Windows.Controls.Button)(target));

            #line 143 "..\..\..\EditCreateWindow.xaml"
                this.btEditDialogAddAdress.Click += new System.Windows.RoutedEventHandler(this.btEditDialogAddAdress_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }