예제 #1
0
 private void Eliminarbutton_Click(object sender, EventArgs e)
 {
     if (ValidarE())
     {
         MessageBox.Show("Favor Llenar Casilla!", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     else
     {
         int id = Convert.ToInt32(CotizacioIDnumericUpDown.Value);
         if (BLL.ContizacionBLL.Eliminar(id))
         {
             MessageBox.Show("Eliminado!!", "Exito", MessageBoxButtons.OK, MessageBoxIcon.Information);
             CotizacioIDnumericUpDown.Value = 0;
             Fecha2dateTimePicker.Value     = DateTime.Now;
             observacionesTextbox.Clear();
             TotaltextBox.Clear();
             CantidadnumericUpDown.Value = 0;
             ImporteTextbox.Clear();
             DetalleCotizacionesdataGridView.DataSource = null;
             ValidarerrorProvider.Clear();
         }
         else
         {
             MessageBox.Show("No se pudo eliminar!!", "Fallo", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }
예제 #2
0
 private void Nuevo2button_Click(object sender, EventArgs e)
 {
     CotizacioIDnumericUpDown.Value = 0;
     Fecha2dateTimePicker.Value     = DateTime.Now;
     observacionesTextbox.Clear();
     TotaltextBox.Clear();
     CantidadnumericUpDown.Value = 0;
     ImporteTextbox.Clear();
     DetalleCotizacionesdataGridView.DataSource = null;
     ValidarerrorProvider.Clear();
 }
예제 #3
0
        private void Guardar2button_Click(object sender, EventArgs e)
        {
            Cotizaciones cotizacionArticulos = LlenaClase();
            bool         Paso = false;

            if (Validar())
            {
                MessageBox.Show("Favor revisar todos los campos", "Validación",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (CotizacioIDnumericUpDown.Value == 0)
            {
                Paso = BLL.ContizacionBLL.Guardar(cotizacionArticulos);
                ValidarerrorProvider.Clear();
            }
            else
            {
                Paso = BLL.ContizacionBLL.Modificar(cotizacionArticulos);
                ValidarerrorProvider.Clear();
            }

            if (Paso)
            {
                MessageBox.Show("Guardado!!", "Exito",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);

                CotizacioIDnumericUpDown.Value = 0;
                Fecha2dateTimePicker.Value     = DateTime.Now;
                observacionesTextbox.Clear();
                TotaltextBox.Clear();
                CantidadnumericUpDown.Value = 0;
                ImporteTextbox.Clear();
                DetalleCotizacionesdataGridView.DataSource = null;
                ValidarerrorProvider.Clear();
            }
            else
            {
                MessageBox.Show("No se pudo guardar!!", "Fallo",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }