private void Confirm_Click(object sender, RoutedEventArgs e) { WCFDAL dal = new WCFDAL(); dal.AddAccount(siteName, LoginForSiteTextBox.Text, PasswordForSiteTextBox.Text); this.Close(); }
private void AddNewAccountButton_Click(object sender, RoutedEventArgs e) { WCFDAL dal = new WCFDAL(); var allSitesNames = dal.GetAllSitesNamesByLogin(userLogin); var allSitesReferences = dal.GetAllSitesReferencesByLogin(userLogin); bool exist = false; if (NameOfSiteTextBox.Text != string.Empty && ReferenceForSite.Text != string.Empty && DescriptionOfSite.Text != string.Empty) { foreach (var item in allSitesNames) { if (item == NameOfSiteTextBox.Text) { exist = true; MessageBox.Show("This name for site allready exist!"); } } foreach (var item in allSitesReferences) { if (item == ReferenceForSite.Text) { exist = true; MessageBox.Show("This site refernce allready exist!"); } } if (exist == false) { dal.AddSite(userLogin, NameOfSiteTextBox.Text, ReferenceForSite.Text, DescriptionOfSite.Text, LoginForSiteTextBox.Text, PasswordForSiteTextBox.Text, addAccount); this.Close(); } } else { MessageBox.Show("Enter all information"); } }