Example #1
0
 private void dgvCotizaciones_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (dgvOrdenes.Rows.Count >= 1 && e.RowIndex != -1)
     {
         frmOrdenCompra form = new frmOrdenCompra();
         form.MdiParent      = this.MdiParent;
         form.CodOrdenCompra = Ord.CodOrdenCompra;
         form.Proceso        = 3;
         form.Show();
     }
 }
Example #2
0
 private void btnIrCotizacion_Click(object sender, EventArgs e)
 {
     if (dgvOrdenes.Rows.Count >= 1 && dgvOrdenes.CurrentRow != null)
     {
         DataGridViewRow row  = dgvOrdenes.CurrentRow;
         frmOrdenCompra  form = new frmOrdenCompra();
         form.MdiParent      = this.MdiParent;
         form.CodOrdenCompra = Ord.CodOrdenCompra;
         form.Proceso        = 3;
         form.Show();
     }
 }
Example #3
0
        private void dgvProveedor_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                try
                {
                    if (dgvProveedor.Rows.Count > 0)
                    {
                        int f = dgvProveedor.CurrentRow.Index;
                        pro.CodProveedor = Convert.ToInt32(dgvProveedor.Rows[f].Cells[codigo.Name].Value);
                        pro.Ruc          = dgvProveedor.Rows[f].Cells[ruc.Name].Value.ToString();
                        pro.RazonSocial  = dgvProveedor.Rows[f].Cells[razonsocial.Name].Value.ToString();
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
                if (Proceso == 3)
                {
                    btnAceptar.Enabled = true;
                }
            }


            if (e.KeyCode == Keys.Return)
            {
                if (dgvProveedor.SelectedRows.Count > 0)
                {
                    if (Procede == 1)
                    {
                        frmNotaIngresoPorOrden form = (frmNotaIngresoPorOrden)Application.OpenForms["frmNotaIngresoPorOrden"];
                        form.CodProveedor       = pro.CodProveedor;
                        form.txtCodProv.Text    = pro.Ruc;
                        form.txtNombreProv.Text = pro.RazonSocial;
                        this.Close();
                    }
                    else if (Procede == 2)
                    {
                        frmGestionLetra form = (frmGestionLetra)Application.OpenForms["frmGestionLetra"];
                        form.CodProveedor = pro.CodProveedor;
                        this.Close();
                    }
                    else if (Procede == 3)
                    {
                        frmOrdenCompra form = (frmOrdenCompra)Application.OpenForms["frmOrdenCompra"];
                        form.CodProveedor       = pro.CodProveedor;
                        form.txtCodProv.Text    = pro.Ruc;
                        form.txtNombreProv.Text = pro.RazonSocial;
                        this.Close();
                    }
                    if (Procede == 4)
                    {
                        frmNotaIngreso form = (frmNotaIngreso)Application.OpenForms["frmNotaIngreso"];
                        form.CodProveedor       = pro.CodProveedor;
                        form.txtCodProv.Text    = pro.Ruc;
                        form.txtNombreProv.Text = pro.RazonSocial;
                        this.Close();
                    }
                }
            }
        }
Example #4
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            if (dgvProveedor.SelectedRows.Count > 0)
            {
                if (Procede == 1)
                {
                    frmNotaIngresoPorOrden form = (frmNotaIngresoPorOrden)Application.OpenForms["frmNotaIngresoPorOrden"];
                    form.CodProveedor         = pro.CodProveedor;
                    form.txtCodProv.Text      = pro.Ruc;
                    form.txtNombreProv.Text   = pro.RazonSocial;
                    form.txtCodProveedor.Text = pro.CodProveedor.ToString();
                    this.Close();
                }
                else if (Procede == 2)
                {
                    frmGestionLetra form = (frmGestionLetra)Application.OpenForms["frmGestionLetra"];
                    form.CodProveedor = pro.CodProveedor;
                    this.Close();
                }
                else if (Procede == 3)
                {
                    frmOrdenCompra form = (frmOrdenCompra)Application.OpenForms["frmOrdenCompra"];
                    form.CodProveedor       = pro.CodProveedor;
                    form.txtCodProv.Text    = pro.Ruc;
                    form.txtNombreProv.Text = pro.RazonSocial;
                    this.Close();
                }
                if (Procede == 4)
                {
                    frmNotaIngreso form = (frmNotaIngreso)Application.OpenForms["frmNotaIngreso"];
                    form.CodProveedor       = pro.CodProveedor;
                    form.txtCodProv.Text    = pro.Ruc;
                    form.txtNombreProv.Text = pro.RazonSocial;
                    this.Close();
                }
                if (Procede == 5)
                {
                    frmListaPreciosProductos form = (frmListaPreciosProductos)Application.OpenForms["frmListaPreciosProductos"];
                    if (pro.RazonSocial == null)
                    {
                        form.txtProveedorNomb.Focus();
                    }
                    else
                    {
                        form.txtProveedorCod.Text  = pro.CodProveedor.ToString();
                        form.txtProveedorNomb.Text = pro.RazonSocial;
                    }
                    this.Close();
                }

                //NOTA DE CREDITO POR COMPRA
                //MODIFICADO ALEX 23/02/2015
                else if (Procede == 6)
                {
                    frmNotadeCreditoCompra form = (frmNotadeCreditoCompra)Application.OpenForms["frmNotadeCreditoCompra"];
                    form.CodProveedor            = pro.CodProveedor;
                    form.txtCodProveedor.Text    = pro.Ruc;
                    form.txtNombreProveedor.Text = pro.RazonSocial;
                    this.Close();
                }
                //NOTA DE DEBITO POR COMPRA
                //MODIFICADO ALEX 04/03/2015
                else if (Procede == 7)
                {
                    frmNotadeDebitoCompra form = (frmNotadeDebitoCompra)Application.OpenForms["frmNotadeDebitoCompra"];
                    form.CodProveedor            = pro.CodProveedor;
                    form.txtCodProveedor.Text    = pro.Ruc;
                    form.txtNombreProveedor.Text = pro.RazonSocial;
                    this.Close();
                }
                else if (Procede == 8) //Salida por Devolucion
                {
                    frmNotaSalida form = (frmNotaSalida)Application.OpenForms["frmNotaSalida"];
                    form.CodProveedor          = pro.CodProveedor;
                    form.txtCodCliente.Text    = pro.Ruc;
                    form.txtNombreCliente.Text = pro.RazonSocial;
                    form.btnDetalle.Enabled    = true;
                    this.Close();
                }
                else if (Procede == 9) //Cambio de Proveedor
                {
                    frmCambioProveedor form = (frmCambioProveedor)Application.OpenForms["frmCambioProveedor"];
                    form.CodProv          = pro.CodProveedor;
                    form.txtCodProv2.Text = form.CodProv.ToString();
                    this.Close();
                }
            }
        }