private void Login_Button_Click(object sender, RoutedEventArgs e)
        {
            using (SqliteConnection db =
                       new SqliteConnection($"Filename=ShopInformation.db"))
            {
                db.Open();

                SqliteCommand selectCommand = new SqliteCommand
                                                  ($"SELECT Personnel_Name from Personnel WHERE Personnel_User = '******' AND Personnel_Password = '******'", db);

                SqliteDataReader query = selectCommand.ExecuteReader();

                int    check = 0;
                string Personnel_Name;

                while (query.Read())
                {
                    Personnel_Name = query.GetString(0);

                    MainMenuWindow mainMenuWindow = new MainMenuWindow(this, Personnel_Name);
                    mainMenuWindow.Show();
                    this.Close();

                    check = 1;
                }

                if (check == 0)
                {
                    MessageBox.Show("ไม่พบข้อมูล", "คำเตือน");
                }

                db.Close();
            }
        }
Пример #2
0
        private void Back_Button_Click(object sender, RoutedEventArgs e)
        {
            MainMenuWindow mainMenuWindow = new MainMenuWindow(this, Name);

            mainMenuWindow.Show();
            this.Close();
        }
        public PurchaseHistoryWindow(MainMenuWindow mainMenuWindow, string name)
        {
            InitializeComponent();
            Name = name;

            AddHistoryOrder();

            DataContext = this;
        }
        private void Okay_Button_Click(object sender, RoutedEventArgs e)
        {
            List <List <string> > PersonnelData = DataAccess.GetDataPersonnel(txtUser.Text);

            if (txtName.Text == "" || txtUser.Text == "" || txtPassword.Text == "")
            {
                MessageBox.Show("กรุณาใส่ข้อมูลให้ครบ", "คำเตือน");
            }
            else
            {
                if (PersonnelData.Count != 0)
                {
                    MessageBox.Show("มีUserดังกล่าวแล้ว", "คำเตือน");
                }
                else
                {
                    DataAccess.AddDataPersonnel(txtName.Text, txtUser.Text, txtPassword.Text);
                    MainMenuWindow mainMenuWindow = new MainMenuWindow(this, txtName.Text);
                    mainMenuWindow.Show();
                    this.Close();
                }
            }
        }
Пример #5
0
 public ManageBookInformationWindow(MainMenuWindow mainMenuWindow, string name)
 {
     InitializeComponent();
     Name         = name;
     txtName.Text = Name;
 }
 public LoginWindow(MainMenuWindow mainMenuWindow)
 {
     InitializeComponent();
 }
 public OrderBooksWindow(MainMenuWindow mainMenuWindow, string name)
 {
     InitializeComponent();
     Name         = name;
     txtName.Text = Name;
 }