Ejemplo n.º 1
0
        private void butSave_Click(object sender, RoutedEventArgs e)
        {
            ProfileInfo cd = new ProfileInfo();

            cd.name     = tbProfileName.Text;
            cd.FullName = tbFullName.Text;
            cd.Email    = tbEmail.Text;
            cd.TelNr    = tbTel.Text;
            cd.Address1 = tbAddress1.Text;
            cd.Address2 = tbAddress2.Text;
            cd.City     = tbCity.Text;
            cd.Postcode = tbPostcode.Text;
            cd.Country  = ((ComboBoxItem)cbCountry.SelectedItem).Content.ToString();

            cd.CardType = ((ComboBoxItem)cbCardType.SelectedItem).Tag.ToString();
            cd.CardNr   = tbCardno.Text;
            cd.ExpMonth = ((ComboBoxItem)cbCardMonth.SelectedItem).Content.ToString();
            cd.ExpYear  = ((ComboBoxItem)cbCardYear.SelectedItem).Content.ToString();
            cd.CVV      = tbCVV.Text;

            if (cd.FullName.Equals(""))
            {
                MessageBox.Show(Properties.Resources.errorEnter + " " + Properties.Resources.dataFullName);
                return;
            }
            else if (cd.Email.Equals(""))
            {
                MessageBox.Show(Properties.Resources.errorEnter + " " + Properties.Resources.dataEmail);
                return;
            }
            else if (cd.TelNr.Equals(""))
            {
                MessageBox.Show(Properties.Resources.errorEnter + " " + Properties.Resources.dataTel);
                return;
            }
            else if (cd.Address1.Equals(""))
            {
                MessageBox.Show(Properties.Resources.errorEnter + " " + Properties.Resources.dataAddress1);
                return;
            }
            else if (cd.Postcode.Equals(""))
            {
                MessageBox.Show(Properties.Resources.errorEnter + " " + Properties.Resources.dataPostcode);
                return;
            }
            else if (cd.Country.Equals("-"))
            {
                MessageBox.Show(Properties.Resources.errorEnter + " " + Properties.Resources.dataCountry);
                return;
            }
            else if (cd.CardNr.Equals(""))
            {
                MessageBox.Show(Properties.Resources.errorEnter + " " + Properties.Resources.dataCardNumber);
                return;
            }
            else if (cd.CVV.Equals(""))
            {
                MessageBox.Show(Properties.Resources.errorEnter + " " + Properties.Resources.dataCVV);
                return;
            }
            else if (cd.name.Equals(""))
            {
                MessageBox.Show(Properties.Resources.errorEnter + " " + Properties.Resources.dataRef);
                return;
            }

            infoManager.addProfile(cd);
            infoManager.updateProfilesList();
            infoManager.saveProfilesList();
        }
Ejemplo n.º 2
0
        public LvProfileItem(NameIdentifiedInfo nii)
        {
            ProfileInfo pi = (ProfileInfo)nii;

            this.ProfileName = nii.name;
        }