public BEHome ListaHome(string Idioma, ref string sMensajeResultado) { BEHome DatosHome = new BEHome(); SqlConnection conn = null; try { conn = new SqlConnection(Db.CadenaCon("TriniHorseCuba")); SqlCommand cmd = new SqlCommand(prcDatosHome, conn) { CommandType = CommandType.StoredProcedure }; conn.Open(); cmd.Parameters.Add("@Idioma", SqlDbType.Char).Value = Idioma; using (SqlDataReader Result = cmd.ExecuteReader()) { // Datos sobre textos del Home List <BETextosHome> lstTH = new List <BETextosHome>(); while (Result.Read()) { BETextosHome _TH = new BETextosHome(); _TH.Codigo = Convert.ToInt32(Result["Codigo"]); _TH.TituloFlyer = Result["Titulo_Flyer"].ToString().Trim(); _TH.TextoFlyer = Result["Texto_Flyer"].ToString().Trim(); _TH.TituloEncuentranos = Result["Titulo_Encuentro"].ToString().Trim(); _TH.TextoEncuentranos = Result["Texto_Encuentro"].ToString().Trim(); _TH.BotonEncuentranos = Result["Texto_Boton"].ToString().Trim(); lstTH.Add(_TH); } Result.NextResult(); // Datos sobre textos del Servicio List <BETextosServicio> lstTS = new List <BETextosServicio>(); while (Result.Read()) { BETextosServicio _TS = new BETextosServicio(); _TS.Codigo = Convert.ToInt32(Result["Codigo"]); _TS.Titulo = Result["Titulo"].ToString().Trim(); _TS.Subtitulo = Result["Texto_1"].ToString().Trim(); _TS.TextoCentral = Result["Texto_2"].ToString().Trim(); lstTS.Add(_TS); } Result.NextResult(); // Datos sobre detalle del Servicio List <BEDetalleServicios> lstDS = new List <BEDetalleServicios>(); while (Result.Read()) { BEDetalleServicios _DS = new BEDetalleServicios(); _DS.Codigo = Convert.ToInt32(Result["Codigo"]); _DS.Imagen = Result["NombreImagen"].ToString().Trim(); _DS.Titulo = Result["Titulo"].ToString().Trim(); _DS.Texto = Result["Texto"].ToString().Trim(); _DS.Precio = Convert.ToDecimal(Result["Precio"]); _DS.Concepto = Result["Concepto"].ToString().Trim(); _DS.Orden = Convert.ToInt32(Result["Orden"]); _DS.TextoBoton = Idioma == "SPA" ? "Ver más" : "See more"; lstDS.Add(_DS); } Result.Close(); DatosHome.lstTextosHome = lstTH; DatosHome.lstTextosServ = lstTS; DatosHome.lstDetalleServ = lstDS; sMensajeResultado = ""; } } catch (Exception ex) { sMensajeResultado = ex.Message; } finally { conn.Close(); } return(DatosHome); }
private void Cargar_Datos() { string MsjResultado = ""; BLLHome obj = new BLLHome(); BEHome lstDatos = obj.ListaHome(Session["Idioma"].ToString(), ref MsjResultado); if (MsjResultado == "") { lblTituloFlyer.Text = lstDatos.lstTextosHome.ElementAt(0).TituloFlyer; lblTextoFlyer.Text = lstDatos.lstTextosHome.ElementAt(0).TextoFlyer; var lstDatosSup = from Serv in lstDatos.lstDetalleServ where Serv.Orden == 1 || Serv.Orden == 2 select Serv; rpServSup.DataSource = lstDatosSup.ToList(); rpServSup.DataBind(); lblTituloServicios.Text = lstDatos.lstTextosServ.ElementAt(0).Titulo; lblSubtiServicios.Text = lstDatos.lstTextosServ.ElementAt(0).Subtitulo; lblTextoServicios.Text = lstDatos.lstTextosServ.ElementAt(0).TextoCentral; var lstDatosInf01 = from Serv in lstDatos.lstDetalleServ where Serv.Orden == 3 || Serv.Orden == 4 select Serv; rpServInf01.DataSource = lstDatosInf01.ToList(); rpServInf01.DataBind(); var lstDatosInf02 = from Serv in lstDatos.lstDetalleServ where Serv.Orden == 5 || Serv.Orden == 6 select Serv; rpServInf02.DataSource = lstDatosInf02.ToList(); rpServInf02.DataBind(); lblTituloEncuentro.Text = lstDatos.lstTextosHome.ElementAt(0).TituloEncuentranos; lblTextoEncuentro.Text = lstDatos.lstTextosHome.ElementAt(0).TextoEncuentranos; lblTextoBoton.Text = lstDatos.lstTextosHome.ElementAt(0).BotonEncuentranos; } string Idioma = Session["Idioma"].ToString(); switch (Idioma) { case "SPA": txtNombre.Attributes.Add("placeholder", "Nombre"); txtComentario.Attributes.Add("placeholder", "Comentario"); btnEnviar.Text = "Enviar"; break; default: txtNombre.Attributes.Add("placeholder", "Name"); txtComentario.Attributes.Add("placeholder", "Comment"); btnEnviar.Text = "Send"; break; } }
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs) { global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); BEHome ds = new BEHome(); global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny(); any1.Namespace = "http://www.w3.org/2001/XMLSchema"; any1.MinOccurs = new decimal(0); any1.MaxOccurs = decimal.MaxValue; any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any1); global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny(); any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"; any2.MinOccurs = new decimal(1); any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any2); global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute1.Name = "namespace"; attribute1.FixedValue = ds.Namespace; type.Attributes.Add(attribute1); global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute(); attribute2.Name = "tableTypeName"; attribute2.FixedValue = "tbl_HomeDataTable"; type.Attributes.Add(attribute2); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte())); ) { ; } if ((s1.Position == s1.Length)) { return type; } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return type; }
public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) { BEHome ds = new BEHome(); global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType(); global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence(); global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny(); any.Namespace = ds.Namespace; sequence.Items.Add(any); type.Particle = sequence; global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable(); if (xs.Contains(dsSchema.TargetNamespace)) { global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream(); global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream(); try { global::System.Xml.Schema.XmlSchema schema = null; dsSchema.Write(s1); for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) { schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current)); s2.SetLength(0); schema.Write(s2); if ((s1.Length == s2.Length)) { s1.Position = 0; s2.Position = 0; for (; ((s1.Position != s1.Length) && (s1.ReadByte() == s2.ReadByte())); ) { ; } if ((s1.Position == s1.Length)) { return type; } } } } finally { if ((s1 != null)) { s1.Close(); } if ((s2 != null)) { s2.Close(); } } } xs.Add(dsSchema); return type; }
public virtual int Update(BEHome dataSet) { return this.Adapter.Update(dataSet, "tbl_Home"); }
public virtual int Update(BEHome.tbl_HomeDataTable dataTable) { return this.Adapter.Update(dataTable); }
public virtual int Fill(BEHome.tbl_HomeDataTable dataTable) { this.Adapter.SelectCommand = this.CommandCollection[0]; if ((this.ClearBeforeFill == true)) { dataTable.Clear(); } int returnValue = this.Adapter.Fill(dataTable); return returnValue; }