private void Grid_Loaded_1(object sender, RoutedEventArgs e)
        {
            functions func = new functions();
            DataSet   set  = func.tpyeSell();

            dataGrid4.ItemsSource = set.Tables[0].DefaultView;
        }
Exemple #2
0
        private void LogIn_Click(object sender, RoutedEventArgs e)
        {
            string    staid = UserName.Text;
            string    staPw = PassWord.Password;
            functions func  = new functions();
            bool      boo   = func.checkLogin(staid, staPw);

            if (boo)
            {
                if (func.position == "Clerk")
                {
                    StorageAdmin storage = new StorageAdmin();
                    storage.mem_id           = staid;
                    storage.UserId.Content   = staid;
                    storage.UserName.Content = func.name;
                    storage.Show();
                    storage.button.IsEnabled = true;
                    this.Close();
                }
                else if (func.position == "Cashier")
                {
                    SaleMen sell = new SaleMen();
                    sell.staff_now        = staid;
                    sell.UserId.Content   = staid;
                    sell.UserName.Content = func.name;
                    sell.Show();
                    this.Close();
                }
                else
                {
                    ShopKeeper keeper = new ShopKeeper();
                    keeper.UserId.Content        = staid;
                    keeper.UserName.Content      = func.name;
                    keeper.button.IsEnabled      = true;
                    keeper.button_Copy.IsEnabled = true;
                    keeper.Show();
                    this.Close();
                }
            }
        }
        private void button2_Copy1_Click(object sender, RoutedEventArgs e)
        {
            functions func = new functions();
            string    str;

            if (ComboBox1.Text == "库存管理")
            {
                str = "Clerk";
            }
            else
            {
                str = "Cashier";
            }
            func.createUser(textBox2_Copy1.Text,
                            textBox3_Copy1.Text,
                            textBox6_Copy1.Text,
                            textBox5_Copy1.Text,
                            textBox4_Copy1.Text,
                            str,
                            textBox5_Copy2.Text);
            textBox_Copy1.Text = func.msta_id;
        }