Esempio n. 1
0
 private void button2_Click(object sender, EventArgs e)
 {
     //if(boxCompras.Text.Equals("Producto Terminado")){
     if (compras == null)
     {
         compras                       = new compras();
         compras.Owner                 = this;
         compras.FormClosed           += ventas_FormClosed;
         compras.dateTimePicker1.Value = DateTime.Today;
         //compras.Show();
         AbrirFormInPanel(new compras());
     }
     else
     {
         compras.Activate();
     }
 }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            ventas       inf  = new ventas();
            compras      com  = new compras();
            Cotizaciones coti = new Cotizaciones();

            if (dataGridView1.SelectedRows.Count > 0)
            {
                if (cmdReporte.Text.Equals("Ventas"))
                {
                    inf.txtFolio.Text        = dataGridView1.CurrentRow.Cells["Id"].Value.ToString();
                    inf.dateTimePicker1.Text = dataGridView1.CurrentRow.Cells["date"].Value.ToString();
                    inf.txtIva.Text          = dataGridView1.CurrentRow.Cells["iva"].Value.ToString();
                    inf.txtNumCliente.Text   = dataGridView1.CurrentRow.Cells["num"].Value.ToString();
                    //inf.txtCajasContenido.Text = dataGridView1.CurrentRow.Cells["cajas"].Value.ToString();
                    inf.comboBox3.Text      = dataGridView1.CurrentRow.Cells["nombreP"].Value.ToString();
                    inf.comboMoneda.Text    = dataGridView1.CurrentRow.Cells["currency"].Value.ToString();
                    inf.txtCondiciones.Text = dataGridView1.CurrentRow.Cells["cond"].Value.ToString();
                    inf.txtLugarExpe.Text   = dataGridView1.CurrentRow.Cells["lugar"].Value.ToString();
                    inf.txtSubtotal.Text    = dataGridView1.CurrentRow.Cells["subtotal"].Value.ToString();
                    inf.txtTotal.Text       = dataGridView1.CurrentRow.Cells["total"].Value.ToString();
                    //inf.txtCajasContenido.Text = dataGridView1.CurrentRow.Cells[""].Value.ToString();

                    inf.dateTimePicker1.Enabled = false;
                    inf.txtIva.Enabled          = false;
                    //inf.txtCajasContenido.Enabled = false;
                    inf.comboBox3.Enabled      = false;
                    inf.txtLugarExpe.Enabled   = false;
                    inf.txtCondiciones.Enabled = false;
                    inf.comboMoneda.Enabled    = false;
                    inf.txtPallet.Enabled      = false;
                    inf.txtCantidad.Enabled    = false;
                    inf.cantidad.Text          = "0";

                    inf.button2.Visible        = false;
                    inf.btnArticulo.Visible    = false;
                    inf.btnMostrar.Visible     = true;
                    inf.button4.Visible        = false;
                    inf.btnAgregarProd.Visible = false;
                    inf.btnEliminar.Visible    = false;
                    inf.btnMostrar.Visible     = false;
                    //inf.txtFolio.Visible = false;
                    inf.dataGridView1.Visible = false;
                    inf.dataGridView2.Visible = true;
                    inf.textBox3.Enabled      = false;



                    inf.ShowDialog();
                }
                else if (cmdReporte.Text.Equals("Compras"))
                {
                    com.txtFolioCompra.Text  = dataGridView1.CurrentRow.Cells["Id"].Value.ToString();
                    com.dateTimePicker1.Text = dataGridView1.CurrentRow.Cells["fecha"].Value.ToString();
                    //com.txtTipo.Text = dataGridView1.CurrentRow.Cells["tipo"].Value.ToString();
                    //com.txtName.Text = dataGridView1.CurrentRow.Cells["product"].Value.ToString();
                    //com.txtPrecioUnitario.Text = dataGridView1.CurrentRow.Cells["price"].Value.ToString();
                    com.prov.Text     = dataGridView1.CurrentRow.Cells["provider"].Value.ToString();
                    com.txtNoPro.Text = dataGridView1.CurrentRow.Cells["numberP"].Value.ToString();
                    com.txtTot.Text   = dataGridView1.CurrentRow.Cells["total"].Value.ToString();
                    //com.txtCantidad.Text = dataGridView1.CurrentRow.Cells["amountPurchased"].Value.ToString();
                    //com.txtTotalCompra.Text = dataGridView1.CurrentRow.Cells["total"].Value.ToString();
                    //com.txtDescripcion.Text = dataGridView1.CurrentRow.Cells["description"].Value.ToString();

                    com.dateTimePicker1.Enabled   = false;
                    com.txtTipo.Enabled           = false;
                    com.dataGridView1.Visible     = false;
                    com.dataGridView2.Visible     = true;
                    com.button2.Visible           = false;
                    com.prov.Enabled              = false;
                    com.txtTot.Enabled            = false;
                    com.txtPrecioUnitario.Enabled = false;
                    com.txtName.Enabled           = false;
                    com.txtDescripcion.Enabled    = false;
                    com.btnGuardar.Visible        = false;
                    com.btrRegreso.Visible        = false;
                    com.button1.Visible           = false;
                    com.button3.Visible           = false;



                    com.ShowDialog();
                }
                else if (cmdReporte.Text.Equals("Cotizaciones"))
                {
                    coti.txtFolio.Text    = dataGridView1.CurrentRow.Cells["Id"].Value.ToString();
                    coti.Date.Text        = dataGridView1.CurrentRow.Cells["date"].Value.ToString();
                    coti.pallet.Text      = dataGridView1.CurrentRow.Cells["pallet"].Value.ToString();
                    coti.Expiration.Text  = dataGridView1.CurrentRow.Cells["expiration"].Value.ToString();
                    coti.IdClient.Text    = dataGridView1.CurrentRow.Cells["idCliente"].Value.ToString();
                    coti.ico.Text         = dataGridView1.CurrentRow.Cells["icoterm"].Value.ToString();
                    coti.Customer.Text    = dataGridView1.CurrentRow.Cells["customerName"].Value.ToString();
                    coti.txtTotal.Text    = dataGridView1.CurrentRow.Cells["total"].Value.ToString();
                    coti.txtSubtotal.Text = dataGridView1.CurrentRow.Cells["subtotal"].Value.ToString();
                    coti.divisa.Text      = dataGridView1.CurrentRow.Cells["currency"].Value.ToString();
                    coti.txtIva.Text      = dataGridView1.CurrentRow.Cells["IVA"].Value.ToString();
                    coti.place.Text       = dataGridView1.CurrentRow.Cells["place"].Value.ToString();
                    coti.Condicion.Text   = dataGridView1.CurrentRow.Cells["cond"].Value.ToString();
                    coti.textBox1.Text    = dataGridView1.CurrentRow.Cells["producto"].Value.ToString();
                    coti.flete.Text       = dataGridView1.CurrentRow.Cells["flete"].Value.ToString();

                    coti.txtCan.Text        = "0";
                    coti.Date.Enabled       = false;
                    coti.pallet.Enabled     = false;
                    coti.place.Enabled      = false;
                    coti.textBox1.Enabled   = false;
                    coti.Expiration.Enabled = false;
                    coti.ico.Enabled        = false;
                    coti.divisa.Enabled     = false;
                    coti.txtIva.Enabled     = false;
                    coti.Customer.Enabled   = false;
                    coti.Condicion.Enabled  = false;
                    coti.flete.Enabled      = false;
                    coti.txtPallet.Enabled  = false;
                    coti.txtMedida.Enabled  = false;


                    coti.btnArticulo.Visible    = false;
                    coti.btnAgregarProd.Visible = false;
                    coti.btnEliminar.Visible    = false;
                    coti.button2.Visible        = false;
                    coti.button3.Visible        = false;
                    coti.button1.Visible        = false;
                    coti.button5.Visible        = false;
                    coti.TablaDeVenta.Visible   = false;
                    coti.dataGridView1.Visible  = true;

                    coti.ShowDialog();
                }
            }
            else
            {
                MessageBox.Show("Seleccione una fila por favor");
            }
        }