Пример #1
0
        private void GuardarButton_Click(object sender, EventArgs e)
        {
            if (Validacion())
            {
                var lab = new Laboratorios();

                lab.FechaIngreso = DateTime.Now;
                lab.Nombre       = nombreTextBox.Text;
                if (LaboratoriosBLL.GetLista(Utilidades.StringToInt(laboratorioIdTextBox.Text)).Count() == 0)
                {
                    if (LaboratoriosBLL.Insertar(lab))
                    {
                        MessageBox.Show("Se guardo el laboratorio");
                    }

                    else
                    {
                        MessageBox.Show("Error al guardar");
                    }
                }
                else
                {
                    LaboratoriosBLL.Modificar(Utilidades.StringToInt(laboratorioIdTextBox.Text), lab);
                    MessageBox.Show("Se modifico el laboratorio");
                }
            }
        }
Пример #2
0
        private void Buscarbutton_Click(object sender, EventArgs e)
        {
            Laboratorios lab = new Laboratorios();

            if (ValidarId("Ingrese el id de el laboratorio quiere buscar") && Search())
            {
                Fill(LaboratoriosBLL.Buscar(Utilidades.StringToInt(laboratorioIdTextBox.Text)));
            }
        }
Пример #3
0
        private bool Search()
        {
            if (LaboratoriosBLL.Buscar(Utilidades.StringToInt(laboratorioIdTextBox.Text)) == null)
            {
                MessageBox.Show("El id no existe");
                return(false);
            }

            return(true);
        }
Пример #4
0
        private void LlenaCombo()
        {
            categoriaComboBox.DataSource    = CategoriasBLL.GetLista();
            categoriaComboBox.DisplayMember = "Descripcion";
            categoriaComboBox.ValueMember   = "CategoriaId";

            LaboratoriocomboBox.DataSource    = LaboratoriosBLL.GetLista();
            LaboratoriocomboBox.DisplayMember = "Nombre";
            LaboratoriocomboBox.ValueMember   = "LaboratorioId";
        }
Пример #5
0
 private void EliminarButton_Click(object sender, EventArgs e)
 {
     if (ValidarId("Ingrese el id de el laboratorio que quiere eliminar") && Search())
     {
         LaboratoriosBLL.Eliminar(Utilidades.StringToInt(laboratorioIdTextBox.Text));
         MessageBox.Show("Se elimino el laboratorio");
     }
     else
     {
         MessageBox.Show("Error al eliminar");
     }
 }
        private void LaboratoriosReportViewer_Load(object sender, EventArgs e)
        {
            LaboratoriosRptViewer.Reset();
            LaboratoriosRptViewer.ProcessingMode = ProcessingMode.Local;

            LaboratoriosRptViewer.LocalReport.ReportPath = @"E:\aplicada 1\ProyectoFinal\ProyectoFinal\ProyectoFinal\Reporte\ReporteLaboratorios.rdlc";

            ReportDataSource source = new ReportDataSource("DataSetLaboratorios", LaboratoriosBLL.GetLista());

            LaboratoriosRptViewer.LocalReport.DataSources.Add(source);

            this.LaboratoriosRptViewer.RefreshReport();
        }
        private void buscarButton_Click(object sender, EventArgs e)
        {
            if (FiltrocomboBox.SelectedIndex == 0)
            {
                LaboratoriosdataGridView.DataSource = LaboratoriosBLL.GetLista();
            }

            if (FiltrocomboBox.SelectedIndex == 1)
            {
                LaboratoriosdataGridView.DataSource = LaboratoriosBLL.GetLista(Utilidades.StringToInt(FiltrotextBox.Text));
            }

            if (FiltrocomboBox.SelectedIndex == 2)
            {
                LaboratoriosdataGridView.DataSource = LaboratoriosBLL.GetLista(FiltrotextBox.Text);
            }

            if (FiltrocomboBox.SelectedIndex == 3)
            {
                LaboratoriosdataGridView.DataSource = LaboratoriosBLL.GetLista(DesdedateTimePicker.Value, HastadateTimePicker.Value);
            }
        }
Пример #8
0
        public JsonResult Lista(int id)
        {
            var listado = LaboratoriosBLL.GetLista();

            return(Json(listado));
        }