Beispiel #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Proveedor pProveedor = new Proveedor();

            pProveedor.RFC              = textRFC.Text.Trim();
            pProveedor.Nombre           = textNombre.Text.Trim();
            pProveedor.Apellido_Paterno = textApellidoPaterno.Text.Trim();
            pProveedor.Apellido_Materno = textApellidoMaterno.Text.Trim();
            pProveedor.Calle            = textCalle.Text.Trim();
            pProveedor.Colonia          = textColonia.Text.Trim();
            pProveedor.Municipio        = textMunicipio.Text.Trim();
            pProveedor.CodigoPostal     = textCodigoPostal.Text.Trim();
            pProveedor.NumerodeTelefono = textNumerodeTelefono.Text.Trim();

            int Comparacion = AgregarDatos.AgregarProveedor(pProveedor);

            if (Comparacion > 0)
            {
                MessageBox.Show("Cliente Guardado Con Exito!!", "Guardado", MessageBoxButtons.OK, MessageBoxIcon.Information);
                textRFC.Clear();
                textNombre.Clear();
                textApellidoPaterno.Clear();
                textApellidoMaterno.Clear();
                textCalle.Clear();
                textColonia.Clear();
                textMunicipio.Clear();
                textCodigoPostal.Clear();
                textNumerodeTelefono.Clear();
            }
            else
            {
                MessageBox.Show("No se pudo guardar el cliente", "Fallo!!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Producto pProducto = new Producto();

            pProducto.Clave = textClave.Text.Trim();

            if (Pasar == true)
            {
                pProducto.boxHombre   = false;
                pProducto.boxMujer    = true;
                pProducto.cbCategoria = cbCategoriaMujer.Text.Trim();
            }
            else
            {
                pProducto.boxHombre   = true;
                pProducto.boxMujer    = false;
                pProducto.cbCategoria = cbCategoriaHombre.Text.Trim();
            }
            pProducto.numericCantidad = numericCantidad.Value;
            pProducto.cbTalla         = cbTalla.Text.Trim();
            pProducto.cbMarca         = cbMarca.Text.Trim();
            pProducto.Color           = textColor.Text.Trim();
            pProducto.cbMaterial      = cbMaterial.Text.Trim();
            pProducto.Precio          = numericPrecio.Value;
            int comparacion = AgregarDatos.AgregarProducto(pProducto);

            if (comparacion > 0)
            {
                MessageBox.Show("Cliente Guardado Con Exito!!", "Guardado", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("No se pudo guardar el cliente", "Fallo!!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }