コード例 #1
0
 /// <summary>
 /// Log in as one of the trainee in the list
 /// </summary>
 private void Student_list_view_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     try
     {
         BE.Trainee       trainee = Student_list_view.SelectedItem as BE.Trainee;
         MessageBoxResult result  = MessageBox.Show("האם ברצונך להתחבר למערכת בתור " + trainee.First_name + " " + trainee.Last_name + "?", "התחברות כתלמיד", MessageBoxButton.YesNo);
         if (result == MessageBoxResult.Yes)
         {
             StudentWindow studentWindow = new StudentWindow(trainee);
             this.Close();
             studentWindow.ShowDialog();
         }
     }
     catch (Exception) { }
 }
コード例 #2
0
        private void LogInStudent(object sender, RoutedEventArgs e)
        {
            try
            {
                // search for trainee with the wanted id
                List <BE.Trainee> resualt = iBL_Imp.SearchTrainee(trainee_id.Text, true, false, false);

                // if there is no resualt
                if (resualt.Count == 0)
                {
                    student_error_message.Visibility = Visibility.Visible;
                    return;
                }

                // if the password is not correct
                if (resualt[0].Password != iBL_Imp.Encrypte(student_password.Password))
                {
                    student_error_message.Visibility = Visibility.Visible;
                    return;
                }

                ///////////////////////////////////////////////////////////
                student_error_message.Visibility = Visibility.Collapsed;
                student_password.Password        = "";
                trainee_id.Text = "";

                StudentWindow studentWindow = new StudentWindow(resualt[0]);
                this.Visibility = Visibility.Hidden;
                studentWindow.ShowDialog();
                this.Visibility = Visibility.Visible;
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #3
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.thisWindow = ((PLWPF.StudentWindow)(target));
                return;

            case 2:

            #line 34 "..\..\StudentWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Sign_out);

            #line default
            #line hidden
                return;

            case 3:

            #line 40 "..\..\StudentWindow.xaml"
                ((System.Windows.Controls.StackPanel)(target)).MouseEnter += new System.Windows.Input.MouseEventHandler(this.Show_hand);

            #line default
            #line hidden

            #line 40 "..\..\StudentWindow.xaml"
                ((System.Windows.Controls.StackPanel)(target)).MouseLeave += new System.Windows.Input.MouseEventHandler(this.Show_hand);

            #line default
            #line hidden
                return;

            case 4:
                this.left_tab = ((System.Windows.Controls.StackPanel)(target));

            #line 41 "..\..\StudentWindow.xaml"
                this.left_tab.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.Left_tab_MouseDown);

            #line default
            #line hidden
                return;

            case 5:
                this.left_tab_rec = ((System.Windows.Shapes.Rectangle)(target));
                return;

            case 6:
                this.center_tab = ((System.Windows.Controls.StackPanel)(target));

            #line 46 "..\..\StudentWindow.xaml"
                this.center_tab.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.Center_tab_MouseDown);

            #line default
            #line hidden
                return;

            case 7:
                this.center_tab_rec = ((System.Windows.Shapes.Rectangle)(target));
                return;

            case 8:
                this.right_tab = ((System.Windows.Controls.StackPanel)(target));

            #line 50 "..\..\StudentWindow.xaml"
                this.right_tab.MouseDown += new System.Windows.Input.MouseButtonEventHandler(this.Right_tab_MouseDown);

            #line default
            #line hidden
                return;

            case 9:
                this.right_tab_rec = ((System.Windows.Shapes.Rectangle)(target));
                return;

            case 10:
                this.test_list_view = ((System.Windows.Controls.Grid)(target));
                return;

            case 11:
                this.exp_pass = ((System.Windows.Controls.Expander)(target));

            #line 63 "..\..\StudentWindow.xaml"
                this.exp_pass.Expanded += new System.Windows.RoutedEventHandler(this.when_open_pass);

            #line default
            #line hidden
                return;

            case 12:
                this.exp_pass_tests = ((System.Windows.Controls.WrapPanel)(target));
                return;

            case 13:
                this.exp_didnt_pass = ((System.Windows.Controls.Expander)(target));

            #line 74 "..\..\StudentWindow.xaml"
                this.exp_didnt_pass.Expanded += new System.Windows.RoutedEventHandler(this.when_open_didnt_pass);

            #line default
            #line hidden
                return;

            case 14:
                this.exp_didnt_pass_tests = ((System.Windows.Controls.WrapPanel)(target));
                return;

            case 15:
                this.exp_future = ((System.Windows.Controls.Expander)(target));

            #line 85 "..\..\StudentWindow.xaml"
                this.exp_future.Expanded += new System.Windows.RoutedEventHandler(this.when_open_future);

            #line default
            #line hidden
                return;

            case 16:
                this.exp_futre_tests = ((System.Windows.Controls.WrapPanel)(target));
                return;

            case 17:
                this.new_test_view = ((MaterialDesignThemes.Wpf.Card)(target));
                return;

            case 18:
                this.test_hour = ((System.Windows.Controls.ListView)(target));
                return;

            case 19:
                this.address = ((System.Windows.Controls.StackPanel)(target));
                return;

            case 20:
                this.home_address = ((System.Windows.Controls.Primitives.ToggleButton)(target));

            #line 147 "..\..\StudentWindow.xaml"
                this.home_address.Click += new System.Windows.RoutedEventHandler(this.Home_Address);

            #line default
            #line hidden
                return;

            case 21:
                this.city = ((System.Windows.Controls.TextBox)(target));
                return;

            case 22:
                this.building_number = ((System.Windows.Controls.TextBox)(target));
                return;

            case 23:
                this.street = ((System.Windows.Controls.TextBox)(target));
                return;

            case 24:
                this.test_date = ((System.Windows.Controls.DatePicker)(target));
                return;

            case 25:
                this.txt_credit_card_number = ((System.Windows.Controls.TextBox)(target));

            #line 167 "..\..\StudentWindow.xaml"
                this.txt_credit_card_number.KeyUp += new System.Windows.Input.KeyEventHandler(this.Txt_credit_card_number_KeyUp);

            #line default
            #line hidden
                return;

            case 26:
                this.txt_credit_card_date = ((System.Windows.Controls.TextBox)(target));

            #line 168 "..\..\StudentWindow.xaml"
                this.txt_credit_card_date.KeyUp += new System.Windows.Input.KeyEventHandler(this.Txt_credit_card_date_KeyUp);

            #line default
            #line hidden
                return;

            case 27:
                this.txt_credit_card_CVV = ((System.Windows.Controls.TextBox)(target));
                return;

            case 28:

            #line 175 "..\..\StudentWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Save_test);

            #line default
            #line hidden
                return;

            case 29:
                this.pi_save = ((MaterialDesignThemes.Wpf.PackIcon)(target));
                return;

            case 30:
                this.pb_save = ((System.Windows.Controls.ProgressBar)(target));
                return;

            case 31:
                this.update_student_data = ((MaterialDesignThemes.Wpf.Card)(target));
                return;

            case 32:
                this.id_number = ((System.Windows.Controls.TextBox)(target));
                return;

            case 33:
                this.first_name = ((System.Windows.Controls.TextBox)(target));

            #line 194 "..\..\StudentWindow.xaml"
                this.first_name.KeyUp += new System.Windows.Input.KeyEventHandler(this.Changes);

            #line default
            #line hidden
                return;

            case 34:
                this.last_name = ((System.Windows.Controls.TextBox)(target));

            #line 195 "..\..\StudentWindow.xaml"
                this.last_name.KeyUp += new System.Windows.Input.KeyEventHandler(this.Changes);

            #line default
            #line hidden
                return;

            case 35:
                this.gender = ((System.Windows.Controls.ComboBox)(target));

            #line 196 "..\..\StudentWindow.xaml"
                this.gender.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Combo_box_MouseUp);

            #line default
            #line hidden
                return;

            case 36:
                this.phone_number = ((System.Windows.Controls.TextBox)(target));

            #line 200 "..\..\StudentWindow.xaml"
                this.phone_number.KeyUp += new System.Windows.Input.KeyEventHandler(this.Changes);

            #line default
            #line hidden
                return;

            case 37:
                this.city1 = ((System.Windows.Controls.TextBox)(target));

            #line 201 "..\..\StudentWindow.xaml"
                this.city1.KeyUp += new System.Windows.Input.KeyEventHandler(this.Changes);

            #line default
            #line hidden
                return;

            case 38:
                this.building_number1 = ((System.Windows.Controls.TextBox)(target));

            #line 202 "..\..\StudentWindow.xaml"
                this.building_number1.KeyUp += new System.Windows.Input.KeyEventHandler(this.Changes);

            #line default
            #line hidden
                return;

            case 39:
                this.street1 = ((System.Windows.Controls.TextBox)(target));

            #line 203 "..\..\StudentWindow.xaml"
                this.street1.KeyUp += new System.Windows.Input.KeyEventHandler(this.Changes);

            #line default
            #line hidden
                return;

            case 40:
                this.birth_date = ((System.Windows.Controls.DatePicker)(target));

            #line 204 "..\..\StudentWindow.xaml"
                this.birth_date.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Birth_date_MouseUp);

            #line default
            #line hidden

            #line 204 "..\..\StudentWindow.xaml"
                this.birth_date.KeyUp += new System.Windows.Input.KeyEventHandler(this.Changes);

            #line default
            #line hidden
                return;

            case 41:
                this.car_type = ((System.Windows.Controls.ComboBox)(target));

            #line 205 "..\..\StudentWindow.xaml"
                this.car_type.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Combo_box_MouseUp);

            #line default
            #line hidden
                return;

            case 42:
                this.gear = ((System.Windows.Controls.ComboBox)(target));

            #line 211 "..\..\StudentWindow.xaml"
                this.gear.MouseUp += new System.Windows.Input.MouseButtonEventHandler(this.Combo_box_MouseUp);

            #line default
            #line hidden
                return;

            case 43:
                this.school_name = ((System.Windows.Controls.TextBox)(target));

            #line 215 "..\..\StudentWindow.xaml"
                this.school_name.KeyUp += new System.Windows.Input.KeyEventHandler(this.Changes);

            #line default
            #line hidden
                return;

            case 44:
                this.teacher_name = ((System.Windows.Controls.TextBox)(target));

            #line 216 "..\..\StudentWindow.xaml"
                this.teacher_name.KeyUp += new System.Windows.Input.KeyEventHandler(this.Changes);

            #line default
            #line hidden
                return;

            case 45:
                this.number_of_class = ((System.Windows.Controls.TextBox)(target));

            #line 217 "..\..\StudentWindow.xaml"
                this.number_of_class.KeyUp += new System.Windows.Input.KeyEventHandler(this.Changes);

            #line default
            #line hidden
                return;

            case 46:
                this.email = ((System.Windows.Controls.TextBox)(target));

            #line 218 "..\..\StudentWindow.xaml"
                this.email.KeyUp += new System.Windows.Input.KeyEventHandler(this.Changes);

            #line default
            #line hidden
                return;

            case 47:
                this.prev_password = ((System.Windows.Controls.TextBox)(target));

            #line 219 "..\..\StudentWindow.xaml"
                this.prev_password.KeyUp += new System.Windows.Input.KeyEventHandler(this.Changes);

            #line default
            #line hidden
                return;

            case 48:
                this.password = ((System.Windows.Controls.PasswordBox)(target));

            #line 220 "..\..\StudentWindow.xaml"
                this.password.KeyUp += new System.Windows.Input.KeyEventHandler(this.Changes);

            #line default
            #line hidden
                return;

            case 49:

            #line 224 "..\..\StudentWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Delete_student);

            #line default
            #line hidden
                return;

            case 50:

            #line 230 "..\..\StudentWindow.xaml"
                ((System.Windows.Controls.Button)(target)).Click += new System.Windows.RoutedEventHandler(this.Update_student);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }