Esempio n. 1
0
        private void ChangeAmount(decimal Amount)//newAmount)
        {
            MainWindowForm mainForm = (MainWindowForm)Application.OpenForms["MainWindowForm"];

            //mainForm.ModifyBasket(basketDataObject, newAmount, productDataObject);
            mainForm.MoveProductsToFromBasket(basketDataObject.ProductID, Amount);
        }
Esempio n. 2
0
        private void AddBasket(decimal amount)
        {
            productDataObject.Amount -= amount;
            MainWindowForm mainForm = (MainWindowForm)Application.OpenForms["MainWindowForm"];

            mainForm.AddBasket(productDataObject.ProductID, amount);
            MessageBox.Show("Dodano do koszyka.");
        }
Esempio n. 3
0
        private void removeProduct()
        {
            DialogResult dialogResult = MessageBox.Show("Czy jesteś pewny(a), że chcesz usunąć ten produkt z koszyka?", "", MessageBoxButtons.YesNo);

            if (dialogResult == DialogResult.Yes)
            {
                MainWindowForm mainForm = (MainWindowForm)Application.OpenForms["MainWindowForm"];
                mainForm.RemoveBasket(basketDataObject, productDataObject);
            }
        }
Esempio n. 4
0
        private void AddBasket(decimal amount)
        {
            MainWindowForm mainForm = (MainWindowForm)Application.OpenForms["MainWindowForm"];

            mainForm.AddBasket(productDataObject.ProductID, amount);
            amountLabel.Text          = ProductAmountInforFormat(productDataObject.Amount, productDataObject.UnitType);
            productDataObject.Amount -= amount;
            SetBasketData();
            MessageBox.Show("Dodano do koszyka.");
        }
Esempio n. 5
0
 private async void deleteButton_Click(object sender, EventArgs e)
 {
     if (MakeSure())
     {
         InterfaceToDataBaseUserMethods Methods = new InterfaceToDataBaseUserMethods();
         if (await Methods.DeleteUser(userData.UserID))
         {
             MessageBox.Show("Bardzo nam przykro.");
             MainWindowForm mainForm = (MainWindowForm)Application.OpenForms["MainWindowForm"];
             mainForm.Logout();
         }
         else
         {
             MessageBox.Show("Jesteś ostatim administratorem, nie możesz usunąć swojego konta.");
         }
     }
 }
Esempio n. 6
0
        private async void SetBasketData()
        {
            MainWindowForm mainForm = (MainWindowForm)Application.OpenForms["MainWindowForm"];

            inBasketLabel.Text = (await mainForm.GetBasketAmount(productDataObject.ProductID)).ToString();
        }