예제 #1
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.MainLoginWindow = ((WpfApp1.LoginWindow)(target));
                return;

            case 2:
                this.LoginButton = ((System.Windows.Controls.Button)(target));
                return;

            case 3:
                this.RegistrationButton = ((System.Windows.Controls.Button)(target));
                return;
            }
            this._contentLoaded = true;
        }
예제 #2
0
 private void ButtonSignUp_Click(object sender, RoutedEventArgs e)
 {
     if (txtEmail.Text == "" || txtUsername.Text == "")
     {
         label1.Content    = "Invalid Username and/or Email!";
         label1.Visibility = Visibility.Visible;
     }
     else if (txtPassword.Password != txtPassword2.Password)
     {
         label1.Content    = "Passwords don't match!";
         label1.Visibility = Visibility.Visible;
     }
     else
     {
         LoginWindow win = new LoginWindow();
         win.Show();
         this.Close();
     }
 }
예제 #3
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            var           kernel   = new StandardKernel(new NinjectRegistrations());
            IDbRepository crudServ = kernel.Get <IDbRepository>();

            Current.ShutdownMode = ShutdownMode.OnExplicitShutdown;
            AuthInfo authInfo     = new AuthInfo();
            var      loginContext = new LoginWindowViewModel(crudServ, authInfo);
            var      dialog       = new LoginWindow(loginContext);
            var      res          = dialog.ShowDialog();

            if (res == true)
            {
                MainWindow window = new MainWindow(new ApplicationViewModel(crudServ, authInfo.User));
                window.ShowDialog();
            }
            Current.Shutdown(-1);
        }
예제 #4
0
        public MainWindow(LoginWindow loginWindow, int Id)
        {
            InitializeComponent();
            this.loginWindow = loginWindow;
            this.IdText.Text = Id.ToString();



            using (DBEntities context = new DBEntities())
            {
                foreach (Contact c in context.Contacts)
                {
                    if (c.Id == Id)
                    {
                        listBox.Items.Add(c.FirstName + " " + c.LastName);
                        context.SaveChanges();
                    }
                }
            }
        }
예제 #5
0
 public CreateAcc(LoginWindow loginWindow)
 {
     InitializeComponent();
     this.loginWindow = loginWindow;
 }
예제 #6
0
        /// <summary>
        /// Ouvre une fenêtre de connection pour l'utilisateur.
        /// </summary>
        private void Login_Click(object sender, RoutedEventArgs e)
        {
            LoginWindow login = new LoginWindow();

            login.ShowDialog();
        }