version 1.2
This commit is contained in:
+10
-11
@@ -191,6 +191,7 @@ namespace compabetov2
|
||||
private void button6_Click_1(object sender, EventArgs e)
|
||||
{
|
||||
List<Producto> stockNuevo = new List<Producto>();
|
||||
string mensajeConfirmacion = "Se aumentara el stock a los\nsiguientes productos\n";
|
||||
try {
|
||||
foreach (Control control in stockPanel.Controls)
|
||||
{
|
||||
@@ -201,27 +202,24 @@ namespace compabetov2
|
||||
Label lbIdProducto = informacionProducto.Controls[0].Controls[0] as Label;
|
||||
int idProducto = int.Parse(lbIdProducto.Text);
|
||||
|
||||
//nombre
|
||||
Label lbNombre = informacionProducto.Controls[1] as Label;
|
||||
string[] strInfo = lbNombre.Text.Split('-');
|
||||
string nombreProducto = strInfo[0];
|
||||
|
||||
//stock a agregar
|
||||
TextBox txtStock = agregarPanel.Controls[0] as TextBox;
|
||||
int stock = int.Parse(txtStock.Text);
|
||||
|
||||
if (stock != 0)
|
||||
{
|
||||
Producto productoStockNuuevo = new Producto(idProducto, "", "", 0, "", stock, null);
|
||||
Producto productoStockNuuevo = new Producto(idProducto, nombreProducto, "", 0, "", stock, null);
|
||||
stockNuevo.Add(productoStockNuuevo);
|
||||
mensajeConfirmacion += nombreProducto + ": " + stock + "\n";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
string mensajeConfirmacion = "Se aumentara el stock a los\nsiguientes productos\n";
|
||||
for (int i = 0; i < stockNuevo.Count; i++)
|
||||
{
|
||||
|
||||
mensajeConfirmacion += productos[stockNuevo[i].idProducto - 1].nombre + ": " + stockNuevo[i].stock + "\n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (stockNuevo.Count > 0)
|
||||
{
|
||||
DialogResult result = MessageBox.Show(mensajeConfirmacion, "Confirmación", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
|
||||
@@ -232,7 +230,8 @@ namespace compabetov2
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(Exception ex) {
|
||||
catch (Exception)
|
||||
{
|
||||
MessageBox.Show("Solo debe introducir numeros","Error", MessageBoxButtons.OK,MessageBoxIcon.Error);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user