Exemplo n.º 1
0
 public MainWindow()
 {
     InitializeComponent();
     checker.CheckComponents(path);
     InfoHandler.readDatas();
     PartnerHandler.RefreshPartners();
 }
Exemplo n.º 2
0
 public PartnersWindow()
 {
     InitializeComponent();
     PartnerHandler.RefreshPartners();
     PartnersList.ItemsSource = null;
     PartnersList.ItemsSource = PartnerHandler.partners;
 }
Exemplo n.º 3
0
        private void EditPartnerBtn_Click(object sender, RoutedEventArgs e)
        {
            if (PartnersList.SelectedItem == null)
            {
                MessageBox.Show("Nincs kiválasztott partner!", "Hiba", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
            string            name            = (PartnersList.SelectedItem as Partner).Name;
            Partner           selectedPartner = PartnerHandler.partners.Where(x => x.Name == name).First();;
            EditPartnerWindow win             = new EditPartnerWindow(selectedPartner);

            win.ShowDialog();
            PartnerHandler.RefreshPartners();
            PartnersList.ItemsSource = null;
            PartnersList.ItemsSource = PartnerHandler.partners;
        }
Exemplo n.º 4
0
 private void SaveBtn_Click(object sender, RoutedEventArgs e)
 {
     selectedPartner.Address            = AddressBox.Text;
     selectedPartner.Taxnumber          = PartnerTaxNumberBox.Text;
     selectedPartner.BankAccountNumber  = PartnerAccountNumberBox.Text;
     selectedPartner.ContactName        = PartnerContactNameBox.Text;
     selectedPartner.ContactPhoneNumber = PartnerContactPhoneBox.Text;
     selectedPartner.ContactPosition    = PartnerContactPositionBox.Text;
     selectedPartner.Other = PartnerOtherBox.Text;
     if (!PartnerValidator.ValidatePartner(selectedPartner))
     {
         return;
     }
     PartnerHandler.SavePartner(selectedPartner, true);
     MessageBox.Show("Sikeres mentés!", "Mentve", MessageBoxButton.OK, MessageBoxImage.Information);
     this.Close();
 }
Exemplo n.º 5
0
        private void SaveBtn_Click(object sender, RoutedEventArgs e)
        {
            Partner partner = new Partner(PartnerNameBox.Text, AddressBox.Text, PartnerTaxNumberBox.Text, PartnerAccountNumberBox.Text, PartnerContactNameBox.Text, PartnerContactPositionBox.Text, PartnerContactPhoneBox.Text, PartnerOtherBox.Text);
            bool    valid   = PartnerValidator.ValidatePartner(partner);

            if (valid)
            {
                if (!PartnerHandler.SearchForPartner(partner))
                {
                    PartnerHandler.CreateDirectoryForPartner(partner);
                    PartnerHandler.SavePartner(partner, false);
                    MessageBox.Show("Sikeres mentés", "Kész", MessageBoxButton.OK, MessageBoxImage.Information);
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Már létezik ilyen névvel partnercég", "Hiba", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }
Exemplo n.º 6
0
 private void RefreshBtn_Click(object sender, RoutedEventArgs e)
 {
     PartnerHandler.RefreshPartners();
     PartnersList.ItemsSource = null;
     PartnersList.ItemsSource = PartnerHandler.partners;
 }