public static string MostrarEstante(Estante est) { Galletita auxGalletita; Gaseosa auxGaseosa; Jugo auxJugo; StringBuilder sb = new StringBuilder(); sb.AppendLine("Contenido estante:"); sb.AppendLine("Capacidad: " + est._capacidad); sb.AppendLine("Listado de productos:"); foreach (Producto item in est.GetProductos()) { if (item is Galletita) { auxGalletita = (Galletita)item; sb.AppendLine(Galletita.MostrarGalletita(auxGalletita)); } else if (item is Gaseosa) { auxGaseosa = (Gaseosa)item; sb.AppendLine(auxGaseosa.MostrarGaseosa()); } else if (item is Jugo) { auxJugo = (Jugo)item; sb.AppendLine(auxJugo.MostrarJugo()); } } return(sb.ToString()); }
public static string MostrarEstante(Estante est) { StringBuilder builder = new StringBuilder(); builder.Append("Capacidad: " + est._capacidad); builder.Append("Listado de Productos"); foreach (Producto item in est._productos) { if (item is Galletita) { builder.AppendLine(Galletita.MostrarGalletita(((Galletita)item))); } if (item is Jugo) { builder.AppendLine(((Jugo)item).MostrarJugo()); } if (item is Gaseosa) { builder.AppendLine(((Gaseosa)item).MostrarGaseosa()); } } return(builder.ToString()); }
private string MostrarGalletita(Galletita g) { StringBuilder s = new StringBuilder(); s.AppendFormat("GALLETITA\n{0}\nPESO: {1}\n", (string)this, this.peso); return(s.ToString()); }
private static string MostrarGalletita(Galletita g) { string cadena = g; cadena += string.Format("\nPeso {0}\n", g._peso); return(cadena); }
private static string MostrarGalletita(Galletita g) { StringBuilder sb = new StringBuilder(); sb.AppendFormat("MARCA: {0}\nCODIGO: {1}\nPRECIO: {2}\nPESO: {3}\n\n", g.Marca, g._codigoBarra, g.Precio, g._peso); return(sb.ToString()); }
public static string MostrarGalletita(Galletita galleta) { StringBuilder sb = new StringBuilder(); sb.Append("Peso: " + galleta._peso); return(Producto.MostrarProducto(galleta) + sb.ToString()); }
private static string MostrarGalletita(Galletita g) { StringBuilder retorno = new StringBuilder(); retorno.AppendLine(g); retorno.AppendLine("Peso " + g._peso); return(retorno.ToString()); }
/// <summary> /// Guarda los datos de la galletita(incluidos los de la clase base) en un string, /// </summary> /// <returns>string</returns> private string MostrarGalletita(Galletita g) { StringBuilder sb = new StringBuilder(); sb.AppendLine(this); sb.AppendLine("PESO: " + this._peso); return(sb.ToString()); }
public static string MostrarGalletita(Galletita galletita) { StringBuilder SB = new StringBuilder(); SB.AppendLine(Producto.MostrarProducto(galletita)); SB.AppendLine("Peso: " + galletita._peso); return(SB.ToString()); }
private string MostrarGalletita(Galletita g) { StringBuilder sb = new StringBuilder(); sb.AppendFormat("\n{0}", (string)g); sb.AppendFormat("\nPESO: {0}", g._peso); return(sb.ToString()); }
private static string MostrarGalletita(Galletita galletita) { StringBuilder sb = new StringBuilder(); sb.AppendLine(galletita + "Peso de la galleta " + galletita._peso); //sb.AppendLine("Peso de la galleta " + galletita._peso); return(sb.ToString()); }
/// <summary> /// Devuelve un string con los datos de la galletita /// </summary> /// <param name="g"></param> /// <returns></returns> private string MostrarGalletita(Galletita g) { StringBuilder sb = new StringBuilder(); sb.AppendLine("MARCA: " + g.Marca); sb.AppendLine("CODIGO DE BARRAS: " + g._codigoBarra); sb.AppendLine("PRECIO: " + g.Precio); sb.AppendLine("PESO: " + g._peso); return(sb.ToString()); }
public float GetValorEstante(Producto.ETipoProducto tipo) { float producto = 0; foreach (Producto item in this._productos) { switch (tipo) { case Producto.ETipoProducto.Galletita: if (item is Galletita) { Galletita g = (Galletita)item; producto += g.Precio; } break; case Producto.ETipoProducto.Gaseosa: if (item is Gaseosa) { Gaseosa g = (Gaseosa)item; producto += g.Precio; } break; case Producto.ETipoProducto.Jugo: if (item is Jugo) { Jugo j = (Jugo)item; producto += j.Precio; } break; case Producto.ETipoProducto.Harina: if (item is Harina) { Harina h = (Harina)item; producto += h.Precio; } break; case Producto.ETipoProducto.Todos: producto += item.Precio; break; } } return(producto); }
/// <summary> /// Devuelve una cadena con los datos de galletita /// </summary> /// <param name="g"></param> /// <returns></returns> private string MostrarGalletita(Galletita g) { StringBuilder sb = new StringBuilder(); sb.Append("MARCA: "); sb.AppendLine((g.Marca).ToString()); sb.Append("C\u00f3DIGO DE BARRAS: "); sb.AppendLine((g._codigoBarra).ToString()); sb.Append("PRECIO: "); sb.AppendLine((g.Precio).ToString()); sb.Append("PESO: "); sb.AppendLine(this._peso.ToString()); sb.AppendLine(); return(sb.ToString()); }
public static Estante operator -(Estante e, Producto.ETipoProducto tipo) { for (int i = 0; i < e.GetProductos().Count; i++) { switch (tipo) { case Producto.ETipoProducto.Galletita: if (e.GetProductos()[i] is Galletita) { Galletita g = (Galletita)e.GetProductos()[i]; e -= g; } break; case Producto.ETipoProducto.Gaseosa: if (e.GetProductos()[i] is Gaseosa) { Gaseosa g = (Gaseosa)e.GetProductos()[i]; e -= g; } break; case Producto.ETipoProducto.Jugo: if (e.GetProductos()[i] is Jugo) { Jugo j = (Jugo)e.GetProductos()[i]; e -= j; } break; case Producto.ETipoProducto.Harina: if (e.GetProductos()[i] is Harina) { Harina h = (Harina)e.GetProductos()[i]; e -= h; } break; case Producto.ETipoProducto.Todos: e -= e.GetProductos()[i]; break; } } return(e); }
public static string MostrarEstante(Estante est) { StringBuilder sb = new StringBuilder(); foreach (Producto item in est._productos) { if (item is Jugo) { sb.AppendLine(((Jugo)item).MostrarJugo()); } if (item is Galletita) { sb.AppendLine(Galletita.MostrarGalletita((Galletita)item)); } if (item is Gaseosa) { sb.AppendLine(((Gaseosa)item).MostrarGaseosa()); } } return(sb.ToString()); }
public override string ToString(Galletita g) { return(this.MostrarGalletita(g)); }
public string MostrarGalletita(Galletita g) { return(string.Format("Sabor: {0}", g.sabor.ToString())); }
public static string MostrarGalletita(Galletita galleta) { return(Producto.MostrarProducto(galleta) + " " + galleta._peso); }
private static string MostrarGalletita(Galletita g) { return((string)g + "PESO: " + g._peso + "\n"); }
public override string ToString() { return(Galletita.MostrarGalletita(this)); }
private static string MostrarGalletita(Galletita galletita) { return(((Producto)galletita) + " peso " + galletita._peso.ToString()); }
private static string MostrarGalletita(Galletita G) { return("Codigo Barra: " + G._codBarra.ToString() + "\nMarca: " + G._marcas.ToString() + "\nPrecio: " + G._precio.ToString() + "\nPeso: " + G._peso.ToString() + "\n\n"); }
private static string MostrarGalletita(Galletita g) { return(string.Format("Peso: {0}", g.peso.ToString())); }
private static string MostrarGalletita(Galletita g) { return((Producto)g + g._precio.ToString()); }