示例#1
0
        private async void tbRfid_TextChanged(object sender, TextChangedEventArgs e)
        {
            int    accId = connection.GetVisitorIdFromRfid(tbRfid.Text);
            string email = connection.GetVisitorEmailFromRfid(tbRfid.Text);

            if (connection.IsEmployee(accId))
            {
                List <Store> storeList = await connection.GetShops();

                Vendor vendor = await connection.GetVendor(email, storeList);

                if (vendor != null)
                {
                    // Shop
                    if (vendor.VendorStore.StoreTypeId == 1)
                    {
                        SaleWindow saleWindow = new SaleWindow();
                        saleWindow.StoresSplitButton.SelectedItem = saleWindow.storeList.Find(x => x.StoreId == vendor.VendorStore.StoreId);
                        saleWindow.Show();
                        this.Close();
                    }
                    // Rental
                    else if (vendor.VendorStore.StoreTypeId == 2)
                    {
                        RentalWindow rentalWindow = new RentalWindow();
                        rentalWindow.StoresSplitButton.SelectedItem = rentalWindow.storeList.Find(x => x.StoreId == vendor.VendorStore.StoreId);
                        rentalWindow.Show();
                        this.Close();
                    }
                    // Festival Check In
                    else if (vendor.VendorStore.StoreTypeId == 3)
                    {
                        FestivalCheckInWindow fciWindow = new FestivalCheckInWindow();
                        fciWindow.Show();
                        this.Close();
                    }
                    // Festival Check Out
                    else if (vendor.VendorStore.StoreTypeId == 4)
                    {
                        FestivalCheckOutWindow fcoWindow = new FestivalCheckOutWindow();
                        fcoWindow.Show();
                        this.Close();
                    }
                    // Camping Check In
                    else if (vendor.VendorStore.StoreTypeId == 5)
                    {
                        CampingCheckInWindow cciWindow = new CampingCheckInWindow();
                        cciWindow.Show();
                        this.Close();
                    }
                    // Camping Check Out
                    else if (vendor.VendorStore.StoreTypeId == 6)
                    {
                        CampingCheckOutWindow ccoWindow = new CampingCheckOutWindow();
                        ccoWindow.Show();
                        this.Close();
                    }
                }
            }
        }
示例#2
0
        private void btnRental_Click(object sender, RoutedEventArgs e)
        {
            //this.Hide();
            RentalWindow rental = new RentalWindow();

            rental.ShowDialog();
            //this.Close();
        }
示例#3
0
        private async void LoginButton_Click(object sender, RoutedEventArgs e)
        {
            string email  = this.EmailLoginTextBox.Text;
            bool   result = await this.connection.Login(email, this.PasswordLoginTextBox.Password);

            if (result)
            {
                List <Store> storeList = await connection.GetShops();

                Vendor vendor = await connection.GetVendor(email, storeList);

                // Shop
                if (vendor.VendorStore.StoreTypeId == 1)
                {
                    SaleWindow saleWindow = new SaleWindow();
                    saleWindow.StoresSplitButton.SelectedItem = saleWindow.storeList.Find(x => x.StoreId == vendor.VendorStore.StoreId);
                    saleWindow.Show();
                    this.Close();
                }
                // Rental
                else if (vendor.VendorStore.StoreTypeId == 2)
                {
                    RentalWindow rentalWindow = new RentalWindow();
                    rentalWindow.StoresSplitButton.SelectedItem = rentalWindow.storeList.Find(x => x.StoreId == vendor.VendorStore.StoreId);
                    rentalWindow.Show();
                    this.Close();
                }
                // Festival Check In
                else if (vendor.VendorStore.StoreTypeId == 3)
                {
                    FestivalCheckInWindow fciWindow = new FestivalCheckInWindow();
                    fciWindow.Show();
                    this.Close();
                }
                // Festival Check Out
                else if (vendor.VendorStore.StoreTypeId == 4)
                {
                    FestivalCheckOutWindow fcoWindow = new FestivalCheckOutWindow();
                    fcoWindow.Show();
                    this.Close();
                }
                // Camping Check In
                else if (vendor.VendorStore.StoreTypeId == 5)
                {
                    CampingCheckInWindow cciWindow = new CampingCheckInWindow();
                    cciWindow.Show();
                    this.Close();
                }
                // Camping Check Out
                else if (vendor.VendorStore.StoreTypeId == 6)
                {
                    CampingCheckOutWindow ccoWindow = new CampingCheckOutWindow();
                    ccoWindow.Show();
                    this.Close();
                }
            }
        }