예제 #1
0
        private void myLoginButton(object sender, RoutedEventArgs e)
        {
            using (DatabaseContext dbContext = new DatabaseContext())
            {
                if (String.IsNullOrEmpty(UserText.Text))
                {
                    System.Windows.Forms.MessageBox.Show("Please input field.");
                }
                else
                {
                    var employeeLogin = dbContext.Employees
                                        .SingleOrDefault(s => s.Username == UserText.Text && s.Password == UserPassword.Password.ToString());
                    if (employeeLogin != null)
                    {
                        RoomMake roomWindow = new RoomMake(employeeLogin.EmpType);

                        roomWindow.ShowDialog();
                        this.Close();
                        //Main.NavigationService.Navigate(roomWindow);
                    }
                    else
                    {
                        System.Windows.Forms.MessageBox.Show("Login Invalid.");
                    }
                }
            }
        }
예제 #2
0
        private void RoomClick(object sender, RoutedEventArgs e)
        {
            RoomMake roomWindow = new RoomMake();

            roomWindow.ShowDialog();
        }