private void btModify_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(txbCode.Text) || string.IsNullOrEmpty(txbDesc.Text) || string.IsNullOrEmpty(txtbPrice.Text) || string.IsNullOrEmpty(txbQuantity.Text))
     {
         MessageBox.Show("Verificar que no exista un espacio en blanco");
         return;
     }
     try
     {
         if (txbDesc.Text != "" && txtbPrice.Text != "" && txbQuantity.Text != "")
         {
             metodos.ActualizarProducto(txbCode.Text, txbDesc.Text, txtbPrice.Text, txbQuantity.Text);
             this.Visible = false;
             MantenimientoProductos mantP = new MantenimientoProductos();
             mantP.Show();
         }
         else
         {
             label1.Text = "Debe De Llenar Todas las Casillas";
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Valores Invalidos");
     }
 }
        private void btBack_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            MantenimientoProductos mantP = new MantenimientoProductos();

            mantP.Show();
        }
        private void ModificarProducto_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Visible = false;
            MantenimientoProductos mantP = new MantenimientoProductos();

            mantP.Show();
        }
예제 #4
0
        private void btInsert_Click(object sender, EventArgs e)
        {
            try
            {
                if (String.IsNullOrEmpty(txbCode.Text))
                {
                    MessageBox.Show("Verificar que no exista un espacio en blanco");
                    return;
                }

                if (txbCode.Text != "")
                {
                    if (metodos.ProductoExistencteFisicoSinError(txbCode.Text))
                    {
                        //metodos.comprobarExistenciaProducto(txbCode.Text);
                        metodos.EliminarProducto(txbCode.Text);
                        this.Visible = false;
                        MantenimientoProductos mantP = new MantenimientoProductos();
                        mantP.Show();
                    }
                    else
                    {
                        MessageBox.Show("El Producto no Existe");
                    }
                }
                else
                {
                    lbError.Text = "Debe de Completar Todos los Espacios";
                }
            }
            catch (FormatException)
            {
                MessageBox.Show("Valores Invalidos");
            }
            catch (Exception ex)
            {
                MessageBox.Show("El Producto no Existe");
            }
        }
 private void btInsert_Click(object sender, EventArgs e)
 {
     if (String.IsNullOrEmpty(txbCode.Text) || String.IsNullOrEmpty(txbDesc.Text) || String.IsNullOrEmpty(txbPrice.Text) ||
         String.IsNullOrEmpty(txbQuantity.Text))
     {
         MessageBox.Show("Verificar que no exista un espacio en blanco");
         return;
     }
     try
     {
         if (txbCode.Text != "" & txbDesc.Text != "" & txbPrice.Text != "" & txbQuantity.Text != "")
         {
             if (metodos.ProductoExistencteFisicoSinError(txbCode.Text))
             {
                 metodos.InsertarProducto(txbCode.Text, txbDesc.Text, txbPrice.Text, txbQuantity.Text);
                 this.Visible = false;
                 MantenimientoProductos mantP = new MantenimientoProductos();
                 mantP.Show();
             }
             else
             {
                 metodos.ActualizarProducto(txbCode.Text, txbDesc.Text, txbPrice.Text, txbQuantity.Text);
                 this.Visible = false;
                 MantenimientoProductos mantP = new MantenimientoProductos();
                 mantP.Show();
             }
         }
         else
         {
             label1.Text = "Debe de Llenar Todos los Espacios";
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Valores Invalidos");
     }
 }