public Extras(BurguerKing hamburguesa) : base(hamburguesa) { while (true) { try { Console.WriteLine("Digite el primer ingrediente extra"); ingrExtra1 = Console.ReadLine(); if (string.IsNullOrEmpty(ingrExtra1) == true || Regex.IsMatch(ingrExtra1, @"[\p{L} ]+$") == false) { throw new ArgumentException(); } break; } catch (Exception ex) { Console.WriteLine(ex.Message); } } while (true) { try { Console.WriteLine("Digite el segundo ingrediente extra"); ingrExtra2 = Console.ReadLine(); if (string.IsNullOrEmpty(ingrExtra2) == true || Regex.IsMatch(ingrExtra2, @"[\p{L} ]+$") == false) { throw new ArgumentException(); } break; } catch (Exception ex) { Console.WriteLine(ex.Message); } } }
private void addIngr(BurguerKing hamburguesa) { Console.WriteLine("Primer ingrediente extra: {0}\nSegundo ingrediente extra: {1}", ingrExtra1, ingrExtra2); }
public IngredientesExtras(BurguerKing hamburguesa) { this.hamburguesa = hamburguesa; }