protected void Page_Load(object sender, EventArgs e) { string html = string.Empty; string itemA = @"<div class='col-md-2 single-member col-sm-4' onclick='Redirect({0})'> <div class='person'> <img class='img-responsive' src='img/member{4}.jpg'> </div> <div class='person-detail'> <div class='arrow-bottom'></div> <img src = 'img/{1}.gif' class='bandera' style='width: 45px'/> <h3>{2}</h3> <p>{3}</p> </div> </div></a>"; string itemB = @"<div class='col-md-2 single-member col-sm-4' onclick='Redirect({0})'> <div class='person-detail'> <div class='arrow-top'></div> <img src = 'img/{1}.gif' class='bandera' style='width: 45px'/> <h3>{2}</h3> <p>{3}</p> </div> <div class='person'> <img class='img-responsive' src='img/member{4}.jpg' > </div> </div>"; List <Expositor> exps = Expositor.GetExpositores(Server.MapPath(""), "No Expositor"); int i = 0; foreach (var exp in exps) { string tema = exp.Tema; if ((!String.IsNullOrEmpty(tema)) && (tema.Length > 40)) { tema = exp.Tema.Substring(0, 40) + "..."; } string item = (i % 2 == 0) ? itemA : itemB; html += string.Format(item, exp.ID, exp.Pais, exp.NombreCompleto, tema, exp.GetPhoto(Server.MapPath(""))); i++; if (i % 6 == 0) { html += "</div><div class='row'><br/></div><div class='row'>"; } } htmlExpositores.Text = html; }
public ActionResult Create(Expositor expositor) { if (ModelState.IsValid) { db.Expositor.Add(expositor); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.IdExp = new SelectList(db.Persona, "IdPers", "priNom_pers", expositor.IdExp); ViewBag.IdGIns = new SelectList(db.GradoInstruccion, "IdGraIns_", "deGrIn_gIns_", expositor.IdGIns); return View(expositor); }
private string dw(int id) { Expositor ex = exps.Find(x => x.ID == id); string item = @"<div onclick='Redirect({4})'><p class='cssCurso'>{0}</p> <img class='tg-imgExpositor' src='img/member{1}.jpg' /> <img class='tg-imgBandera' src='img/{3}.gif' /> <p class='cssExpositor'>{2}</p> </div>"; return(string.Format(item, ex.Tema, ex.GetPhoto(Server.MapPath("")), ex.NombreCompleto, ex.Pais, ex.ID)); }
protected void Page_Load(object sender, EventArgs e) { try { int id = Convert.ToInt32(Request.QueryString.Get("Id")); List <Expositor> exps = Expositor.GetExpositores(Server.MapPath(""), "No Expositor"); exps = exps.FindAll(exp => exp.ID == id); imgPhoto.ImageUrl = string.Format(@"img\member{0}.jpg", exps[0].GetPhoto(Server.MapPath(""))); imgFlag.ImageUrl = string.Format(@"img\{0}.gif", exps[0].Pais); txtNombreCompleto.Text = exps[0].NombreCompleto; txtTema.Text = exps[0].Tema; txtResumen.Text = exps[0].Resumen; } catch (Exception) { Response.Redirect("Index.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { exps = Expositor.GetExpositores(Server.MapPath(""), "*"); txt7_11.Text = dw(1); txt7_12.Text = dw(4); txt7_13.Text = dw(7); txt7_14.Text = dw(10); txt7_21.Text = dw(2); txt7_22.Text = dw(5); txt7_23.Text = dw(8); txt7_24.Text = dw(11); txt7_31.Text = dw(3); txt7_32.Text = dw(6); txt7_33.Text = dw(9); txt7_34.Text = dw(12); txt7_41.Text = ""; txt7_42.Text = ""; txt7_43.Text = ""; txt7_44.Text = dw(13); txt8_11.Text = dw(14); txt8_12.Text = dw(29); txt8_13.Text = dw(31); txt8_14.Text = dw(20); txt8_21.Text = dw(15); txt8_22.Text = dw(28); txt8_23.Text = dw(18); txt8_24.Text = dw(21); txt8_31.Text = dw(16); txt8_32.Text = ""; txt8_33.Text = dw(19); txt8_34.Text = dw(22); txt8_41.Text = ""; txt8_42.Text = ""; txt8_43.Text = ""; txt8_44.Text = dw(23); txt9_11.Text = dw(30); txt9_12.Text = dw(17); txt9_13.Text = ""; txt9_14.Text = ""; txt9_21.Text = dw(32); txt9_22.Text = dw(34); txt9_23.Text = ""; txt9_24.Text = ""; txt9_31.Text = dw(35); txt9_32.Text = dw(33); txt9_33.Text = ""; txt9_34.Text = ""; }