public void Agregar(DynamicGrid ubicacionCol , DynamicGrid almacen) { int exito=0; if (String.IsNullOrEmpty(CantIngresar)) { _windowManager.ShowDialog(new AlertViewModel(_windowManager, "Debe ingresar una cantidad")); return; } else if (int.Parse(CantIngresar) <0) { _windowManager.ShowDialog(new AlertViewModel(_windowManager, "Debe ingresar una cantidad positiva")); return; } if (selectedProduct != null) { if (int.Parse(selectedProduct.CanAtender) < int.Parse(CantIngresar)) { if (accion == 1) _windowManager.ShowDialog(new AlertViewModel(_windowManager, "La cantidad que se intenta ingresar es mayor a la cantidad pendiente")); else _windowManager.ShowDialog(new AlertViewModel(_windowManager, "La cantidad que se intenta retirar es mayor a la cantidad pendiente")); } else { if (String.IsNullOrEmpty(VolIngresar)) VolIngresar = "0"; if (accion == 1) exito = ubicacionCol.AgregarProductos(int.Parse(CantIngresar), int.Parse(VolIngresar), SelectedProduct.IdProducto); else exito=ubicacionCol.DisminuirProductos(int.Parse(CantIngresar), SelectedProduct.IdProducto); if (exito > 0) selectedProduct.CanAtender = (int.Parse(selectedProduct.CanAtender) - int.Parse(CantIngresar)).ToString(); LstProductos = new List<ProductoCant>(LstProductos); } } VolIngresar = ""; CantIngresar = ""; }