Example #1
0
        static void Main(string[] args)
        {
            // Creo un estante
            Estante estante = new Estante(3, 1);
            // Creo 4 productos
            Producto p1 = new Producto("Pepsi", "PESDS97413", (float)18.5);
            Producto p2 = new Producto("Coca-Cola", "COSDS55752", (float)11.5);
            Producto p3 = new Producto("Manaos", "MASDS51292", (float)20.5);
            Producto p4 = new Producto("Crush", "CRSDS54861", (float)10.75);

            // Agrego los productos al estante
            if (estante + p1)
            {
                Console.WriteLine("Agregó {0} {1} {2}", p1.GetMarca(), (string)p1, p1.GetPrecio());
            }
            else
            {
                Console.WriteLine("¡NO agregó {0} {1} {2}!", p1.GetMarca(), (string)p1, p1.GetPrecio());
            }
            if (estante + p1)
            {
                Console.WriteLine("Agregó {0} {1} {2}", p1.GetMarca(), (string)p1, p1.GetPrecio());
            }
            else
            {
                Console.WriteLine("¡NO agregó {0} {1} {2}!", p1.GetMarca(), (string)p1, p1.GetPrecio());
            }
            if (estante + p2)
            {
                Console.WriteLine("Agregó {0} {1} {2}", p2.GetMarca(), (string)p2, p2.GetPrecio());
            }
            else
            {
                Console.WriteLine("¡NO agregó {0} {1} {2}!", p2.GetMarca(), (string)p2, p2.GetPrecio());
            }
            if (estante + p3)
            {
                Console.WriteLine("Agregó {0} {1} {2}", p3.GetMarca(), (string)p3, p3.GetPrecio());
            }
            else
            {
                Console.WriteLine("¡NO agregó {0} {1} {2}!", p3.GetMarca(), (string)p3, p3.GetPrecio());
            }
            if (estante + p4)
            {
                Console.WriteLine("Agregó {0} {1} {2}", p4.GetMarca(), (string)p4, p4.GetPrecio());
            }
            else
            {
                Console.WriteLine("¡NO agregó {0} {1} {2}!", p4.GetMarca(), (string)p4, p4.GetPrecio());
            }
            // Muestro todo el estante
            Console.WriteLine();
            Console.WriteLine("<------------------------------------------------->");
            Console.WriteLine(Estante.MostrarEstante(estante));

            Console.ReadKey();
        }
Example #2
0
        public void AgregarBananas_Exception()
        {
            Estante <Banana> v  = new Estante <Banana>(21.5, 1);;
            Banana           v1 = new Banana("amarillo", 6, "brasil");
            Banana           v2 = new Banana("verde", 8, "colombia");

            v += v1;
            v += v2;
        }
Example #3
0
        //public void CargarEstante(Estante est1, Estante est2)
        public void CargarEstante(out Estante est1, out Estante est2)
        {
            //Console.Title = "Primer Parcial Laboratorio II - 2016 -";
            //Estante est1 = new Estante(4);//no se puede declarar igual a est1 y est2
            //Estante est2 = new Estante(3);
            Estante estante1 = new Estante(4);
            Estante estante2 = new Estante(3);
            Harina  h1       = new Harina(102, 37.5f, Producto.EMarcaProducto.Favorita,
                                          Harina.ETipoHarina.CuatroCeros);
            Harina h2 = new Harina(103, 40.25f, Producto.EMarcaProducto.Favorita,
                                   Harina.ETipoHarina.Integral);
            Galletita g1 = new Galletita(113, 33.65f, Producto.EMarcaProducto.Pitusas, 250f);
            Galletita g2 = new Galletita(111, 56f, Producto.EMarcaProducto.Diversión, 500f);
            Jugo      j1 = new Jugo(112, 25f, Producto.EMarcaProducto.Naranjú, Jugo.ESaborJugo.Pasable);
            Jugo      j2 = new Jugo(333, 33f, Producto.EMarcaProducto.Swift, Jugo.ESaborJugo.Asqueroso);
            Gaseosa   g  = new Gaseosa(j2, 2250f);

            if (!(estante1 + h1))
            {
                //Console.WriteLine("No se pudo agregar el producto al estante!!!");
            }
            if (!(estante1 + g1))
            {
                // Console.WriteLine("No se pudo agregar el producto al estante!!!");
            }
            if (!(estante1 + g2))
            {
                // Console.WriteLine("No se pudo agregar el producto al estante!!!");
            }
            if (!(estante1 + g1))
            {
                // Console.WriteLine("No se pudo agregar el producto al estante!!!");
            }
            if (!(estante1 + j1))
            {
                //Console.WriteLine("No se pudo agregar el producto al estante!!!");
            }
            if (!(estante2 + h2))
            {
                //Console.WriteLine("No se pudo agregar el producto al estante!!!");
            }
            if (!(estante2 + j2))
            {
                //Console.WriteLine("No se pudo agregar el producto al estante!!!");
            }
            if (!(estante2 + g))
            {
                //Console.WriteLine("No se pudo agregar el producto al estante!!!");
            }
            if (!(estante2 + g1))
            {
                //Console.WriteLine("No se pudo agregar el producto al estante!!!");
            }

            est1 = estante1; //asisgno estante1 a est1 para out
            est2 = estante2; //asisgno estante2 a est2 para out
        }
