protected void bAceptar_Click(object sender, ImageClickEventArgs e) { if ((tbConfirmar.Text.ToLower() != tbEmail.Text.ToLower()) || (tbConfirmar.Text == "" && tbEmail.Text == "")) lError.Text = "Verifique las direcciones de Email, deben ser identicas y no vacias."; else { GI.Managers.Clientes.mngClientes mng = new GI.Managers.Clientes.mngClientes(); GI.BR.Clientes.ClientePedido cp = mng.RecuperarClientePedidoPorEmail(tbEmail.Text); if (cp == null) { Session["Email"] = tbEmail.Text; Response.Redirect("AltaClientePedido.aspx"); } else { Session["ClientePedido"] = cp; Response.Redirect("Pedido.aspx"); } //recupero cliente por email. //si lo encuentro red a cargarpedido //sino a cargar cliente. } }
private void bBuscar_Click(object sender, EventArgs e) { if (!checkBox1.Checked) { if (tbNombres.Text.Length < 2) { GI.Framework.General.GIMsgBox.Show("Debe al menos ingresar 2 caracteres en el campo Nombres / Apellido", GI.Framework.General.enumTipoMensaje.Advertencia); return; } } GI.Managers.Clientes.mngClientes mngClientes = new GI.Managers.Clientes.mngClientes(); if(checkBox1.Checked) this.clientes = mngClientes.RecuperarClientesTodos((GI.Managers.Clientes.enumTipoBusquedaCliente)cbTipoCliente.SelectedItem); else this.clientes = mngClientes.RecuperarClientes((GI.Managers.Clientes.enumTipoBusquedaCliente)cbTipoCliente.SelectedItem, this.tbNombres.Text); if (clientes.Count < 1) { GI.Framework.General.GIMsgBox.Show("No se han encontrado clientes coincidentes con el criterio.", GI.Framework.General.enumTipoMensaje.Advertencia); return; } this.DialogResult = DialogResult.OK; this.Close(); }