private void Buscarbutton_Click_1(object sender, EventArgs e)
 {
     if (validarId("Favor ingresar el id del mensajero que desea buscar") && ValidarBuscar())
     {
         LLenar(MensajerosBLL.Buscar(RU.StringToInt(mensajeroIdTextBox.Text)));
     }
 }
Example #2
0
 private void Cargar()
 {
     FiltrocomboBox.Items.Insert(0, "ID");
     FiltrocomboBox.Items.Insert(1, "Apellido");
     FiltrocomboBox.DataSource         = FiltrocomboBox.Items;
     FiltrocomboBox.DisplayMember      = "ID";
     MensajerosdataGridView.DataSource = MensajerosBLL.GetLista();
 }
 private bool ValidarExiste(string aux)
 {
     if (MensajerosBLL.GetListaCedula(aux).Count() > 0)
     {
         MessageBox.Show("Este mensajero ya esta registrado." + "\n" + "\n" + "Verifique que todos los datos estan ingresados correcatamente..");
         return(false);
     }
     return(true);
 }
 private void Deletebutton_Click_1(object sender, EventArgs e)
 {
     if (validarId("Favor digitar el id del mensajero que desea eliminar") && ValidarBuscar())
     {
         MensajerosBLL.Eliminar(RU.StringToInt(mensajeroIdTextBox.Text));
         limpiarErrores();
         limpiar();
         MessageBox.Show("ELiminado con exito");
     }
 }
        private bool ValidarBuscar()
        {
            if (MensajerosBLL.Buscar(RU.StringToInt(mensajeroIdTextBox.Text)) == null)
            {
                MessageBox.Show("Este registro no existe");
                return(false);
            }

            return(true);
        }
Example #6
0
 private void BuscarSeleccion()
 {
     if (FiltrocomboBox.SelectedIndex == 0)
     {
         MensajerosdataGridView.DataSource = MensajerosBLL.GetListaId(RU.StringToInt(FiltrotextBox.Text));
     }
     if (FiltrocomboBox.SelectedIndex == 1)
     {
         MensajerosdataGridView.DataSource = MensajerosBLL.GetListaApellido(FiltrotextBox.Text);
     }
 }
 private void SaveButton_Click_1(object sender, EventArgs e)
 {
     BuscarerrorProvider.Clear();
     LlenarClase(mensajero);
     if (ValidarTextbox() && ValidarExiste(cedulaMaskedTextBox.Text))
     {
         MensajerosBLL.Insertar(mensajero);
         limpiar();
         limpiarErrores();
         MessageBox.Show("Guardado con exito");
     }
 }
 private void UpdateButton_Click_1(object sender, EventArgs e)
 {
     if (validarId("Favor Buscar el mensajero que desea actualizar") && ValidarTextbox())
     {
         LlenarClase(mensajero);
         if (ValidarExiste(cedulaMaskedTextBox.Text))
         {
             MensajerosBLL.Actualizar(RU.StringToInt(mensajeroIdTextBox.Text), mensajero);
             limpiar();
             limpiarErrores();
             MessageBox.Show("Actualizado con exito");
         }
     }
 }
Example #9
0
        private void Imprimebutton_Click(object sender, EventArgs e)
        {
            ReportingViewerMensajeros viewer = new ReportingViewerMensajeros();

            viewer.RptViewer.Reset();
            viewer.RptViewer.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Local;

            viewer.RptViewer.LocalReport.ReportPath = @"C:\Users\Henry O\Source\Repos\AlmacenTech2\AlmacenTech\AlmacenTech\Reportes\ListadoMensajeros.rdlc";

            viewer.RptViewer.LocalReport.DataSources.Clear();


            viewer.RptViewer.LocalReport.DataSources.Add(
                new ReportDataSource("DataSetMensajeros",
                                     MensajerosBLL.GetLista()));

            viewer.RptViewer.LocalReport.Refresh();

            viewer.Show();
        }
Example #10
0
        private bool validar()
        {
            if (string.IsNullOrEmpty(FiltrotextBox.Text))
            {
                BuscarerrorProvider.SetError(FiltrotextBox, "Ingresar el campo que desea filtar");
                return(false);
            }

            if (FiltrocomboBox.SelectedIndex == 0 && MensajerosBLL.GetListaId(RU.StringToInt(FiltrotextBox.Text)).Count == 0)
            {
                MessageBox.Show("No hay registros que coincidan con este campo de filtro..." + "\n" + "\n" + "Intente con otro campo");
                return(false);
            }

            if (FiltrocomboBox.SelectedIndex == 1 && MensajerosBLL.GetListaApellido(FiltrotextBox.Text).Count == 0)
            {
                MessageBox.Show("No hay registros que coincidan con este campo de filtro..." + "\n" + "\n" + "Intente con otro campo");
                return(false);
            }
            BuscarerrorProvider.Clear();

            return(true);
        }