Example #4
0
        public JsonResult CadastrarEstante(string JsonEstante)
        {
            var definition = new
            {
                QtdPrateleiras   = new int(),
                LarguraPrat      = "",
                AlturaPrat       = "",
                ProfundidadePrat = "",
                PesoMaximoPrat   = "",
            };

            var jsonEstante = Newtonsoft.Json.JsonConvert.DeserializeAnonymousType(JsonEstante, definition);

            var estante = new Estante()
            {
                QuantidadePrateleiras   = jsonEstante.QtdPrateleiras,
                LarguraPrateleiras      = Convert.ToDouble(jsonEstante.LarguraPrat.Replace(',', '.'), CultureInfo.GetCultureInfo("en-US")),
                AlturaPrateleiras       = Convert.ToDouble(jsonEstante.AlturaPrat.Replace(',', '.'), CultureInfo.GetCultureInfo("en-US")),
                ProfundidadePrateleiras = Convert.ToDouble(jsonEstante.ProfundidadePrat.Replace(',', '.'), CultureInfo.GetCultureInfo("en-US")),
                PesoMaximoPrateleiras   = Convert.ToDouble(jsonEstante.PesoMaximoPrat.Replace(',', '.'), CultureInfo.GetCultureInfo("en-US")),
                PoligonoId = null,
                UsuarioId  = null,
                ArmazemId  = 1, //FIX TODO
                Ativo      = true
            };

            //Cria poligono da estante
            var camada = new CamadaCore().RetornarPorCamadaNomeArmazemId("Estantes", estante.ArmazemId ?? 1);

            var geojson = GerarGeoJsonEstanteNovo(camada.Id, camada.Nome, -1, estante.LarguraPrateleiras ?? 0, estante.ProfundidadePrateleiras ?? 0);

            var planta2DController = DependencyResolver.Current.GetService <Planta2DController>();

            planta2DController.ControllerContext = new ControllerContext(this.Request.RequestContext, planta2DController);

            var poligonoId = planta2DController.SalvarPoligono(-1, camada.Id, geojson, false);

            estante.PoligonoId = poligonoId;

            new EstanteCore().Inserir(estante);

            var prateleiraCore = new PrateleiraCore();

            for (var i = 1; i <= estante.QuantidadePrateleiras; i++)
            {
                var prateleira = new Prateleira
                {
                    Nivel     = i,
                    EstanteId = estante.Id
                };

                prateleiraCore.Inserir(prateleira);
            }

            return(Json("", JsonRequestBehavior.AllowGet));
        }
        static void Main(string[] args)
        {
            Console.Title = "Primer Parcial Laboratorio II - 2016 -";

            Estante est1 = new Estante(4); Estante est2 = new Estante(3);

            Harina h1 = new Harina(102, 37.5f, Producto.EMarcaProducto.Favorita, Harina.ETipoHarina.CuatroCeros); Harina h2 = new Harina(103, 40.25f, Producto.EMarcaProducto.Favorita, Harina.ETipoHarina.Integral); Galletita g1 = new Galletita(113, 33.65f, Producto.EMarcaProducto.Pitusas, 250f); Galletita g2 = new Galletita(111, 56f, Producto.EMarcaProducto.Diversion, 500f); Jugo j1 = new Jugo(112, 25f, Producto.EMarcaProducto.Naranju, Jugo.ESaborJugo.Pasable); Jugo j2 = new Jugo(333, 33f, Producto.EMarcaProducto.Swift, Jugo.ESaborJugo.Asqueroso); //Gaseosa g = new Gaseosa(j2, 2250f);

            if (!(est1 + h1))
            {
                Console.WriteLine("No se pudo agregar el producto al estante!!!");
            }
            if (!(est1 + g1))
            {
                Console.WriteLine("No se pudo agregar el producto al estante!!!");
            }
            if (!(est1 + g2))
            {
                Console.WriteLine("No se pudo agregar el producto al estante!!!");
            }
            if (!(est1 + g1))
            {
                Console.WriteLine("No se pudo agregar el producto al estante!!!");
            }
            if (!(est1 + j1))
            {
                Console.WriteLine("No se pudo agregar el producto al estante!!!");
            }
            if (!(est2 + h2))
            {
                Console.WriteLine("No se pudo agregar el producto al estante!!!");
            }
            if (!(est2 + j2))
            {
                Console.WriteLine("No se pudo agregar el producto al estante!!!");
            }
            //if (!(est2 + g)) { Console.WriteLine("No se pudo agregar el producto al estante!!!"); }
            if (!(est2 + g1))
            {
                Console.WriteLine("No se pudo agregar el producto al estante!!!");
            }

            Console.WriteLine("Valor total Estante1: {0}", est1.ValorEstanteTotal);

            Console.WriteLine("Valor Estante1 sólo de Galletitas: {0}", est1.GetValorEstante(ETipoProducto.Galletita));

            Console.WriteLine("Contenido Estante1:\n{0}", Estante.MostrarEstante(est1));

            //Console.WriteLine("Estante ordenado por Código de Barra...."); est1.GetProductos().Sort(Program.OrdenarProductos); Console.WriteLine(Estante.MostrarEstante(est1));

            est1 = est1 - ETipoProducto.Galletita; Console.WriteLine("Estante1 sin Galletitas: {0}", Estante.MostrarEstante(est1));

            Console.WriteLine("Contenido Estante2:\n{0}", Estante.MostrarEstante(est2)); est2 -= ETipoProducto.Todos; Console.WriteLine("Contenido Estante2:\n{0}", Estante.MostrarEstante(est2));

            Console.ReadLine();
        }
