Exemplo n.º 1
0
        private void btnSalida_Click(object sender, EventArgs e)
        {
            //FrmSalida frm = new FrmSalida();
            //frm.MdiParent = this;
            //OpenSubForm(frm);

            Form childForm = null;
            foreach (Form f in this.MdiChildren)
            {
                if (f is FrmSalida)
                {
                    childForm = (FrmSalida)f;
                    break;
                }
                else
                {
                    f.WindowState = FormWindowState.Minimized;
                    f.Show();
                }

            }

            if (childForm != null)
            {
                childForm.Focus();
                childForm.BringToFront();
                childForm.WindowState = FormWindowState.Normal;
            }
            else
            {
                childForm = new FrmSalida();
                childForm.MdiParent = this;
                OpenSubForm(childForm);
            }
        }
        private void btnSiguiente_Click(object sender, EventArgs e)
        {
            Aceptar();

            FrmSalida frm = new FrmSalida();

                if (dgvSalida.RowCount -1 > count)
                {

                     count = count + 1;

                    txtitem.Text = dgvSalida.Rows[Convert.ToInt16(count)].Cells["nu_item"].Value.ToString();
                    txtcodbarr.Text = dgvSalida.Rows[Convert.ToInt16(count)].Cells["CodBar"].Value.ToString();
                    txtTf.Text = dgvSalida.Rows[Convert.ToInt16(count)].Cells["nu_tf"].Value.ToString();
                    txtnuop.Text = dgvSalida.Rows[Convert.ToInt16(count)].Cells["nu_op"].Value.ToString();
                    cb_mercado.SelectedValue = dgvSalida.Rows[Convert.ToInt16(count)].Cells["id_mercado"].Value.ToString();
                    cbtipo.SelectedValue = dgvSalida.Rows[Convert.ToInt16(count)].Cells["id_tipo"].Value.ToString();
                    cb_tipoTela.Text = dgvSalida.Rows[Convert.ToInt16(count)].Cells["tipo_tela"].Value.ToString();
                    txtidproducto.Text = dgvSalida.Rows[Convert.ToInt16(count)].Cells["id_producto"].Value.ToString();
                    lblProducto.Text = dgvSalida.Rows[Convert.ToInt16(count)].Cells["ds_producto"].Value.ToString();
                    txtidcolor.Text = dgvSalida.Rows[Convert.ToInt16(count)].Cells["id_color"].Value.ToString();
                    lblcolor.Text = dgvSalida.Rows[Convert.ToInt16(count)].Cells["ds_color"].Value.ToString();
                    txtnurollo.Text = dgvSalida.Rows[Convert.ToInt16(count)].Cells["_nu_rollo"].Value.ToString();
                    if (EstadoDet == 1)
                    {
                        txtpeso_actual.Text = dgvSalida.Rows[Convert.ToInt16(count)].Cells["peso_actual"].Value.ToString();
                    }
                    else
                    {
                        txtpeso_actual.Text = Convert.ToString( Convert.ToDecimal(dgvSalida.Rows[Convert.ToInt16(count)].Cells["peso_actual"].Value) + Convert.ToDecimal(dgvSalida.Rows[Convert.ToInt16(count)].Cells["qt_peso"].Value));

                    }
                    txtpesodesp.Text = dgvSalida.Rows[Convert.ToInt16(count)].Cells["qt_peso"].Value.ToString();
                    txtprecio.Text = dgvSalida.Rows[Convert.ToInt16(count)].Cells["mt_precio"].Value.ToString();
                    txtmt_igv.Text = dgvSalida.Rows[Convert.ToInt16(count)].Cells["mt_igv"].Value.ToString();
                    txtidcliente.Text = dgvSalida.Rows[Convert.ToInt16(count)].Cells["id_cliente"].Value.ToString();
                    //frm._drow = count.ToString();
                    //MessageBox.Show(frm._drow.ToString());

                }
                else
                {

                     count = 0;
                       //MessageBox.Show(count.ToString());
                       txtitem.Text = dgvSalida.Rows[Convert.ToInt16(count)].Cells["nu_item"].Value.ToString();
                       txtcodbarr.Text = dgvSalida.Rows[Convert.ToInt16(count)].Cells["CodBar"].Value.ToString();
                       txtTf.Text = dgvSalida.Rows[Convert.ToInt16(count)].Cells["nu_tf"].Value.ToString();
                       txtnuop.Text = dgvSalida.Rows[Convert.ToInt16(count)].Cells["nu_op"].Value.ToString();
                       cb_mercado.SelectedValue = dgvSalida.Rows[Convert.ToInt16(count)].Cells["id_mercado"].Value.ToString();
                       cbtipo.SelectedValue = dgvSalida.Rows[Convert.ToInt16(count)].Cells["id_tipo"].Value.ToString();
                       cb_tipoTela.Text = dgvSalida.Rows[Convert.ToInt16(count)].Cells["tipo_tela"].Value.ToString();
                       txtidproducto.Text = dgvSalida.Rows[Convert.ToInt16(count)].Cells["id_producto"].Value.ToString();
                       lblProducto.Text = dgvSalida.Rows[Convert.ToInt16(count)].Cells["ds_producto"].Value.ToString();
                       txtidcolor.Text = dgvSalida.Rows[Convert.ToInt16(count)].Cells["id_color"].Value.ToString();
                       lblcolor.Text = dgvSalida.Rows[Convert.ToInt16(count)].Cells["ds_color"].Value.ToString();
                       txtnurollo.Text = dgvSalida.Rows[Convert.ToInt16(count)].Cells["_nu_rollo"].Value.ToString();
                       txtpesodesp.Text = dgvSalida.Rows[Convert.ToInt16(count)].Cells["qt_peso"].Value.ToString();
                       txtprecio.Text = dgvSalida.Rows[Convert.ToInt16(count)].Cells["mt_precio"].Value.ToString();
                       txtmt_igv.Text = dgvSalida.Rows[Convert.ToInt16(count)].Cells["mt_igv"].Value.ToString();
                       txtidcliente.Text = dgvSalida.Rows[Convert.ToInt16(count)].Cells["id_cliente"].Value.ToString();
                       //frm._drow = count.ToString();
                       //MessageBox.Show(frm._drow.ToString());
                }
        }