private void numInStock_ValueChanged(object sender, EventArgs e) { if (CurrentlySelectedTshirt != null && numInStock.Value < CurrentlySelectedTshirt.getOrdered()) { ShowError("Ilosć koszulek w magazynie nie może być mniejsza, niż ilośc zarezerwowana"); numInStock.Value = CurrentlySelectedTshirt.in_stock; return; } currentlyEditedTshirt.in_stock = (int)numInStock.Value; tbAvailable.Text = currentlyEditedTshirt.getNotOrdered().ToString(); tbReserved.Text = currentlyEditedTshirt.getOrdered().ToString(); }
private void btnDelete_Click(object sender, EventArgs e) { if (CurrentlySelectedTshirt == null) { return; } DialogResult dialogResult = MessageBox.Show("Czy na pewno chcesz nieodwracalnie usunąć wybraną koszulkę (" + CurrentlySelectedTshirt.ToString() + ")?", "Potwierdzenie usunięcia", MessageBoxButtons.YesNo); if (dialogResult == DialogResult.No) { return; } removeTshirt(this, this, CurrentlySelectedTshirt); getAllThsirts(this, this); }