protected void FormView1_ItemInserting(object sender, FormViewInsertEventArgs e) { foreach (DictionaryEntry entry in e.Values) { CheckBox a = (CheckBox)FormView1.FindControl("CheckBox1"); if (a.Checked) { if (entry.Value.Equals("")) { String ScriptAct = "document.getElementById('alertR').style.display='block';"; ScriptManager.RegisterStartupScript(this, this.GetType(), "show", ScriptAct, true); e.Cancel = true; } else { TextBox tex = (TextBox)FormView1.FindControl("CorreoTextBox"); DataSet1TableAdapters.UsuarioTableAdapter obj = new DataSet1TableAdapters.UsuarioTableAdapter(); Object correo = obj.ConsultarCorreo(tex.Text); if (correo != null) { String ScriptAct = "document.getElementById('alertCor').style.display='block';"; ScriptManager.RegisterStartupScript(this, this.GetType(), "show", ScriptAct, true); e.Cancel = true; } } } else { String ScriptAct = "document.getElementById('alertCh').style.display='block';"; ScriptManager.RegisterStartupScript(this, this.GetType(), "show", ScriptAct, true); e.Cancel = true; } } }
protected void sebtnIniciarSesion_Click(object sender, EventArgs e) { if (Iniemail.Text != "" && Inipwd.Text != "") { try { DataSet1TableAdapters.UsuarioTableAdapter obj1 = new DataSet1TableAdapters.UsuarioTableAdapter(); Object correo = obj1.ConsultarCorreo(Iniemail.Text); if (correo != null) { DataSet1TableAdapters.UsuarioTableAdapter obj = new DataSet1TableAdapters.UsuarioTableAdapter(); Object nombre = obj.IniciarSesion(Iniemail.Text, Inipwd.Text); if (nombre != null) { Session["nombre"] = nombre; Response.Redirect("Home.aspx"); } } else { DataSet1TableAdapters.ClienteTableAdapter obj = new DataSet1TableAdapters.ClienteTableAdapter(); Object nombre = obj.IniciarSesionCliente(Iniemail.Text, Inipwd.Text); if (nombre != null) { Session["nombre"] = nombre; Response.Redirect("Home.aspx"); } else { String ScriptAct = "document.getElementById('alertCon').style.display='block';"; ScriptManager.RegisterStartupScript(this, this.GetType(), "show", ScriptAct, true); } } } catch { String ScriptAct = "document.getElementById('alertCon').style.display='block';"; ScriptManager.RegisterStartupScript(this, this.GetType(), "show", ScriptAct, true); } } else { String ScriptAct = "document.getElementById('alertSinC').style.display='block';"; ScriptManager.RegisterStartupScript(this, this.GetType(), "show", ScriptAct, true); } }
protected void FormView1_ItemInserted(object sender, FormViewInsertedEventArgs e) { TextBox a = (TextBox)FormView1.FindControl("correoTextBox"); TextBox b = (TextBox)FormView1.FindControl("contraseñaTextBox"); DataSet1TableAdapters.UsuarioTableAdapter obj = new DataSet1TableAdapters.UsuarioTableAdapter(); Object nombre = obj.IniciarSesion(a.Text, b.Text); if (nombre != null) { Session["nombre"] = nombre; Response.Redirect("Home.aspx"); } else { String ScriptAct = "document.getElementById('alertCon').style.display='block';"; ScriptManager.RegisterStartupScript(this, this.GetType(), "show", ScriptAct, true); } }
public Almacenaje() { //Se instancian los elementos necesarios del dataset DataSetLocal = new DataSet1(); adaptadorUsuarios = new DataSet1TableAdapters.UsuarioTableAdapter(); adaptadorReceta = new DataSet1TableAdapters.RecetaTableAdapter(); adaptadorRecetaConfirmada = new DataSet1TableAdapters.Receta_Confirmada1TableAdapter(); adaptadorModerador = new DataSet1TableAdapters.ModeradorTableAdapter(); adaptadorAdministrador = new DataSet1TableAdapters.AdministradorTableAdapter(); adaptadorEspecialista = new DataSet1TableAdapters.EspecialistaTableAdapter(); adaptadorRestaurante = new DataSet1TableAdapters.RestauranteTableAdapter(); adaptadorRecetaAModificar = new DataSet1TableAdapters.Receta_A_ModificarTableAdapter(); adaptadorForo = new DataSet1TableAdapters.MensajeForoTableAdapter(); adaptadorMensajePrivado = new DataSet1TableAdapters.MensajePrivadoTableAdapter(); adaptadorConsultas = new DataSet1TableAdapters.QueriesTableAdapter(); adaptadorProductos = new DataSet1TableAdapters.ProductoTableAdapter(); adaptadorPedidos = new DataSet1TableAdapters.PedidoTableAdapter(); adaptadorComentario = new DataSet1TableAdapters.ComentarioTableAdapter(); }