public void ResultadosCategoria(string nombre = null)
        {
            if (nombre == null)
            {
                /*
                 * Se requiere este seteo para que se posibilite el mapeo de columnas que se Agregaron
                 * desde el diseñador, Click con boton derecho sobre seleccion de grilla -> Edit Columns
                 */
                this.GridCategoria.AutoGenerateColumns = false;
                List <Categoria> lista = ManagerDB <Categoria> .findAll();

                this.GridCategoria.DataSource = lista;
                Cursor.Current = Cursors.Default;
            }

            if (nombre != null)
            {
                this.GridCategoria.AutoGenerateColumns = false;
                List <Categoria> lista = ManagerDB <Categoria> .findAll(String.Format("nombre_categoria like '%{0}%'", nombre));

                this.GridCategoria.DataSource = lista;
            }

            this.ShowDialog();
        }
Beispiel #2
0
        public void ResultadosProveedor(int idProveedor = 0, string nombre = null)
        {
            if (idProveedor == 0 && nombre == null)
            {
                /*
                 * Se requiere este seteo para que se posibilite el mapeo de columnas que se Agregaron
                 * desde el diseñador, Click con boton derecho sobre seleccion de grilla -> Edit Columns
                 */
                this.gridProveedor.AutoGenerateColumns = false;
                List <Proveedor> lista = ManagerDB <Proveedor> .findAll();

                this.gridProveedor.DataSource = lista;
                Cursor.Current = Cursors.Default;
            }

            if (idProveedor != 0 && nombre == null)
            {
                this.gridProveedor.AutoGenerateColumns = false;
                List <Proveedor> lista = ManagerDB <Proveedor> .findAll(String.Format("Id Proveedor = '{0}'", idProveedor));

                this.gridProveedor.DataSource = lista;
            }

            if (idProveedor == 0 && nombre != null)
            {
                this.gridProveedor.AutoGenerateColumns = false;
                List <Proveedor> lista = ManagerDB <Proveedor> .findAll(String.Format("nombre_Proveedor like '%{0}%'", nombre));

                this.gridProveedor.DataSource = lista;
            }
            buscarIDProveedorNombre(idProveedor, nombre);

            this.ShowDialog();
        }
Beispiel #3
0
        private void CrearTurno()
        {
            turno.FechaHora = this.dateTimePicker1.Value;
            Profesional prof;

            turno.DniPaciente = Convert.ToInt32(this.dniPaciente.Text);

            try
            {
                prof = ManagerDB <Profesional> .findAll
                           (String.Format("matricula = '{0}'",
                                          this.matriculaProfesional.Text))[0];
            }
            catch (NullReferenceException) {
                MessageBox.Show("Profesional no existe", "ERROR");
                return;
            }

            turno.Asistio           = false;
            turno.CodigoProfesional = prof.Id;

            if (!turno.saveObj())
            {
                MessageBox.Show("No se pudo agregar el nuevo turno", "ERROR");
            }

            MessageBox.Show("Turno agregado exitosamente", "Operación exitosa");
            return;
        }
Beispiel #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(this.maskedMatricula.Text))
            {
                MessageBox.Show("Se debe ingresar una matrícula válida", "ERROR");
                return;
            }
            List <Profesional> p = ManagerDB <Profesional> .findAll(String.Format("matricula = '{0}'", this.maskedMatricula.Text));

            if (p == null)
            {
                MessageBox.Show("No se encontró nada");
                return;
            }

            //MessageBox.Show(p[0].ToString());
            if (this.modificarChk.Checked)
            {
                new ProfesionalAMFrm().ShowProfesional(p[0], new ProfesionalesResultsFrm());
            }
            else
            {
                new ProfEspFrm().MostrarEspecialidades(p[0]);
            }
            this.Dispose();
        }
Beispiel #5
0
 private void CargarCategoriasBtn_Click(object sender, EventArgs e)
 {
     // propiedades del control a configurar para que se carguen en el control
     this.CategoriasCbo.DisplayMember = "NombreCategoria";
     this.CategoriasCbo.ValueMember   = "CategoriaId";
     this.CategoriasCbo.DataSource    = ManagerDB <Categoria> .findAll();
 }
Beispiel #6
0
 public DetalleOrdenAMFrm()
 {
     InitializeComponent();
     this.ProductoCbo.DisplayMember = "Descripcion";
     this.ProductoCbo.ValueMember   = "ProductoId";
     this.ProductoCbo.DataSource    = ManagerDB <Producto> .findAll();
 }
