private void AddItemBtn_Click(object sender, EventArgs e) { if (IdNameCb.SelectedIndex == -1) { MessageBox.Show("Please select an item before updating!"); } else { client.UpdateData(IdNameCb.SelectedIndex + 1, NameTb.Text, descTb.Text, Convert.ToDouble(feeNUD.Value), Convert.ToInt32(quantNUD.Value)); newStand.Items = client.RequestItems(); mainApp.UpdateListMethod(); newStand.Items = client.RequestItems(); IdNameCb.Items.Clear(); foreach (Item item in newStand.Items) { IdNameCb.Items.Add(item.ID + " " + item.Name); } NameTb.Clear(); descTb.Clear(); IdNameCb.SelectedIndex = -1; feeNUD.Value = 0; quantNUD.Value = 0; mainApp.ClearGUI(); } }
private void DiscardBtn_Click(object sender, EventArgs e) { NameViewer.Text = "..."; PriceVewer.Text = "..."; CategoryViewer.Text = "..."; CostViewer.Text = "..."; FinalPriceFinalProduct.Text = "..."; NameTb.Clear(); PriceTb.Clear(); CostTb.Clear(); progressBar1.Value = 0; }
private void IdNameCb_SelectedIndexChanged(object sender, EventArgs e) { int index = IdNameCb.SelectedIndex; NameTb.Clear(); descTb.Clear(); feeNUD.Value = 0; quantNUD.Value = 0; foreach (Item ite in newStand.Items) { if (ite.ID == index + 1) { NameTb.Text = ite.Name; descTb.Text = ite.Description; feeNUD.Value = Convert.ToDecimal(ite.Fee); quantNUD.Value = Convert.ToDecimal(ite.Quantity); } } }