Example #6
0
 public ActionResult Edit([Bind(Include = "Id,Genero")] Estante estante)
 {
     if (ModelState.IsValid)
     {
         db.Entry(estante).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(estante));
 }
Example #7
0
        public void  CargarEstante(out Estante est1, out Estante est2)
        {
            Estante est3 = new Estante(4);
            Estante est4 = new Estante(5);

            Harina h1 = new Harina(102, 37.5f, Producto.EMarcaProducto.Favorita, Harina.ETipoHarina.CuatroCeros);

            Harina h2 = new Harina(103, 40.25f, Producto.EMarcaProducto.Favorita, Harina.ETipoHarina.Integral);

            Galletita g1 = new Galletita(113, 33.65f, Producto.EMarcaProducto.Pitusas, 250f);
            Galletita g2 = new Galletita(111, 56f, Producto.EMarcaProducto.Diversión, 500f);

            Jugo j1 = new Jugo(112, 25f, Producto.EMarcaProducto.Naranjú, Jugo.ESaborJugo.Pasable);
            Jugo j2 = new Jugo(333, 33f, Producto.EMarcaProducto.Swift, Jugo.ESaborJugo.Asqueroso);


            if (!(est3 + h1))
            {
                Console.WriteLine("No se pudo agregar el producto al estante!!!");
            }
            if (!(est3 + g1))
            {
                Console.WriteLine("No se pudo agregar el producto al estante!!!");
            }
            if (!(est3 + g2))
            {
                Console.WriteLine("No se pudo agregar el producto al estante!!!");
            }
            if (!(est3 + g1))
            {
                Console.WriteLine("No se pudo agregar el producto al estante!!!");
            }
            if (!(est3 + j1))
            {
                Console.WriteLine("No se pudo agregar el producto al estante!!!");
            }
            if (!(est4 + h2))
            {
                Console.WriteLine("No se pudo agregar el producto al estante!!!");
            }
            if (!(est4 + j2))
            {
                Console.WriteLine("No se pudo agregar el producto al estante!!!");
            }

            if (!(est4 + g1))
            {
                Console.WriteLine("No se pudo agregar el producto al estante!!!");
            }

            est1 = est3;

            est2 = est4;
        }
 private static void GuardarEstante(string filename, Estante e)
 {
     using (TextWriter writer = new StreamWriter(filename, true))
     {
         foreach (Producto p in e.GetProductos())
         {
             string line = p.ToString();
             writer.WriteLine(line);
         }
     }
 }
