protected void btn_grabar_Click(object sender, EventArgs e) { //txt_dni.Value == "" ? "1" : txt_dni.Value; BusinessSolicitud business = new BusinessSolicitud(); Cliente filtro = new Cliente(); filtro.nombres = txt_nom.Value; filtro.apellido_paterno = txt_pat.Value; filtro.apellido_materno = txt_mat.Value; filtro.codigo_tipo_documento = 0; filtro.numero_documento = txt_dni.Value; //grid_Clientes.DataSource = clientes.ObtenerClientes(datosCliente.nombres, datosCliente.apellido_paterno, datosCliente.apellido_materno, datosCliente.codigo_tipo_documento, datosCliente.numero_documento); DataTable dt = business.ObtenerClientes(filtro); if (dt.Rows.Count > 0) { grid_Clientes.DataSource = dt; grid_Clientes.DataBind(); grid_Clientes.HeaderRow.TableSection = TableRowSection.TableHeader; } else { grid_Clientes.DataSource = null; grid_Clientes.DataBind(); Response.Write("<script>alert('El Cliente no existe')</script>"); } }
protected void btn_Buscar_Click(object sender, EventArgs e) { BusinessSolicitud business = new BusinessSolicitud(); Cliente filtro = new Cliente(); filtro.nombres = txt_Nombre.Text; filtro.apellido_paterno = txt_ApPaterno.Text; filtro.apellido_materno = txt_ApMaterno.Text; filtro.codigo_tipo_documento = Convert.ToInt32(ddl_tipoDocumento.SelectedItem.Value); filtro.numero_documento = txt_numeroDocumento.Text; //grid_Clientes.DataSource = clientes.ObtenerClientes(datosCliente.nombres, datosCliente.apellido_paterno, datosCliente.apellido_materno, datosCliente.codigo_tipo_documento, datosCliente.numero_documento); DataTable dt = business.ObtenerClientes(filtro); if (dt != null) { grid_Clientes.DataSource = dt; grid_Clientes.DataBind(); Response.Write("<script>alert('El Cliente no existe')</script>"); } else { Response.Write("<script>alert('El Cliente no existe')</script>"); } }
protected void btn_Buscar_Click(object sender, EventArgs e) { BusinessSolicitud business = new BusinessSolicitud(); Mascota filtro = new Mascota(); var cliente = (Cliente)Session["solicitud_cliente"]; if (cliente != null) { filtro.codigo_cliente = cliente.codigo_cliente; } var genero = Session["genero_mascota"]; if (genero != null) { if (!string.IsNullOrEmpty(genero.ToString())) { filtro.genero = genero.ToString(); } else { filtro.genero = string.Empty; } } var edadMayorIgual = Session["edad_mascota"]; if (edadMayorIgual != null) { if (!string.IsNullOrEmpty(edadMayorIgual.ToString())) { filtro.edad = edadMayorIgual.ToString(); } else { filtro.edad = string.Empty; } } filtro.nombre_mascota = txt_BuscaNombre.Text; filtro.descripcion_raza = ddl_raza.SelectedItem.Text; DataTable dt = business.ObtenerMascotas(filtro); grid_Mascotas.DataSource = dt; grid_Mascotas.DataBind(); }
protected void btn_Guardar_Click(object sender, EventArgs e) { SolicitudPedigri solicitud = new SolicitudPedigri(); if (Session["solicitud_cliente"] != null) { solicitud.cliente = (Cliente)Session["solicitud_cliente"]; } if (Session["mascota_macho"] != null) { solicitud.mascota_padre = (Mascota)Session["mascota_macho"]; } if (Session["mascota_hembra"] != null) { solicitud.mascota_madre = (Mascota)Session["mascota_hembra"]; } if (Session["camada"] != null) { solicitud.camada_cachorros = (List <Mascota>)Session["camada"]; } solicitud.comentarios = txtComentarios.Text; solicitud.tipo_solicitud = Constantes.Constantes.TIPO_SOLICITUD_PEDIGRI; solicitud.usuario_creacion = new Empleado { codigo_usuario = Constantes.Constantes.CODUSUARIO_REGISTRO }; BusinessSolicitud business = new BusinessSolicitud(); if (business.RegistrarSolicitudPedigri(solicitud)) { // Mensaje Solicitud Registrada Correctamente Response.Write("<script>alert('El Registro de guardó Correctamente')</script>"); //Response.Redirect("ConsultaSolicitud.aspx"); } else { // Mensaje La solicitud no se registro Contactarse con el administrador del sistema Response.Write("<script>alert('Error al guardar registro')</script>"); } }
protected void btn_grabar_Click(object sender, EventArgs e) { BusinessSolicitud business = new BusinessSolicitud(); Mascota filtro = new Mascota(); filtro.codigo_cliente = 0; filtro.genero = ""; filtro.edad = ""; filtro.nombre_mascota = txt_nombre.Value; filtro.descripcion_raza = ddl_raza.SelectedItem.Text; DataTable dt = business.ObtenerMascotas(filtro); grid_Mascotas.DataSource = dt; grid_Mascotas.DataBind(); }
private void ListarRazas() { BusinessSolicitud business = new BusinessSolicitud(); DataTable dt = business.ObtenerRazas(0, string.Empty); DataRow dr = dt.NewRow(); dr["codigo_raza"] = "0"; dr["nombreRaza"] = "--Todos--"; //dt.Rows.Add(dr); dt.Rows.InsertAt(dr, 0); ddl_raza.DataSource = dt; ddl_raza.DataValueField = "codigo_raza"; ddl_raza.DataTextField = "nombreRaza"; ddl_raza.DataBind(); }
protected void btn_Buscar_Click(object sender, EventArgs e) { SolicitudPedigri filtro = new SolicitudPedigri(); if (!string.IsNullOrEmpty(txt_numSolicitud.Text)) { filtro.numero_solicitud = Convert.ToInt32(txt_numSolicitud.Text); } filtro.cliente = new Cliente(); filtro.cliente.nombres = txt_nombres.Text; BusinessSolicitud business = new BusinessSolicitud(); DataTable dt = business.ConsultarSolicitudes(filtro); grid_Solicitudes.DataSource = dt; grid_Solicitudes.DataBind(); }
protected void btn_grabar_Click(object sender, EventArgs e) { SolicitudAdopcion solicitud = new SolicitudAdopcion(); Cliente cliente = new Cliente(); Mascota mascota = new Mascota(); if (id_codigo_cliente.Text == "") { Response.Write("<script>alert('Seleccione el Cliente')</script>"); return; } if (id_codigo_mascota.Text == "") { Response.Write("<script>alert('Seleccione la Mascota')</script>"); return; } cliente.codigo_cliente = int.Parse(id_codigo_cliente.Text); mascota.codigo_mascota = int.Parse(id_codigo_mascota.Text); solicitud.cliente = cliente; solicitud.mascota = mascota; solicitud.comentarios = ""; solicitud.tipo_solicitud = Constantes.Constantes.TIPO_SOLICITUD_PEDIGRI; solicitud.UsuarioCreacion = Constantes.Constantes.CODUSUARIO_REGISTRO; BusinessSolicitud business = new BusinessSolicitud(); if (business.RegistrarSolicitudAdopcion(solicitud)) { // Mensaje Solicitud Registrada Correctamente Response.Write("<script>alert('El Registro de guardó Correctamente');top.fnCerrarDivConsulta3();</script>"); //Response.Redirect("ConsultaSolicitud.aspx"); } else { // Mensaje La solicitud no se registro Contactarse con el administrador del sistema Response.Write("<script>alert('Error al guardar registro')</script>"); } }
protected void btn_buscar_Click(object sender, EventArgs e) { SolicitudAdopcion filtro = new SolicitudAdopcion(); Cliente cliente = new Cliente(); Mascota mascota = new Mascota(); cliente.nombres = txt_nombre_cliente.Value; mascota.nombre_mascota = txt_nombre_mascota.Value; mascota.codigo_raza = int.Parse(ddl_raza.Text); filtro.numero_solicitud = int.Parse(txt_numero.Value == "" ? "0" : txt_numero.Value); filtro.cliente = cliente; filtro.numero_documento = txt_dni.Value; filtro.mascota = mascota; filtro.fecha_inicial = DateTime.Parse(txt_fec_ini.Value); filtro.fecha_final = DateTime.Parse(txt_fechafin.Value); BusinessSolicitud business = new BusinessSolicitud(); DataTable dt = business.ConsultarSolicitudesAdopcion(filtro); grid_Solicitudes.DataSource = dt; grid_Solicitudes.DataBind(); }