Beispiel #7
0
        private void OrdenAMFrm_Load(object sender, EventArgs e)
        {
            // propiedades del control a configurar para que se carguen en el control
            this.EmpleadoCbo.DataSource = ManagerDB <Empleado> .findAll();

            this.ClienteCbo.DataSource = ManagerDB <Cliente> .findAll();
        }
Beispiel #8
0
        public void ResultadosEspecialidades(int codigo = -1, string nombre = null)
        {
            List <Especialidad> lista;

            if (codigo == -1 && nombre == null)
            {
                lista = ManagerDB <Especialidad> .findAll();
            }
            else if (codigo != -1 && nombre == null)
            {
                lista = ManagerDB <Especialidad> .findAll(String.Format("codigo = {0}", codigo));
            }
            else if (nombre != null && codigo == -1)
            {
                lista = ManagerDB <Especialidad> .findAll(String.Format("nombre like '%{0}%'", nombre));
            }
            else
            {
                lista = ManagerDB <Especialidad> .findAll(String.Format("nombre like '%{0}%' and codigo = {1}", nombre, codigo));
            }

            if (lista == null)
            {
                MessageBox.Show("No se encontró nada", "ERROR");
                return;
            }

            lista.Sort((esp1, esp2) => (esp1.Codigo.CompareTo(esp2.Codigo)));
            this.gridEspecialidades.DataSource = lista;
            this.ShowDialog();
        }
Beispiel #9
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (!this.codigoEspecialidad.Checked && !this.nombreEspecialidad.Checked)
            {
                MessageBox.Show("Falta ingresar la especialidad", "Faltan criterios");
                return;
            }

            ProfesionalEspecialidad pe = new ProfesionalEspecialidad()
            {
                ProfesionalObj    = this.prof,
                CodigoProfesional = this.prof.Id
            };

            if (this.codigoEspecialidad.Checked)
            {
                try
                {
                    pe.EspecialidadObj = (Especialidad)ManagerDB <Especialidad> .findbyKey(
                        Convert.ToInt32(this.maskedCodigo.Text));
                }
                catch (System.FormatException) {
                    pe.EspecialidadObj = null;
                }
            }
            else
            {
                try
                {
                    pe.EspecialidadObj = ManagerDB <Especialidad> .findAll(
                        String.Format("nombre like '{0}'", this.textNombre.Text))[0];
                }
                catch (Exception)
                {
                    pe.EspecialidadObj = null;
                }
            }

            if (pe.EspecialidadObj == null)
            {
                MessageBox.Show("Especialidad incorreta", "ERROR");
                return;
            }

            pe.FechaAlta     = this.dateTimePicker1.Value;
            pe.Disponible    = this.estaDisponible.Checked;
            pe.Observaciones = this.textObservaciones.Text;

            if (!pe.saveObj())
            {
                MessageBox.Show("Error al ingresar nueva especialidad en el profesional", "ERROR");
                return;
            }
            MessageBox.Show(String.Format("Nueva especialidad cargada en el/la profesional {0}",
                                          pe.ProfesionalObj.Apellido.ToUpper()), "Operación exitosa");


            this.Actualizar_Grid(this.prof);
        }
Beispiel #10
0
        public void ResultadosCategoria()
        {
            this.gridCategoria.AutoGenerateColumns = false;
            List <Categoria> lista = ManagerDB <Categoria> .findAll();

            this.gridCategoria.DataSource = lista;
            Cursor.Current = Cursors.Default;
            this.ShowDialog();
        }
        public void ResultadosOrden(String ord)
        {
            this.gridDetalleOrden.AutoGenerateColumns = false;
            orden = ord;
            List <DetalleOrden> lista = ManagerDB <DetalleOrden> .findAll(String.Format("orden_id = '{0}'", ord));

            this.gridDetalleOrden.DataSource = lista;
            Cursor.Current = Cursors.Default;
            this.ShowDialog();
        }
Beispiel #12
0
        private void PrincipalFrm_Load(object sender, EventArgs e)
        {
            var list = ManagerDB <Ingrediente> .findAll();

            //cargar contenido de dropdown
            this.IngredientesCbo.DisplayMember = "Nombre";
            this.IngredientesCbo.ValueMember   = "Codigo";
            this.IngredientesCbo.DataSource    = list;
            this.IngredientesCbo.Refresh();
        }
