protected void Page_Load(object sender, EventArgs e) { Cliente_Dao conectar = new Cliente_Dao(); try { for (int i = 0; i < 10; i++) { newTitle[i] = new HtmlGenericControl("h2 class='puppycardTitle'"); newTitle[i].InnerHtml = "Nombre Perrito"; newimag[i] = new HtmlGenericControl("img src='../Imagenes/perrito1.jpg' /"); newDiv[i] = new HtmlGenericControl("div class='puppycard' "); newA[i] = new HtmlGenericControl("a href='Publicacion.aspx' runat='server' OnClick='algo(" + i + ")'class='col-sm-3' style=' padding: 20PX; '"); newDiv[i].Controls.Add(newimag[i]); newDiv[i].Controls.Add(newTitle[i]); newA[i].Controls.Add(newDiv[i]); UserMainContent.Controls.Add(newA[i]); } /*HtmlGenericControl newimag = new HtmlGenericControl("img style='width:100%' src ='" + imagencatalogo[i] + "'"); * newimag.ID = "image" + i; * HtmlGenericControl newtitle = new HtmlGenericControl("h3"); * newtitle.ID = "title" + i; * newtitle.InnerHtml = "NombrePerrito"; * HtmlGenericControl newdiv = new HtmlGenericControl("div "); * newdiv.ID = "div" + i; * newdiv.Controls.Add(newtitle); * Panel2.Controls.Add(newdiv);*/ }catch (Exception ex) { Session["id"] = 0; Response.Redirect("../index.aspx"); } }
protected void Button1_Click(object sender, EventArgs e) { Cliente_Dao datos = new Cliente_Dao(); datos.crearUsuario(this.TextBox1.Text, this.TextBox2.Text, this.TextBox7.Text, this.TextBox4.Text, this.TextBox5.Text, 1, 1, 1, this.TextBox3.Text); Response.Redirect("../index.aspx"); }
protected void LogIn_Click(object sender, EventArgs e) { Cliente_Dao datos = new Cliente_Dao(); int aux = 0; if (this.TextBox1.Text == "Admin" && this.TextBox2.Text == "Admin") { Session["id"] = 1; Response.Redirect("../GUI/PanelAdministrativo.aspx"); } else { aux = datos.iniciar_sesion(this.TextBox1.Text, this.TextBox2.Text); Console.Write(aux); Session["id"] = aux; Response.Redirect("GUI/UserMain.aspx"); } }
private void iniciartablas() { Cliente_Dao datos = new Cliente_Dao(); Estado[] estadosinfo = datos.estados(); Ciudad[] ciudadinfo = datos.ciudaes(); Zona[] zonasinfo = datos.zonas(); for (int i = 0; i < estadosinfo.Length; i++) { this.DropDownList1.Items.Add(estadosinfo[i].Estado_Nombre); } for (int i = 0; i < ciudadinfo.Length; i++) { this.DropDownList2.Items.Add(ciudadinfo[i].Ciudad_nombre); } for (int i = 0; i < zonasinfo.Length; i++) { this.DropDownList3.Items.Add(zonasinfo[i].Zona_nombre); } }
protected void Page_Load(object sender, EventArgs e) { Cliente_Dao conectar = new Cliente_Dao(); if (Session["id"] != null) { if (int.Parse(Session["id"].ToString()) > 0) { info = conectar.optener_info(int.Parse(Session["id"].ToString())); } else { Session["id"] = 0; Response.Redirect("../index.aspx"); } } else { Response.Redirect("../index.aspx"); } }