Example #9
0
        private void CargarEstante(out Estante est1, out Estante est2)
        {
            Estante e1 = new Estante(4);
            Estante e2 = new Estante(3);
            Harina  h1 = new Harina(102, 37.5f, Producto.EMarcaProducto.Favorita,
                                    Harina.ETipoHarina.CuatroCeros);
            Harina h2 = new Harina(103, 40.25f, Producto.EMarcaProducto.Favorita,
                                   Harina.ETipoHarina.Integral);
            Galletita g1 = new Galletita(113, 33.65f, Producto.EMarcaProducto.Pitusas, 250f);
            Galletita g2 = new Galletita(111, 56f, Producto.EMarcaProducto.Diversión, 500f);
            Jugo      j1 = new Jugo(112, 25f, Producto.EMarcaProducto.Naranjú, Jugo.ESaborJugo.Pasable);
            Jugo      j2 = new Jugo(333, 33f, Producto.EMarcaProducto.Swift, Jugo.ESaborJugo.Asqueroso);
            Gaseosa   g  = new Gaseosa(j2, 2250f);

            if (!(e1 + h1))
            {
                // MessageBox.Show("No se pudo agregar el producto al estante!!!");
            }
            if (!(e1 + g1))
            {
                //MessageBox.Show("No se pudo agregar el producto al estante!!!");
            }
            if (!(e1 + g2))
            {
                //MessageBox.Show("No se pudo agregar el producto al estante!!!");
            }
            if (!(e1 + g1))
            {
                //MessageBox.Show("No se pudo agregar el producto al estante!!!");
            }
            if (!(e1 + j1))
            {
                //MessageBox.Show("No se pudo agregar el producto al estante!!!");
            }
            if (!(e2 + h2))
            {
                //MessageBox.Show("No se pudo agregar el producto al estante!!!");
            }
            if (!(e2 + j2))
            {
                //MessageBox.Show("No se pudo agregar el producto al estante!!!");
            }
            if (!(e2 + g))
            {
                //MessageBox.Show("No se pudo agregar el producto al estante!!!");
            }
            if (!(e2 + g1))
            {
                //MessageBox.Show("No se pudo agregar el producto al estante!!!");
            }

            est1 = e1;
            est2 = e2;
        }
Example #10
0
        public ActionResult Create([Bind(Include = "Id,Genero")] Estante estante)
        {
            if (ModelState.IsValid)
            {
                db.estantes.Add(estante);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(estante));
        }