Beispiel #13
0
        private void buscarIDProveedorNombre(int idProveedor, string nombre)
        {
            if (idProveedor != 0 && nombre != null)
            {
                this.gridProveedor.AutoGenerateColumns = false;
                List <Proveedor> lista = ManagerDB <Proveedor> .findAll(String.Format("id Proveedor = '{0}' and nombre like '%{1}%'", IdProveedor, nombre));

                this.gridProveedor.DataSource = lista;
            }
        }
        public ProductoAMFrm()
        {
            InitializeComponent();
            this.ProveedorCbo.DisplayMember = "NombreProveedor";
            this.ProveedorCbo.ValueMember   = "ProveedorId";
            this.ProveedorCbo.DataSource    = ManagerDB <Proveedor> .findAll();

            this.CategoriaCbo.DisplayMember = "NombreCategoria";
            this.CategoriaCbo.ValueMember   = "CategoriaId";
            this.CategoriaCbo.DataSource    = ManagerDB <Categoria> .findAll();
        }
Beispiel #15
0
        private void PacienteFrm_Load(object sender, EventArgs e)
        {
            /*
             * Se requiere este seteo para que se posibilite el mapeo de columnas que se Agregaron
             * desde el diseñador, Click con boton derecho sobre seleccion de grilla -> Edit Columns
             */
            this.gridPacientes.AutoGenerateColumns = false;
            List <Paciente> lista = ManagerDB <Paciente> .findAll();

            this.gridPacientes.DataSource = lista;
        }
Beispiel #16
0
        public void ResultadosCategoria(string nombre = null)
        {
            this.gridCategoria.AutoGenerateColumns = false;
            List <Categoria> lista = new List <Categoria>();

            lista = ManagerDB <Categoria> .findAll(String.Format("nombre_categoria like '%{0}%'", nombre));

            this.gridCategoria.DataSource = lista;
            Cursor.Current = Cursors.Default;
            this.ShowDialog();
        }
        public OrdenAMFrm()
        {
            InitializeComponent();

            this.EmpleadoCbo.DisplayMember = "Apellido";
            this.EmpleadoCbo.ValueMember   = "EmpleadoId";
            this.EmpleadoCbo.DataSource    = ManagerDB <Empleado> .findAll();

            this.ClienteCbo.DisplayMember = "NombreContacto";
            this.ClienteCbo.ValueMember   = "ClienteId";
            this.ClienteCbo.DataSource    = ManagerDB <Cliente> .findAll();
        }
Beispiel #18
0
        public void Actualizar_Grid(Profesional p)
        {
            this.gridEspecialidades.AutoGenerateColumns = false;
            List <ProfesionalEspecialidad> listaProfEsp = ManagerDB <ProfesionalEspecialidad> .findAll(
                String.Format("codigoprofesional = {0}", p.Id));

            if (listaProfEsp == null)
            {
                return;
            }
            listaProfEsp.Sort((pe1, pe2) => pe1.CodigoEspecialidad.CompareTo(pe2.CodigoEspecialidad));
            this.gridEspecialidades.DataSource = listaProfEsp;

            Cursor.Current = Cursors.Default;
        }
Beispiel #19
0
        public void ShowTurnos(Paciente p)
        {
            this.pac = p;
            this.nombrePaciente.Text = String.Format("{0}, {1}", this.pac.Apellido.ToUpper(), this.pac.Nombres);
            this.dniPaciente.Text    = this.pac.Dni.ToString();

            this.gridTurnos.AutoGenerateColumns = false;
            List <Turno> listaTurnos = ManagerDB <Turno> .findAll(String.Format(
                                                                      "dnipaciente = {0}", this.pac.Dni));

            this.gridTurnos.DataSource = listaTurnos;
            Cursor.Current             = Cursors.Default;

            this.ShowDialog();
        }
Beispiel #20
0
        internal void ShowObrasSociales(ObraSocial os)
        {
            this.os = os;

            this.CodigoObraSocial.Text = String.Format("{0}", this.os.Codigo);
            this.NombreObraSocial.Text = this.os.Nombre;

            this.GridPacienteObraSocial.AutoGenerateColumns = false;
            List <PacienteObraSocial> listaPacienteObraSocial = ManagerDB <PacienteObraSocial> .findAll(String.Format(
                                                                                                            "codigoObraSocial = {0}", this.os.Codigo));

            this.GridPacienteObraSocial.DataSource = listaPacienteObraSocial;
            Cursor.Current = Cursors.Default;

            this.ShowDialog();
        }
