Beispiel #1
0
        public Chef BuscarChef(string documento)
        {
            int  i = 0;
            Chef c = null;

            while (i < chefs.Count && c == null)
            {
                if (chefs[i].Documento == documento)
                {
                    c = chefs[i];
                }
                i++;
            }



            return(c);
        }
Beispiel #2
0
        public string AltaMenuPropio(string descripcion, string documento, decimal horasElavoracion, List <IngredienteCantidad> ingredientes)
        {
            string mensaje = "";

            if (descripcion != "" && documento != "" && horasElavoracion > 0)
            {
                if (ingredientes.Count > 0)
                {
                    Menu m = BuscarMenu(descripcion);
                    if (m == null)
                    {
                        Chef c = CChef.Instancia.BuscarChef(documento);
                        if (c != null)
                        {
                            m = new Propio(descripcion, c, horasElavoracion, ingredientes);
                            menus.Add(m);
                            mensaje = "Se ingreso el menu correctamente";
                        }
                        else
                        {
                            mensaje = "No se encontro el chef";
                        }
                    }
                    else
                    {
                        mensaje = "El menu ya existe";
                    }
                }
                else
                {
                    mensaje = "No se ingresaron ingredientes";
                }
            }
            else
            {
                mensaje = "Los datos ingresados no son correctos";
            }



            return(mensaje);
        }
Beispiel #3
0
        public string AltaChef(string documento, string primerNombre, string primerApellido, DateTime fechaIngreso, decimal sueldo)
        {
            string mensaje = "";
            Chef   c       = BuscarChef(documento);


            if (c == null)
            {
                c       = new Chef(documento, primerNombre, primerApellido, fechaIngreso, sueldo);
                mensaje = "El chef " + primerNombre + " " + primerApellido + "se dio de alta correctamente";
            }

            else
            {
                mensaje = "El chef ya existe";
            }



            return(mensaje);
        }
Beispiel #4
0
 public Propio(string descripcion, Chef chef, decimal horasElavoracion, decimal porcentaje, List <IngredienteCantidad> ingredientes) : base(descripcion, porcentaje)
 {
     this.chef                 = chef;
     this.horasElavoracion     = horasElavoracion;
     this.ingredientesCantidad = ingredientes;
 }