Exemple #1
0
        private void btnAddProductos_Click(object sender, EventArgs e)
        {
            DialogResult r = MessageBox.Show("¿Quiere agregar un producto final con los productos del inventario?", "Agregar producto final", MessageBoxButtons.YesNo);

            if (r == DialogResult.Yes)
            {
                if (producto == null)
                {
                    producto                       = new ProductoTerminado();
                    producto.Owner                 = this;
                    producto.FormClosed           += materia_FormClosed;
                    producto.SaveEdit.Visible      = false;
                    producto.fin.Visible           = false;
                    producto.dateTimePicker1.Value = DateTime.Today;
                    //producto.existencia.Visible = false;
                    producto.Show();
                }
                else
                {
                    producto.Activate();
                }
            }
            else
            {
                if (Existe == null)
                {
                    Existe                       = new ProductoExistente();
                    Existe.Owner                 = this;
                    Existe.FormClosed           += materia_FormClosed;
                    Existe.SaveEdit.Visible      = false;
                    Existe.dateTimePicker1.Value = DateTime.Today;
                    Existe.Show();
                }
            }
        }
Exemple #2
0
        //editar prod terminado
        private void btnEditProdTer_Click(object sender, EventArgs e)
        {
            ProductoTerminado prod = new ProductoTerminado();

            prod.btnGuardar.Visible        = false;
            prod.txtCantidadInsumo.Enabled = false;
            prod.txtCantiMatPrima.Enabled  = false;
            prod.comboBox1.Enabled         = false;
            prod.comboBox2.Enabled         = false;
            prod.existencia.Visible        = false;
            //prod.exis.Visible = false;
            prod.exisI.Visible       = false;
            prod.existenciaI.Visible = false;
            prod.fin.Visible         = false;

            prod.label16.Visible = false;
            prod.label17.Visible = false;

            if (dataGridView3.SelectedRows.Count > 0)
            {
                prod.txtMeasure.Text      = string.Empty;
                prod.txtUniMedAduana.Text = string.Empty;

                prod.txtMeasure.Text           = dataGridView3.CurrentRow.Cells["unitOfMeasure"].Value.ToString();
                prod.txtCodigo.Text            = dataGridView3.CurrentRow.Cells["Id"].Value.ToString();
                prod.dateTimePicker1.Value     = Convert.ToDateTime(dataGridView3.CurrentRow.Cells["date"].Value.ToString());
                prod.txtFaccion.Text           = dataGridView3.CurrentRow.Cells["fraccion"].Value.ToString();
                prod.txtSat.Text               = dataGridView3.CurrentRow.Cells["SAT"].Value.ToString();
                prod.txtCajasContenido.Text    = dataGridView3.CurrentRow.Cells["cantAduana"].Value.ToString();
                prod.comboBox2.Text            = dataGridView3.CurrentRow.Cells["input"].Value.ToString();
                prod.txtCantidadInsumo.Text    = dataGridView3.CurrentRow.Cells["quantityUsedI"].Value.ToString();
                prod.txtCantiAdquirida.Text    = dataGridView3.CurrentRow.Cells["amountPurchased"].Value.ToString();
                prod.txtNombreInsumo.Text      = dataGridView3.CurrentRow.Cells["name"].Value.ToString();
                prod.txtPrecioInsumo.Text      = dataGridView3.CurrentRow.Cells["unitPrice"].Value.ToString();
                prod.txtDescripcion.Text       = dataGridView3.CurrentRow.Cells["description"].Value.ToString();
                prod.comboBox1.Text            = dataGridView3.CurrentRow.Cells["rawMaterial"].Value.ToString();
                prod.txtCantiMatPrima.Text     = dataGridView3.CurrentRow.Cells["quantityUsedR"].Value.ToString();
                prod.txtEstado.Text            = dataGridView3.CurrentRow.Cells["status"].Value.ToString();
                prod.textBox2.Text             = dataGridView3.CurrentRow.Cells["measure"].Value.ToString();
                prod.textBox1.Text             = dataGridView3.CurrentRow.Cells["size"].Value.ToString();
                prod.txtIva.Text               = dataGridView3.CurrentRow.Cells["IVA"].Value.ToString();
                prod.txtUniMedAduana.Text      = dataGridView3.CurrentRow.Cells["medidaAduana"].Value.ToString();
                prod.txtCantiAdquirida.Enabled = false;

                byte[]       img = (byte[])dataGridView3.CurrentRow.Cells["photo"].Value;
                MemoryStream ms  = new MemoryStream(img);

                prod.FotoProduc.Image = Image.FromStream(ms, true, true);
                prod.ID.Visible       = false;
                prod.ShowDialog();
                dataGridView3.Update();
                dataGridView3.Refresh();
            }
            else
            {
                MessageBox.Show("Seleccione una fila por favor");
            }
        }