Beispiel #21
0
        public void ShowOrden(Orden ordenIvk, IFormGridReload frmGrid)
        {
            _frmGrid                      = frmGrid;
            this.operacion                = OperacionForm.frmModificacion;
            this.Text                     = "Modificacion de informacion de orden";
            orden                         = ordenIvk;
            this.OrdenIdTxt.Text          = orden.OrdenId.ToString();
            this.EmpleadoCbo.SelectedItem = orden.EmpleadoObj;
            //cliente
            this.ClienteCbo.SelectedItem = orden.ClienteObj;
            this.FechaOrdenDtp.Value     = orden.FechaOrden;
            this.DescuentoTxt.Text       = orden.Descuento.ToString();
            this.gridDetallesOrden.AutoGenerateColumns = false;
            this.gridDetallesOrden.DataSource          = ManagerDB <DetalleOrden> .findAll("orden_id= " + orden.OrdenId.ToString());

            this.ShowDialog();
        }
Beispiel #22
0
        public void VerProfesionales(Especialidad esp)
        {
            this.esp            = esp;
            this.nombreEsp.Text = this.esp.Nombre;
            this.codigoEsp.Text = this.esp.Codigo.ToString();
            List <ProfesionalEspecialidad> lista = ManagerDB <ProfesionalEspecialidad> .findAll(
                String.Format("codigoespecialidad = {0}", this.esp.Codigo));

            if (lista == null)
            {
                MessageBox.Show("No hay profesionales registrados con la especialidad: {0}", this.esp.Nombre);
                return;
            }

            this.gridProfesionales.DataSource = lista;
            this.ShowDialog();
        }
Beispiel #23
0
        public void ResultadosProveedor(string nombre = null)
        {
            if (nombre == null)
            {
                this.gridProveedor.AutoGenerateColumns = false;
                List <Proveedor> lista = ManagerDB <Proveedor> .findAll();

                this.gridProveedor.DataSource = lista;
                Cursor.Current = Cursors.Default;
            }
            if (nombre != null)
            {
                this.gridProveedor.AutoGenerateColumns = false;
                List <Proveedor> lista = ManagerDB <Proveedor> .findAll(String.Format("nombre_proveedor like '%{0}%'", nombre));

                this.gridProveedor.DataSource = lista;
            }
            this.ShowDialog();
        }
        public void ResultadosEmpleado(int idEmpleado = 0, string nombreEmpleado = null)
        {
            if (idEmpleado == 0 && nombreEmpleado == "")
            {
                /*
                 * Se requiere este seteo para que se posibilite el mapeo de columnas que se Agregaron
                 * desde el diseñador, Click con boton derecho sobre seleccion de grilla -> Edit Columns
                 */
                this.gridEmpleado.AutoGenerateColumns = false;
                List <Empleado> lista = ManagerDB <Empleado> .findAll();

                this.gridEmpleado.DataSource = lista;
                Cursor.Current = Cursors.Default;
            }

            if (idEmpleado != 0 && nombreEmpleado == "")
            {
                this.gridEmpleado.AutoGenerateColumns = false;
                List <Empleado> lista = ManagerDB <Empleado> .findAll(String.Format("empleado_id = '{0}'", idEmpleado));

                this.gridEmpleado.DataSource = lista;
            }

            if (idEmpleado == 0 && nombreEmpleado != "")
            {
                this.gridEmpleado.AutoGenerateColumns = false;
                //ESTE NOMBRE SE DEBE CORRESPONDE CON LA BASA nombre del string = nombre de la base;
                List <Empleado> lista = ManagerDB <Empleado> .findAll(String.Format("nombre like '%{0}%'", nombreEmpleado));

                this.gridEmpleado.DataSource = lista;
            }
            if (idEmpleado != 0 && nombreEmpleado != "")
            {
                this.gridEmpleado.AutoGenerateColumns = false;
                List <Empleado> lista = ManagerDB <Empleado> .findAll();

                this.gridEmpleado.DataSource = lista;
            }

            this.ShowDialog();
        }
