Exemple #1
0
 public static void QuitarStock(VentaRepuesto venta)
 {
     try
     {
         Console.WriteLine("Esccriba el código de repuesto");
         string c      = Console.ReadLine();
         int    codigo = Convert.ToInt32(c);
         Console.WriteLine("Escriba el stock a quitar");
         string stk   = Console.ReadLine();
         int    stock = Convert.ToInt32(stk);
         venta.QuitarStock(codigo, stock);
         Console.WriteLine("El stock ha sido modificado");
     }
     catch (Exception ex)
     {
         Console.WriteLine("No es posible realizar la acción");
     }
 }
 private static void EliminarStock(VentaRepuesto local)
 {
     try
     {
         Console.WriteLine(local.ListarRepuestos());
         int codigo = ServValidac.PedirInt("Ingrese codigo de repuesto a restar stock");
         int stock  = ServValidac.PedirInt("Ingrese stock de repuesto a restar");
         local.QuitarStock(codigo, stock);
         Console.WriteLine("repuesto con nuevo stock");
     }
     catch (StockNegativoException sn)
     {
         Console.WriteLine(sn.Message);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);
     }
 }