コード例 #1
0
 public UserControlFoodPlan(MainAppWindow main)
 {
     this.user1 = main.user;
     InitializeComponent();
     if (DataBaseSolution.FoodPlanExist(user1) == true)
     {
         foodplan = DataBaseSolution.GetFoodPlan(user1);
         if (user1.UserMealNumber == 3)
         {
             GridFoodPlan.Children.Clear();
             usc = new UserControlFoodPlanGenerated(foodplan);
             GridFoodPlan.Children.Add(usc);
         }
         if (user1.UserMealNumber == 4)
         {
             GridFoodPlan.Children.Clear();
             usc = new UserControlFoodPlanGenerated4M(foodplan);
             GridFoodPlan.Children.Add(usc);
         }
         if (user1.UserMealNumber == 5)
         {
             GridFoodPlan.Children.Clear();
             usc = new UserControlFoodPlanGenerated5M(foodplan);
             GridFoodPlan.Children.Add(usc);
         }
     }
 }
コード例 #2
0
 public UserControlNotebook(MainAppWindow main)
 {
     this.user1   = main.user;
     this.mainApp = main;
     InitializeComponent();
     ShowChart();
 }
コード例 #3
0
 private void LoginButton_Click(object sender, RoutedEventArgs e)
 {
     if (!(DataBaseSolution.FindUser(LoginBox.Text)))
     {
         MessageBox.Show("Wskazany użytkownik nie istnieje");
     }
     else
     {
         if ((DataBaseSolution.CheckPassword(LoginBox.Text, PasswordBox.Password)) == true)
         {
             MessageBox.Show("Podane hasło jest nieprawidłowe");
         }
         else
         {
             User user = new User();
             user.Username = LoginBox.Text;
             user.Password = PasswordBox.Password;
             MainAppWindow mainAppWindow = new MainAppWindow(user);
             this.Visibility = Visibility.Hidden;
             mainAppWindow.Show();
         }
     }
 }
コード例 #4
0
 public UserControlAccount(MainAppWindow main)
 {
     this.user1 = main.user;
     InitializeComponent();
 }
コード例 #5
0
 public UserProductsRecipes(MainAppWindow main)
 {
     this.user = main.user;
     InitializeComponent();
 }