Example #11
0
 /// <summary>
 /// Se intenta agregar frutas al estante y si se supera la cantidad maxima se lanzara una excepcion con un mensaje
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnPunto4_Click(object sender, EventArgs e)
 {
     try
     {
         this.c_melocotones += this._melocoton;
     }
     catch (EstanteLlenoException error)
     {
         MessageBox.Show(error.Message, "Error al agregar frutas al estante", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Example #12
0
        /// <summary>
        /// Aca se lanzara un evento en caso de superarse el precio maximo de 55 pesos y se imprimira en un archivo de texto
        ///la fecha(con hora, minutos y segundos) y el total del precio del estante en un reglon nuevo
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnPunto5_Click(object sender, EventArgs e)
        {
            Ticketador <Banana> manejador = new Ticketador <Banana>();

            this.c_bananas.EventoPrecio += new Estante <Banana> .DelegadoEventoPrecio(manejador.ManejadorEventoPrecio);

            this.c_bananas += new Banana("verde", 2, "argentina");

            this.c_bananas += new Banana("amarilla", 4, "ecuador");

            double precio = this.c_bananas.PrecioTotal;
        }
Example #13
0
 public static void ActualizarEstante(Estante estante, string id)
 {
     SQL = "update estante set codigo='" + estante.Codigo + "',nombre='" + estante.Nombre + "',descripcion='" +
           estante.Descripcion + "' Where idEstante ='" + ValidarEstante(id) + "'";
     if (Conexion.Execute(SQL))
     {
         MessageBox.Show("Registro Actualizado");
     }
     else
     {
         MessageBox.Show("Error al Actualizar");
     }
 }
Example #14
0
        private void btnActualizar_Click(object sender, EventArgs e)
        {
            string codigo = txtCodigo.Text;

            estante = EstanteController.BuscarEstante(codigo);
            if (estante != null)
            {
                Captura();
                EstanteController.ActualizarEstante(estante, codigo);
                CargarDatos();
                Nuevo();
            }
        }
Example #15
0
 public string ObterJsonItem(object item)
 {
     if (item is Estante)
     {
         Estante objeto = item as Estante;
         return(HttpUtility.HtmlEncode(ViewModelHelper.Json(new { @Id = objeto.Id, @Texto = objeto.Texto, @Arquivo = objeto.Arquivo })));
     }
     else
     {
         Prateleira objeto = item as Prateleira;
         return(HttpUtility.HtmlEncode(ViewModelHelper.Json(new { @Id = objeto.Id, @Texto = objeto.Texto, @Arquivo = objeto.Arquivo })));
     }
 }
Example #16
0
        private void btnInsertar_Click(object sender, EventArgs e)
        {
            string codigo = txtCodigo.Text;

            estante = EstanteController.BuscarEstante(codigo);
            if (estante == null)
            {
                Guardar();
            }
            else
            {
                MessageBox.Show("Estante ya existe");
            }
        }
Example #17
0
        public static void InsertarEstante(Estante estante)
        {
            SQL = "insert into estante(codigo,nombre,descripcion) Values ('" + estante.Codigo + "','" + estante.Nombre + "','" +
                  estante.Descripcion + "')";

            if (Conexion.Execute(SQL))
            {
                MessageBox.Show("Registro Guardado");
            }
            else
            {
                MessageBox.Show("Error al Guardar");
            }
        }
        private void btnOrdenar_Click(object sender, EventArgs e)
        {
            rtxtSalida.Text = "";
            Estante est1;
            Estante est2;

            this.CargarEstante(out est1, out est2);
            rtxtSalida.Text += "Estante 1 ordenado por Marca....\n";
            est1.GetProductos().Sort(FormEstante.OrdenarProductos);
            rtxtSalida.Text += Estante.MostrarEstante(est1);
            rtxtSalida.Text += "Estante 2 ordenado por Marca....\n";
            est2.GetProductos().Sort(FormEstante.OrdenarProductos);
            rtxtSalida.Text += Estante.MostrarEstante(est2);
        }
Example #19
0
 public ActionResult Excluir(string Id)
 {
     try
     {
         Estante estante = _DAO.GetByRegistro(int.Parse(Id));
         _DAO.ExcluirEstante(estante);
         Logador.LogEntidade(LAB5GED.MVC.Acessorio.Logador.LogAcoes.Excluir, estante);
         return(RedirectToAction("Index"));
     }
     catch (Exception ex)
     {
         return(RedirectToAction("Index").ComMensagemDeErro(ex.Message));
     }
 }
Example #20
0
        // GET: Estantes/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Estante estante = db.estantes.Find(id);

            if (estante == null)
            {
                return(HttpNotFound());
            }
            return(View(estante));
        }
Example #21
0
 public void ExcluirEstante(Estante _estante)
 {
     try
     {
         _DAO.Delete(_estante);
     }
     catch (DbUpdateException)
     {
         throw new Erros.ErroGeral("Não é possível excluir a estante pois a mesma está em uso.");
     }
     catch (Exception ex)
     {
         throw new Erros.ErroGeral("Não é possível excluir a estante." + ex.Message);
     }
 }
Example #22
0
        public static Estante BuscarEstante(string codigo)
        {
            SQL = "Select * from estante where codigo ='" + codigo + "'";
            MySqlDataReader req = Conexion.Query(SQL);
            Estante         ob  = null;

            if (req.Read())
            {
                ob             = new Estante();
                ob.Codigo      = req["codigo"].ToString();
                ob.Nombre      = req["nombre"].ToString();
                ob.Descripcion = req["descripcion"].ToString();
            }
            req.Close();
            return(ob);
        }
Example #23
0
        /// <summary>
        /// Genera una fabrica con tres productos válidos para utilizarse en las pruebas de fabricación
        /// </summary>
        /// <returns></returns>
        public Fabrica getFabricaCompleta()
        {
            Fabrica fabrica = Fabrica.Instance;

            fabrica.ResetearFabrica();

            Insumo maderaUno        = new Madera(ETipoMadera.Mdf, EForma.Tablon, 100);
            Insumo maderaDos        = new Madera(ETipoMadera.Pino, EForma.Tablon, 200);
            Insumo maderaSecundaria = new Madera(ETipoMadera.Mdf, EForma.Tubo, 100);
            Insumo telaUno          = new Tela(EColor.Bordo, ETipoTela.Alfombra, 100);
            Insumo telaDos          = new Tela(EColor.Rosa, ETipoTela.Corderito, 200);

            Insumo adicionalUno  = new InsumoAccesorio(ETipoAccesorio.Barniz, 300);
            Insumo adicionalDos  = new InsumoAccesorio(ETipoAccesorio.Tornillo, 300);
            Insumo adicionalTres = new InsumoAccesorio(ETipoAccesorio.Pegamento, 300);

            List <Insumo> insumosAgregar = new List <Insumo>();

            insumosAgregar.Add(adicionalUno);
            insumosAgregar.Add(adicionalDos);
            insumosAgregar.Add(adicionalTres);
            insumosAgregar.Add(maderaUno);
            insumosAgregar.Add(maderaDos);

            insumosAgregar.Add(maderaSecundaria);
            insumosAgregar.Add(telaUno);
            insumosAgregar.Add(telaDos);

            Madera maderaProductoUno        = new Madera(ETipoMadera.Mdf, EForma.Tablon, 4);
            Madera maderaSecundariaProducto = new Madera(ETipoMadera.Mdf, EForma.Tubo, 3);
            Tela   telaProducto             = new Tela(EColor.Bordo, ETipoTela.Alfombra, 3);


            List <Insumo> faltantes    = new List <Insumo>();
            Producto      productoUno  = new Torre(new Madera(ETipoMadera.Mdf, EForma.Tablon, Fabrica.CANTIDAD_MADERA_TORRE_PRINCIPAL), new Tela(EColor.Bordo, ETipoTela.Alfombra, Fabrica.CANTIDAD_TELA_TORRE), Torre.EModeloTorre.King, new Madera(ETipoMadera.Mdf, EForma.Tubo, Fabrica.CANTIDAD_MADERA_TORRE_COLUMNA));
            Producto      productoDos  = new Torre(new Madera(ETipoMadera.Pino, EForma.Tablon, Fabrica.CANTIDAD_MADERA_TORRE_PRINCIPAL), new Tela(EColor.Rosa, ETipoTela.Corderito, Fabrica.CANTIDAD_TELA_TORRE), Torre.EModeloTorre.King, new Madera(ETipoMadera.Mdf, EForma.Tubo, Fabrica.CANTIDAD_MADERA_TORRE_COLUMNA));
            Producto      productoTres = new Estante(new Madera(ETipoMadera.Mdf, EForma.Tablon, Fabrica.CANTIDAD_MADERA_ESTANTE), new Tela(EColor.Rosa, ETipoTela.Corderito, Fabrica.CANTIDAD_TELA_ESTANTE), 3);

            fabrica.AgregarInsumosAStock(insumosAgregar);


            fabrica.AgregarProductoLineaProduccion(productoUno, out faltantes);
            fabrica.AgregarProductoLineaProduccion(productoDos, out faltantes);
            fabrica.AgregarProductoLineaProduccion(productoTres, out faltantes);

            return(fabrica);
        }
Example #24
0
        public static List <Estante> ListarEstantes_ID_CODIGO()
        {
            List <Estante> estante = new List <Estante>();

            SQL = "Select idEstante, codigo from estante";
            MySqlDataReader req = Conexion.Query(SQL);

            while (req.Read())
            {
                Estante ob = new Estante();
                ob.IdEstante = req.GetInt32("idEstante");
                ob.Codigo    = req["codigo"].ToString();
                estante.Add(ob);
            }
            req.Close();
            return(estante);
        }
Example #25
0
    public void OnPointerClick(PointerEventData eventData)
    {
        var clickedItem = Item;

        Estante.Remove(clickedItem);
        Player.Instance.Inventory.Add(clickedItem);

        foreach (int index in questsIndex)
        {
            ManagerQuest.QuestTakeStep(index);
        }

        //if (QuestScript.questList.Count != 0)
        //{
        //    QuestScript.questList[0].ReavaliarTodasQuests();
        //}
    }
Example #26
0
        public static List <Estante> FiltrarEstante(string filtro)
        {
            List <Estante> estante = new List <Estante>();

            SQL = "Select * from estante where codigo Like '%" + filtro + "%'";
            MySqlDataReader req = Conexion.Query(SQL);

            while (req.Read())
            {
                Estante ob = new Estante();
                ob.IdEstante   = req.GetInt32("idEstante");
                ob.Codigo      = req["codigo"].ToString();
                ob.Nombre      = req["nombre"].ToString();
                ob.Descripcion = req["descripcion"].ToString();
                estante.Add(ob);
            }
            req.Close();
            return(estante);
        }
Example #27
0
        private void btnEjecutar_Click(object sender, EventArgs e)
        {
            rtxtSalida.Text = "";
            Estante est1;
            Estante est2;

            this.CargarEstante(out est1, out est2);
            rtxtSalida.Text += String.Format("Valor total Estante1: {0}", est1.ValorEstanteTotal);
            rtxtSalida.Text += String.Format("Valor Estante1 sólo de Galletitas: {0}", est1.GetValorEstante(Producto.ETipoProducto.Galletita));
            rtxtSalida.Text += String.Format("Contenido Estante1:\n{0}", Estante.MostrarEstante(est1));
            rtxtSalida.Text += "Estante ordenado por Marca....\n";
            est1.GetProductos().Sort(FormEstante.Form1.OrdenarProductos);
            rtxtSalida.Text += Estante.MostrarEstante(est1);
            est1             = est1 - Producto.ETipoProducto.Galletita;
            rtxtSalida.Text += String.Format("Estante1 sin Galletitas: {0}", Estante.MostrarEstante(est1));
            rtxtSalida.Text += String.Format("Contenido Estante2:\n{0}", Estante.MostrarEstante(est2));
            est2            -= Producto.ETipoProducto.Todos;
            rtxtSalida.Text += String.Format("Contenido Estante2:\n{0}", Estante.MostrarEstante(est2));
        }
Example #28
0
        /// <summary>
        /// Se crea la clase estante de cada fruta que se añadiran algunas frutas con sus respectivos datos, el peso y la cantidad maxima
        ///se mostraran los datos por pantalla de cada estante
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnPunto2_Click(object sender, EventArgs e)
        {
            this.c_manzanas    = new Estante <Manzana>(1.58, 3);
            this.c_bananas     = new Estante <Banana>(15.96, 4);
            this.c_melocotones = new Estante <Melocoton>(21.5, 1);

            this.c_manzanas += new Manzana("roja", 1, "neuquen");
            this.c_manzanas += this._manzana;
            this.c_manzanas += new Manzana("amarilla", 3, "san juan");

            this.c_bananas += new Banana("verde", 3, "brasil");
            this.c_bananas += this._banana;

            this.c_melocotones += this._melocoton;

            MessageBox.Show(this.c_manzanas.ToString());

            MessageBox.Show(this.c_bananas.ToString());

            MessageBox.Show(this.c_melocotones.ToString());
        }
Example #29
0
        public string Post(int id, string metodo, [FromBody] Estante estante)
        {
            Robo robo = BuscarRobo(id);

            if (robo == null)
            {
                return($"Não foi possível encontrar o Robo de ID {id}!");
            }

            switch (metodo)
            {
            case "VerificarDistancia":
                return(robo.VerificarDistancia(estante).ToString());

            case "DefinirObjetivo":
                robo.DefinirObjetivo(estante);
                return($"Objetivo definido com sucesso para o Robo de ID {id}!");

            default:
                return("É necessário passar um método para ser executado (api/Robo/{id}/{metodo})");
            }
        }
Example #30
0
 public void Buscar()
 {
     if (txtCodigo.Text == "")
     {
         MessageBox.Show("Ingresar codigo para cargar datos");
     }
     else
     {
         string codigo = txtCodigo.Text;
         estante = EstanteController.BuscarEstante(codigo);
         if (estante != null)
         {
             txtCodigo.Text      = estante.Codigo;
             txtNombre.Text      = estante.Nombre;
             txtDescripcion.Text = estante.Descripcion;
         }
         else
         {
             MessageBox.Show("Estante no encontrado");
         }
     }
 }