Beispiel #25
0
        public void ResultadosCliente(string cedularuc = null, string nombrecia = null)
        {
            if (cedularuc == null && nombrecia == null)
            {
                /*
                 * Se requiere este seteo para que se posibilite el mapeo de columnas que se Agregaron
                 * desde el diseñador, Click con boton derecho sobre seleccion de grilla -> Edit Columns
                 */
                this.gridClientes.AutoGenerateColumns = false;
                List <Cliente> lista = ManagerDB <Cliente> .findAll();

                this.gridClientes.DataSource = lista;
                Cursor.Current = Cursors.Default;
            }

            if (cedularuc != null && nombrecia == null)
            {
                this.gridClientes.AutoGenerateColumns = false;
                List <Cliente> lista = ManagerDB <Cliente> .findAll(String.Format("cedula_ruc = '{0}'", cedularuc));

                this.gridClientes.DataSource = lista;
            }

            if (cedularuc == null && nombrecia != null)
            {
                this.gridClientes.AutoGenerateColumns = false;
                List <Cliente> lista = ManagerDB <Cliente> .findAll(String.Format("nombre_cia like '%{0}%'", nombrecia));

                this.gridClientes.DataSource = lista;
            }
            if (cedularuc != null && nombrecia != null)
            {
                this.gridClientes.AutoGenerateColumns = false;
                List <Cliente> lista = ManagerDB <Cliente> .findAll(String.Format("cedula_ruc = '{0}' and nombre_cia like '%{1}%'", cedularuc, nombrecia));

                this.gridClientes.DataSource = lista;
            }

            this.ShowDialog();
        }
        public void ResultadosProducto(int idProducto = 0, string nombre = "")
        {
            if (idProducto == 0 && nombre == "")
            {
                /*
                 * Se requiere este seteo para que se posibilite el mapeo de columnas que se Agregaron
                 * desde el diseñador, Click con boton derecho sobre seleccion de grilla -> Edit Columns
                 */
                this.gridProducto.AutoGenerateColumns = false;
                List <Producto> lista = ManagerDB <Producto> .findAll();

                this.gridProducto.DataSource = lista;
                Cursor.Current = Cursors.Default;
            }

            if (idProducto != 0 && nombre == "")
            {
                this.gridProducto.AutoGenerateColumns = false;
                List <Producto> lista = ManagerDB <Producto> .findAll(String.Format("producto_id = '{0}'", idProducto));

                this.gridProducto.DataSource = lista;
            }

            if (idProducto == 0 && nombre != "")
            {
                this.gridProducto.AutoGenerateColumns = false;
                List <Producto> lista = ManagerDB <Producto> .findAll(String.Format("descripcion like '%{0}%'", nombre));

                this.gridProducto.DataSource = lista;
            }
            if (idProducto != 0 && nombre != "")
            {
                this.gridProducto.AutoGenerateColumns = false;
                List <Producto> lista = ManagerDB <Producto> .findAll(String.Format("producto_id = '{0}' and descripcion like '%{1}%'", idProducto, nombre));

                this.gridProducto.DataSource = lista;
            }

            this.ShowDialog();
        }
Beispiel #27
0
        public void ResultadosPaciente(int dni = -1, string apellido = null)
        {
            this.gridPacientes.AutoGenerateColumns = false;
            List <Paciente> lista;

            if (dni == -1 && apellido == null)
            {
                /*
                 * Se requiere este seteo para que se posibilite el mapeo de columnas que se Agregaron
                 * desde el diseñador, Click con boton derecho sobre seleccion de grilla -> Edit Columns
                 */
                lista = ManagerDB <Paciente> .findAll();

                //lista.Sort((p1, p2) => p1.Dni.CompareTo(p2.Dni));
                lista.Sort((p1, p2) => String.Compare(p1.Apellido, p2.Apellido));
                Cursor.Current = Cursors.Default;
            }
            else if (dni != -1 && apellido == null)
            {
                lista = ManagerDB <Paciente> .findAll(String.Format("dni={0}", dni));
            }
            else if (dni == -1 && apellido != null)
            {
                lista = ManagerDB <Paciente> .findAll(String.Format("apellido like '%{0}%'", apellido));
            }
            else
            {
                lista = ManagerDB <Paciente> .findAll(String.Format("dni= {0} and apellido like '%{1}%'", dni, apellido));
            }

            if (lista == null)
            {
                MessageBox.Show("No se encontró nada");
                return;
            }

            lista.Sort((p1, p2) => p1.Apellido.CompareTo(p2.Apellido));
            this.gridPacientes.DataSource = lista;
            this.ShowDialog();
        }
