private void Button_Click(object sender, RoutedEventArgs e) // Save or update
 {
     if (CB.buttonNewState == "0")
     {
         if (CB.CheckInput() == true)
         {
             CB.NewSupplierAndSalesAssistant();
             CB.ClearGrainSupplierData();
             UCGrainSupplier UCGS = new UCGrainSupplier(gridMain, CB, CL);
             gridMain.Children.Clear();
             gridMain.Children.Add(UCGS);
         }
         else
         {
             MessageBox.Show("Du mangler at indtaste data.", "Datacheck", MessageBoxButton.OK, MessageBoxImage.Asterisk);
         }
     }
     else
     {
         if (CB.CheckInput() == true)
         {
             CB.UpdateSupplierAndSalesAssistant();
             CB.ClearGrainSupplierData();
             UCGrainSupplier UCGS = new UCGrainSupplier(gridMain, CB, CL);
             gridMain.Children.Clear();
             gridMain.Children.Add(UCGS);
         }
         else
         {
             MessageBox.Show("Du mangler at indtaste data.", "Datacheck", MessageBoxButton.OK, MessageBoxImage.Asterisk);
         }
     }
 }
Beispiel #2
0
        private void Button_Click(object sender, RoutedEventArgs e) // Refrain from purchase
        {
            UCGrainSupplier UCGS = new UCGrainSupplier(gridMain, CB, CL);

            gridMain.Children.Clear();
            gridMain.Children.Add(UCGS);
            CB.ClearGrainSupplierData();
        }
        private void Button_Click_1(object sender, RoutedEventArgs e) // Cancel
        {
            CB.ClearGrainSupplierData();
            UCGrainSupplier UCGS = new UCGrainSupplier(gridMain, CB, CL);

            gridMain.Children.Clear();
            gridMain.Children.Add(UCGS);
        }
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     checkRegEx = CRE.IsValidDkSocialSecurityNumber(CL.cprNr);
     if (checkRegEx == false)
     {
         MessageBox.Show("Please enter a valid security number.", "", MessageBoxButton.OK, MessageBoxImage.Exclamation);
     }
     else
     {
         CL.GetUserData();
         if (CL.CU.id == 0)
         {
             MessageBox.Show("You've entered a wrong userId or password", "", MessageBoxButton.OK, MessageBoxImage.Exclamation);
         }
         else
         {
             UCGrainSupplier UCGS = new UCGrainSupplier(gridMain, CB, CL);
             gridMain.Children.Clear();
             gridMain.Children.Add(UCGS);
         }
     }
 }