private bool Validar()
        {
            bool paso = true;

            if (string.IsNullOrEmpty(DescripcionTextBox.Text))
            {
                paso = false;
                MessageBox.Show("El campo descripcion no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information);
                DescripcionTextBox.Focus();
            }

            if (string.IsNullOrEmpty(PrecioTextBox.Text))
            {
                paso = false;
                MessageBox.Show("El campo precio no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information);
                PrecioTextBox.Focus();
            }
            if (string.IsNullOrEmpty(InventarioTextBox.Text))
            {
                paso = false;
                MessageBox.Show("El campo inventario no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information);
                InventarioTextBox.Focus();
            }

            return(paso);
        }
示例#2
0
 private void Limpiar()
 {
     ArtículoIdNumericUpDown.Value = 0;
     DescripcionTextBox.Clear();
     CostoTextBox.Clear();
     PrecioTextBox.Clear();
     PctGananciaTextBox.Clear();
     InventarioTextBox.Clear();
     MyErrorProvider.Clear();
 }
示例#3
0
 private void LimpiarObjetos()
 {
     ProductoIdNumericUpDown.Value = 0;
     FechaDateTimePicker.Value     = DateTime.Now;
     DescripcionTextBox.Clear();
     CostoTextBox.Clear();
     PrecioTextBox.Clear();
     PctGananciaTextBox.Clear();
     InventarioTextBox.Clear();
 }
示例#4
0
        private void LimpiarCampos()
        {
            ProductoIdNumericUpDown.Value = 0;
            DescripcionTextBox.Clear();
            CostoNumericUpDown.Value    = 0;
            PrecioNumericUpDown.Value   = 0;
            GananciaNumericUpDown.Value = 0;
            InventarioTextBox.Clear();
            InventarioTextBox.Text = 0.ToString();

            GeneralErrorProvider.Clear();
        }
        private void Limpiar()
        {
            ProductoIdTextBox.Text = "0";
            NombreProductoTextBox.Clear();
            MarcaProductoTextBox.Clear();
            InventarioTextBox.Clear();
            PrecioDeVentaTextBox.Text  = "0";
            PrecioDeCompraTextBox.Text = "0";
            FechaIngresoDateTimePicker.SelectedDate = DateTime.Now;
            SuplidorIdTextBox.Text  = "0";
            CategoriaIdTextBox.Text = "0";
            UsuarioIdTextBox.Text   = (MainWindow.usuarioSiempreActivoId.ToString());

            Productos producto = new Productos();

            Actualizar();
        }
        private bool Validar()
        {
            bool paso = true;

            if (string.IsNullOrEmpty(NombreProductoTextBox.Text))
            {
                paso = false;
                MessageBox.Show("El campo Nombre producto no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information);
                NombreProductoTextBox.Focus();
            }

            if (string.IsNullOrEmpty(MarcaProductoTextBox.Text))
            {
                paso = false;
                MessageBox.Show("El campo marca producto no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information);
                MarcaProductoTextBox.Focus();
            }

            if (string.IsNullOrEmpty(InventarioTextBox.Text))
            {
                paso = false;
                MessageBox.Show("El campo Inventario no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information);
                InventarioTextBox.Focus();
            }

            if (string.IsNullOrEmpty(PrecioDeCompraTextBox.Text))
            {
                paso = false;
                MessageBox.Show("El campo Precio de Compra no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information);
                InventarioTextBox.Focus();
            }

            if (string.IsNullOrEmpty(PrecioDeVentaTextBox.Text))
            {
                paso = false;
                MessageBox.Show("El campo Precio de Venta no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information);
                InventarioTextBox.Focus();
            }

            if (string.IsNullOrEmpty(FechaIngresoDateTimePicker.Text))
            {
                MessageBox.Show("Debe ingresar la fecha de ingreso", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information);
                FechaIngresoDateTimePicker.Focus();
            }
            if (string.IsNullOrEmpty(SuplidorIdTextBox.Text.Replace("-", "")))
            {
                paso = false;
                MessageBox.Show("El campo Suplidpr Id no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information);
                SuplidorIdTextBox.Focus();
            }

            if (string.IsNullOrEmpty(CategoriaIdTextBox.Text))
            {
                paso = false;
                MessageBox.Show("El campo Categoria Id no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information);
                CategoriaIdTextBox.Focus();
            }

            if (string.IsNullOrEmpty(UsuarioIdTextBox.Text))
            {
                paso = false;
                MessageBox.Show("El campo Usuario Id no puede estar vacio", "Informacion", MessageBoxButton.OK, MessageBoxImage.Information);
                UsuarioIdTextBox.Focus();
            }

            return(paso);
        }