Beispiel #28
0
        public void ResultadosObraSocial(int codigo = -1, string nombre = null)
        {
            this.gridObrasSociales.AutoGenerateColumns = false;
            List <ObraSocial> lista;

            if (codigo == -1 && nombre == null)
            {
                /*
                 * Se requiere este seteo para que se posibilite el mapeo de columnas que se Agregaron
                 * desde el diseñador, Click con boton derecho sobre seleccion de grilla -> Edit Columns
                 */
                lista = ManagerDB <ObraSocial> .findAll();

                //lista.Sort((p1, p2) => p1.Dni.CompareTo(p2.Dni));
                lista.Sort((os1, os2) => String.Compare(os1.Nombre, os2.Nombre));
                Cursor.Current = Cursors.Default;
            }
            else if (codigo != -1 && nombre == null)
            {
                lista = ManagerDB <ObraSocial> .findAll(String.Format("codigo={0}", codigo));
            }
            else if (codigo == -1 && nombre != null)
            {
                lista = ManagerDB <ObraSocial> .findAll(String.Format("nombre like '%{0}%'", nombre));
            }
            else
            {
                lista = ManagerDB <ObraSocial> .findAll(String.Format("codigo= {0} and nombre like '%{1}%'", codigo, nombre));
            }

            if (lista == null)
            {
                MessageBox.Show("No se encontró nada");
                return;
            }

            this.gridObrasSociales.DataSource = lista;
            this.ShowDialog();
        }
Beispiel #29
0
        public void ResultadosProfesional(string matricula = null, string apellido = null)
        {
            this.gridProfesionales.AutoGenerateColumns = false;
            List <Profesional> lista;

            if (matricula == null && apellido == null)
            {
                /*
                 * Se requiere este seteo para que se posibilite el mapeo de columnas que se Agregaron
                 * desde el diseñador, Click con boton derecho sobre seleccion de grilla -> Edit Columns
                 */
                lista = ManagerDB <Profesional> .findAll();

                lista.Sort((p1, p2) => String.Compare(p1.Apellido, p2.Apellido));
                Cursor.Current = Cursors.Default;
            }
            else if (matricula != null && apellido == null)
            {
                lista = ManagerDB <Profesional> .findAll(String.Format("matricula = '{0}'", matricula));
            }
            else if (matricula == null && apellido != null)
            {
                lista = ManagerDB <Profesional> .findAll(String.Format("apellido like '%{0}%'", apellido));
            }
            else
            {
                lista = ManagerDB <Profesional> .findAll(String.Format
                                                             ("matricula = '{0}' and apellido like '%{1}%'", matricula, apellido));
            }

            if (lista == null)
            {
                MessageBox.Show("No se encontró nada");
                return;
            }

            this.gridProfesionales.DataSource = lista;
            this.ShowDialog();
        }
Beispiel #30
0
        private void RefrescarGrid(int dnipaciente, string matricula, DateTime fecha)
        {
            string fechaSql = fecha == DateTime.Today? "" : String.Format("and fechahora = '{0}'",
                                                                          fecha.ToString("yyyy-MM-dd HH:mm:ss"));

            if (dnipaciente == -1 && matricula == null)
            {
                /*
                 * Se requiere este seteo para que se posibilite el mapeo de columnas que se Agregaron
                 * desde el diseñador, Click con boton derecho sobre seleccion de grilla -> Edit Columns
                 */
                lista = ManagerDB <Turno> .findAll();

                lista.Sort((t1, t2) => t1.DniPaciente - t2.DniPaciente);
                Cursor.Current = Cursors.Default;
            }
            else if (matricula != null && dnipaciente == -1)
            {
                List <Profesional> prof = ManagerDB <Profesional> .findAll(String.Format("matricula = '{0}'", matricula));

                lista = prof == null ? null : ManagerDB <Turno> .findAll(String.Format("codigoprofesional={0} {1}", prof[0].Id,
                                                                                       fechaSql));
            }
            else if (matricula == null && dnipaciente != -1)
            {
                lista = ManagerDB <Turno> .findAll(String.Format("dnipaciente={0} {1}", dnipaciente, fechaSql));
            }
            else
            {
                List <Profesional> prof = ManagerDB <Profesional> .findAll(String.Format("matricula = '{0}'", matricula));

                lista = prof == null ? null : ManagerDB <Turno> .findAll(String.Format("codigoprofesional={0} and dnipaciente={1} {2}", prof[0].Id, dnipaciente, fechaSql));
            }


            this.turnosGrid.DataSource = lista;
        }