コード例 #1
0
        private void form_cargar_datos2(String posicion, String tipdocalt, String numdocalt)
        {
            try
            {
                var BL = new tb_60movimientoscabBL();
                var BE = new tb_60movimientoscab();
                var dt = new DataTable();

                BE.moduloid = modulo;
                BE.local = local;
                BE.tipodoc = tipdocalt.ToString();

                if (serdoc.Text.Trim().Length > 0)
                {
                    BE.serdoc = serdoc.Text.Trim().PadLeft(4, '0');
                    BE.numdoc = numdocalt.ToString();
                }
                else
                {
                    if (posicion.Trim().Length > 0)
                    {
                        MessageBox.Show("Seleccionar el Tipo de Documento !!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    return;
                }
                if (numdocalt.ToString().Length > 0)
                {
                    BE.numdoc = numdocalt.ToString();
                }
                BE.posicion = posicion.Trim();

                dt = BL.GetAll_paginacion(EmpresaID, BE).Tables[0];

                if (dt.Rows.Count > 0)
                {
                    data_cbo_tiporeferencia(almacaccionid);
                    fechdoc.Text = dt.Rows[0]["fechdoc"].ToString().Trim();

                    tipimptoid = dt.Rows[0]["tipimptoid"].ToString().Trim();
                    direcnume = dt.Rows[0]["direcnume"].ToString().Trim();
                    incprec = dt.Rows[0]["incprec"].ToString().Trim();

                    moneda.SelectedValue = dt.Rows[0]["moneda"].ToString().Trim();
                    txtmoneda.Text = dt.Rows[0]["moneda"].ToString().Trim();
                    tcamb.Text = dt.Rows[0]["tcamb"].ToString().Trim();

                    if (dt.Rows[0]["tipimptoid"].ToString().Trim().Length > 0)
                    {
                        tipimptotasa.SelectedValue = dt.Rows[0]["tipimptoid"].ToString().Trim();
                    }
                    else
                    {
                        tipimptotasa.SelectedIndex = -1;
                    }

                    ctacte.Text = dt.Rows[0]["ctacte"].ToString().Trim();
                    nmruc.Text = dt.Rows[0]["nmruc"].ToString().Trim();
                    ctactename.Text = dt.Rows[0]["ctactename"].ToString().Trim();
                    direc.Text = dt.Rows[0]["direc"].ToString().Trim();

                    if (dt.Rows[0]["mottrasladointid"].ToString().Trim().Length > 0 && dt.Rows[0]["mottrasladointid"].ToString().Trim() != "00")
                    {
                        mottrasladointid.SelectedValue = dt.Rows[0]["mottrasladointid"].ToString().Trim();
                    }
                    else
                    {
                        mottrasladointid.SelectedIndex = -1;
                    }
                    direcname.Text = dt.Rows[0]["direcname"].ToString().Trim();
                    direcdeta.Text = dt.Rows[0]["direcdeta"].ToString().Trim();
                    if (dt.Rows[0]["tipoperacionid"].ToString().Trim().Length > 0)
                    {
                        tipoperacionid.SelectedValue = dt.Rows[0]["tipoperacionid"].ToString().Trim();
                    }
                    else
                    {
                        tipoperacionid.SelectedIndex = -1;
                    }

                    if (dt.Rows[0]["motivotrasladoid"].ToString().Trim().Length > 0 & dt.Rows[0]["motivotrasladoid"].ToString().Trim() != "00")
                    {
                        motivotrasladoid.SelectedValue = dt.Rows[0]["motivotrasladoid"].ToString().Trim();
                    }
                    else
                    {
                        motivotrasladoid.SelectedIndex = -1;
                    }

                    if (dt.Rows[0]["tipref"].ToString().Trim().Length > 0 && dt.Rows[0]["serref"].ToString().Trim().Length > 0)
                    {
                        tipref.SelectedValue = dt.Rows[0]["tipref"].ToString().Trim();
                        serref.Text = dt.Rows[0]["serref"].ToString().Trim();

                        var n = dt.Rows[0]["numref"].ToString().Trim();

                        numdococ1.Text = Equivalencias.Left(n, 4);
                        numdococ.Text = Equivalencias.Right(n, 6);

                        fechref.Format = DateTimePickerFormat.Short;
                        fechref.Text = dt.Rows[0]["fechref"].ToString().Trim();
                    }
                    else
                    {
                        tipref.SelectedIndex = -1;
                    }

                    if (dt.Rows[0]["serfac"].ToString().Trim().Length > 0 && dt.Rows[0]["numfac"].ToString().Trim().Length > 0)
                    {
                        tipfac.SelectedValue = dt.Rows[0]["tipfac"].ToString().Trim();
                        serfac.Text = dt.Rows[0]["serfac"].ToString().Trim();
                        numfac.Text = dt.Rows[0]["numfac"].ToString().Trim();
                        fechfac.Format = DateTimePickerFormat.Short;
                        fechfac.Text = dt.Rows[0]["fechfac"].ToString().Trim();
                    }
                    else
                    {
                        tipfac.SelectedIndex = 0;
                    }

                    if (dt.Rows[0]["serguia"].ToString().Trim().Length > 0 && dt.Rows[0]["numguia"].ToString().Trim().Length > 0)
                    {
                        serguia.Text = dt.Rows[0]["serguia"].ToString().Trim();
                        numguia.Text = dt.Rows[0]["numguia"].ToString().Trim();
                        fechguia.Format = DateTimePickerFormat.Short;
                        fechguia.Text = dt.Rows[0]["fechguia"].ToString().Trim();
                    }

                    if (dt.Rows[0]["sernotac"].ToString().Trim().Length > 0 && dt.Rows[0]["numnotac"].ToString().Trim().Length > 0)
                    {
                        sernotac.Text = dt.Rows[0]["sernotac"].ToString().Trim();
                        numnotac.Text = dt.Rows[0]["numnotac"].ToString().Trim();
                        fechnotac.Format = DateTimePickerFormat.Short;
                        fechnotac.Text = dt.Rows[0]["fechnotac"].ToString().Trim();
                    }

                    if (dt.Rows[0]["ser_op"].ToString().Trim().Length > 0 && dt.Rows[0]["num_op"].ToString().Trim().Length > 0)
                    {
                        ser_op.Text = dt.Rows[0]["ser_op"].ToString().Trim();
                        num_op.Text = dt.Rows[0]["num_op"].ToString().Trim();
                    }
                    ValidaCentroCosto(dt.Rows[0]["cencosid"].ToString(), true);
                    estacion.Text = dt.Rows[0]["estacion"].ToString();
                    ValidaPersona(dt.Rows[0]["perdni"].ToString(), true);

                    if (dt.Rows[0]["fechentrega"].ToString().Trim().Substring(0, 10) != "01/01/1900")
                    {
                        fechentrega.Format = DateTimePickerFormat.Short;
                        fechentrega.Text = dt.Rows[0]["fechentrega"].ToString().Trim();
                    }
                    if (dt.Rows[0]["fechpago"].ToString().Trim().Substring(0, 10) != "01/01/1900")
                    {
                        fechpago.Format = DateTimePickerFormat.Short;
                        fechpago.Text = dt.Rows[0]["fechpago"].ToString().Trim();
                    }
                    ValidaTransportista(dt.Rows[0]["transpid"].ToString(), false);
                    ddnni.Text = dt.Rows[0]["ddnni"].ToString().Trim();
                    itemsT.Text = dt.Rows[0]["items"].ToString().Trim();
                    totpzas.Text = dt.Rows[0]["totpzas"].ToString().Trim();
                    bruto.Text = dt.Rows[0]["bruto"].ToString().Trim();
                    totdscto1.Text = dt.Rows[0]["totdscto1"].ToString().Trim();
                    valventa.Text = dt.Rows[0]["valventa"].ToString().Trim();
                    totimpto.Text = dt.Rows[0]["totimpto"].ToString().Trim();
                    totimporte.Text = dt.Rows[0]["totimporte"].ToString().Trim();
                    glosa.Text = dt.Rows[0]["glosa"].ToString().Trim();

                    DetalleMovimiento(tipdocalt.ToString(), numdocalt.ToString());
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #2
0
        private void form_cargar_datos(String posicion)
        {
            try
            {
                limpiar_documento();
                var BL = new tb_cm_liquidacabBL();
                var BE = new tb_cm_liquidacab();
                var dt = new DataTable();

                BE.moduloid = moduloiddes.SelectedValue.ToString();
                BE.local = local.Trim();
                BE.tipdoc = tipdoc.Text.Trim();
                BE.serdoc = moduloiddes.SelectedValue.ToString();

                if (serdoc.Text.Trim().Length == 0)
                {
                    if (posicion.Trim().Length > 0)
                    {
                        MessageBox.Show("Seleccionar el Tipo de Documento !!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    return;
                }

                var n_doc = string.Empty;
                if (numdoc.Text.Trim().Length > 0)
                {
                    n_doc = numdoc.Text.Trim().PadLeft(6, '0');
                }

                BE.numdoc = serdoc.Text.ToString().Trim() + n_doc.ToString().Trim();
                BE.posicion = posicion.Trim();

                dt = BL.GetAll_paginacion(EmpresaID, BE).Tables[0];

                if (dt.Rows.Count > 0)
                {
                    activeDoc = false;
                    limpiar_documento();
                    form_bloqueado(false);
                    ssModo = "EDIT";

                    var BL2 = new tb_60movimientoscabBL();
                    var BE2 = new tb_60movimientoscab();
                    var dt2 = new DataTable();
                    var n = dt.Rows[0]["numdoc"].ToString().Trim();

                    serdoc.Text = Equivalencias.Left(n, 4);
                    numdoc.Text = Equivalencias.Right(n, 6);

                    tipguia.Text = dt.Rows[0]["tipref"].ToString().Trim();
                    serguia.Text = dt.Rows[0]["serref"].ToString().Trim();
                    numguia.Text = dt.Rows[0]["numref"].ToString().Trim();

                    cif.Text = dt.Rows[0]["cif"].ToString().Trim();
                    dua.Text = dt.Rows[0]["dua"].ToString().Trim();
                    gas_impo.Text = dt.Rows[0]["gas_impo"].ToString().Trim();
                    gas_financ.Text = dt.Rows[0]["gas_financ"].ToString().Trim();
                    tot_bimp.Text = dt.Rows[0]["tot_bimp"].ToString().Trim();
                    factorincre.Text = dt.Rows[0]["factorincre"].ToString().Trim();

                    moduloiddes.SelectedValue = dt.Rows[0]["moduloid"].ToString().Trim();
                    data_cbo_localdes(dominioiddes, moduloiddes.SelectedValue.ToString());
                    localdes.SelectedValue = dt.Rows[0]["local"].ToString().Trim();

                    BE2.moduloid = moduloiddes.SelectedValue.ToString();
                    BE2.local = localdes.SelectedValue.ToString();
                    BE2.tipodoc = tipguia.Text.ToString();
                    BE2.serdoc = serguia.Text.ToString();
                    BE2.numdoc = numguia.Text;

                    dt2 = BL2.GetAll2(EmpresaID, BE2).Tables[0];

                    if (dt2.Rows.Count > 0)
                    {
                        tipfac.Text = dt2.Rows[0]["tipfac"].ToString();
                        serfac.Text = dt2.Rows[0]["serfac"].ToString();
                        numfac.Text = dt2.Rows[0]["numfac"].ToString();

                        tipref.Text = dt2.Rows[0]["tipref"].ToString();
                        numdococ1.Text = Equivalencias.Left(dt2.Rows[0]["numref"].ToString(), 4);
                        numdococ.Text = Equivalencias.Right(dt2.Rows[0]["numref"].ToString(), 6);
                        ctacte.Text = dt2.Rows[0]["ctacte"].ToString();
                        ctactename.Text = dt2.Rows[0]["ctactename"].ToString();
                    }

                    _CargarDetalleImportacion();

                    if (dt.Rows[0]["status"].ToString().Trim() != "9")
                    {
                        btn_nuevo.Enabled = true;
                        btn_editar.Enabled = true;
                        btn_eliminar.Enabled = true;
                        btn_imprimir.Enabled = true;
                        btn_primero.Enabled = true;
                        btn_anterior.Enabled = true;
                        btn_siguiente.Enabled = true;
                        btn_ultimo.Enabled = true;
                        btn_salir.Enabled = true;
                        pictureEdit1.Visible = false;
                    }
                    else
                    {
                        ssModo = "ANULADO";
                        if (TablaDetalleImportacion2.Rows.Count > 0)
                        {
                            TablaDetalleImportacion2.Clear();
                        }
                        dgb_importacion2.DataSource = TablaDetalleImportacion2;
                        pictureEdit1.Visible = true;
                        btn_editar.Enabled = false;
                        btn_eliminar.Enabled = false;
                        btn_nuevo.Enabled = true;
                        btn_imprimir.Enabled = true;

                        btn_primero.Enabled = true;
                        btn_anterior.Enabled = true;
                        btn_siguiente.Enabled = true;
                        btn_ultimo.Enabled = true;
                        btn_salir.Enabled = true;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #3
0
        private void form_cargar_datos(String posicion)
        {
            try
            {
                limpiar_documento();
                var BL = new tb_60movimientoscabBL();
                var BE = new tb_60movimientoscab();
                var dt = new DataTable();

                BE.moduloid = modulo;
                BE.local = local;
                BE.tipodoc = tipodoc.SelectedValue.ToString().Trim();

                if (serdoc.Text.Trim().Length > 0)
                {
                    BE.serdoc = serdoc.Text.Trim().PadLeft(4, '0');
                    BE.numdoc = numdoc.Text.Trim().PadLeft(10, '0');
                }
                else
                {
                    if (posicion.Trim().Length > 0)
                    {
                        MessageBox.Show("Seleccionar el Tipo de Documento !!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    return;
                }
                if (numdoc.Text.Trim().Length > 0)
                {
                    BE.numdoc = numdoc.Text.Trim().PadLeft(10, '0');
                }
                BE.posicion = posicion.Trim();

                dt = BL.GetAll_paginacion(EmpresaID, BE).Tables[0];

                if (dt.Rows.Count > 0)
                {
                    ssModo = "EDIT";
                    data_cbo_tiporeferencia(almacaccionid);
                    serdoc.Text = dt.Rows[0]["serdoc"].ToString().Trim();
                    numdoc.Text = dt.Rows[0]["numdoc"].ToString().Trim();
                    fechdoc.Text = dt.Rows[0]["fechdoc"].ToString().Trim();

                    tipimptoid = dt.Rows[0]["tipimptoid"].ToString().Trim();
                    direcnume = dt.Rows[0]["direcnume"].ToString().Trim();
                    incprec = dt.Rows[0]["incprec"].ToString().Trim();

                    moneda.SelectedValue = dt.Rows[0]["moneda"].ToString().Trim();
                    tcamb.Text = dt.Rows[0]["tcamb"].ToString().Trim();

                    if (dt.Rows[0]["moneda"].ToString().Trim() == "S")
                    {
                        txtmoneda.Text = "S/.";
                    }
                    else
                    {
                        txtmoneda.Text = "US$";
                    }

                    if (dt.Rows[0]["tipimptoid"].ToString().Trim().Length > 0)
                    {
                        tipimptotasa.SelectedValue = dt.Rows[0]["tipimptoid"].ToString().Trim();
                    }
                    else
                    {
                        tipimptotasa.SelectedIndex = -1;
                    }

                    ctacte.Text = dt.Rows[0]["ctacte"].ToString().Trim();
                    nmruc.Text = dt.Rows[0]["nmruc"].ToString().Trim();
                    ctactename.Text = dt.Rows[0]["ctactename"].ToString().Trim();
                    direc.Text = dt.Rows[0]["direc"].ToString().Trim();
                    if (dt.Rows[0]["mottrasladointid"].ToString().Trim().Length > 0 && dt.Rows[0]["mottrasladointid"].ToString().Trim() != "00")
                    {
                        mottrasladointid.SelectedValue = dt.Rows[0]["mottrasladointid"].ToString().Trim();
                    }
                    else
                    {
                        mottrasladointid.SelectedIndex = -1;
                    }

                    direcname.Text = dt.Rows[0]["direcname"].ToString().Trim();
                    direcdeta.Text = dt.Rows[0]["direcdeta"].ToString().Trim();
                    if (dt.Rows[0]["tipoperacionid"].ToString().Trim().Length > 0)
                    {
                        tipoperacionid.SelectedValue = dt.Rows[0]["tipoperacionid"].ToString().Trim();
                    }
                    else
                    {
                        tipoperacionid.SelectedIndex = -1;
                    }

                    if (dt.Rows[0]["motivotrasladoid"].ToString().Trim().Length > 0 & dt.Rows[0]["motivotrasladoid"].ToString().Trim() != "00")
                    {
                        motivotrasladoid.SelectedValue = dt.Rows[0]["motivotrasladoid"].ToString().Trim();
                    }
                    else
                    {
                        motivotrasladoid.SelectedIndex = -1;
                    }

                    if (dt.Rows[0]["tipref"].ToString().Trim().Length > 0 && dt.Rows[0]["serref"].ToString().Trim().Length > 0)
                    {
                        tipref.SelectedValue = dt.Rows[0]["tipref"].ToString().Trim();
                        serref.Text = dt.Rows[0]["serref"].ToString().Trim();

                        var n = dt.Rows[0]["numref"].ToString().Trim();

                        numdococ1.Text = Equivalencias.Left(n, 4);
                        numdococ.Text = Equivalencias.Right(n, 6);

                        fechref.Format = DateTimePickerFormat.Short;
                        fechref.Text = dt.Rows[0]["fechref"].ToString().Trim();
                    }
                    else
                    {
                        tipref.SelectedIndex = -1;
                    }

                    if (dt.Rows[0]["serfac"].ToString().Trim().Length > 0 && dt.Rows[0]["numfac"].ToString().Trim().Length > 0)
                    {
                        tipfac.SelectedValue = dt.Rows[0]["tipfac"].ToString().Trim();
                        serfac.Text = dt.Rows[0]["serfac"].ToString().Trim();
                        numfac.Text = dt.Rows[0]["numfac"].ToString().Trim();
                        fechfac.Format = DateTimePickerFormat.Short;
                        fechfac.Text = dt.Rows[0]["fechfac"].ToString().Trim();
                    }
                    else
                    {
                        tipfac.SelectedIndex = 0;
                    }

                    if (dt.Rows[0]["serguia"].ToString().Trim().Length > 0 && dt.Rows[0]["numguia"].ToString().Trim().Length > 0)
                    {
                        serguia.Text = dt.Rows[0]["serguia"].ToString().Trim();
                        numguia.Text = dt.Rows[0]["numguia"].ToString().Trim();
                        fechguia.Format = DateTimePickerFormat.Short;
                        fechguia.Text = dt.Rows[0]["fechguia"].ToString().Trim();
                    }

                    if (dt.Rows[0]["sernotac"].ToString().Trim().Length > 0 && dt.Rows[0]["numnotac"].ToString().Trim().Length > 0)
                    {
                        sernotac.Text = dt.Rows[0]["sernotac"].ToString().Trim();
                        numnotac.Text = dt.Rows[0]["numnotac"].ToString().Trim();
                        fechnotac.Format = DateTimePickerFormat.Short;
                        fechnotac.Text = dt.Rows[0]["fechnotac"].ToString().Trim();
                    }

                    if (dt.Rows[0]["ser_op"].ToString().Trim().Length > 0 && dt.Rows[0]["num_op"].ToString().Trim().Length > 0)
                    {
                        ser_op.Text = dt.Rows[0]["ser_op"].ToString().Trim();
                        num_op.Text = dt.Rows[0]["num_op"].ToString().Trim();
                    }
                    ValidaCentroCosto(dt.Rows[0]["cencosid"].ToString(), true);

                    ValidaPersona(dt.Rows[0]["perdni"].ToString(), true);

                    if (dt.Rows[0]["fechentrega"].ToString().Trim().Substring(0, 10) != "01/01/1900")
                    {
                        fechentrega.Format = DateTimePickerFormat.Short;
                        fechentrega.Text = dt.Rows[0]["fechentrega"].ToString().Trim();
                    }
                    if (dt.Rows[0]["fechpago"].ToString().Trim().Substring(0, 10) != "01/01/1900")
                    {
                        fechpago.Format = DateTimePickerFormat.Short;
                        fechpago.Text = dt.Rows[0]["fechpago"].ToString().Trim();
                    }
                    ValidaTransportista(dt.Rows[0]["transpid"].ToString(), false);
                    ddnni.Text = dt.Rows[0]["ddnni"].ToString().Trim();
                    itemsT.Text = dt.Rows[0]["items"].ToString().Trim();
                    totpzas.Text = dt.Rows[0]["totpzas"].ToString().Trim();
                    bruto.Text = dt.Rows[0]["bruto"].ToString().Trim();
                    totdscto1.Text = dt.Rows[0]["totdscto1"].ToString().Trim();
                    valventa.Text = dt.Rows[0]["valventa"].ToString().Trim();
                    totimpto.Text = dt.Rows[0]["totimpto"].ToString().Trim();
                    totimporte.Text = dt.Rows[0]["totimporte"].ToString().Trim();
                    glosa.Text = dt.Rows[0]["glosa"].ToString().Trim();

                    data_Tabladetallemovmov();
                    if (dt.Rows[0]["status"].ToString().Trim() != "9")
                    {
                        btn_editar.Enabled = true;
                        btn_eliminar.Enabled = true;
                        btn_imprimir.Enabled = true;
                        btn_noval.Enabled = true;
                        btn_imprimir_resum.Enabled = true;

                        btn_primero.Enabled = true;
                        btn_anterior.Enabled = true;
                        btn_siguiente.Enabled = true;
                        btn_ultimo.Enabled = true;

                        btn_buscar.Enabled = true;
                        btn_salir.Enabled = true;
                        griddetallemov.Focus();
                        griddetallemov.Rows[0].Selected = false;
                        pdtimagen.Visible = false;
                    }
                    else
                    {
                        ssModo = "ANULADO";
                        txt_status.Text = "ANULADO";
                        pdtimagen.Visible = true;
                        btn_editar.Enabled = false;
                        btn_eliminar.Enabled = false;
                        btn_imprimir.Enabled = true;
                        btn_noval.Enabled = true;
                        btn_imprimir_resum.Enabled = true;

                        btn_primero.Enabled = true;
                        btn_anterior.Enabled = true;
                        btn_siguiente.Enabled = true;
                        btn_ultimo.Enabled = true;

                        btn_buscar.Enabled = true;
                        btn_salir.Enabled = true;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #4
0
        protected internal void numguia_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                var num = string.Empty;
                num = numguia.Text.ToString().PadLeft(10, '0');
                numguia.Text = num;

                var BL = new tb_60movimientoscabBL();
                var BE = new tb_60movimientoscab();
                var dt = new DataTable();

                BE.moduloid = moduloiddes.SelectedValue.ToString();
                BE.local = localdes.SelectedValue.ToString();
                BE.tipodoc = tipguia.Text.ToString();
                BE.serdoc = serguia.Text.ToString();
                BE.numdoc = numguia.Text;

                dt = BL.GetAll2(EmpresaID, BE).Tables[0];

                if (dt.Rows.Count > 0)
                {
                    if (dt.Rows[0]["moneda"].ToString() == "S")
                    {
                        MessageBox.Show("Documento de referencia no puede ser en Moneda Nacional, verifique ...", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }

                    var xfechdoc = Convert.ToDateTime(dt.Rows[0]["fechdoc"]);

                    if (Convert.ToString(xfechdoc.Year) != serdoc.Text.ToString().Trim())
                    {
                        MessageBox.Show("Documento de Referencia NO ES DEL PERIODO ACTUAL, verifique ...", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }

                    tipfac.Text = dt.Rows[0]["tipfac"].ToString();
                    serfac.Text = dt.Rows[0]["serfac"].ToString();
                    numfac.Text = dt.Rows[0]["numfac"].ToString();

                    tipref.Text = dt.Rows[0]["tipref"].ToString();
                    numdococ1.Text = Equivalencias.Left(dt.Rows[0]["numref"].ToString(), 4);
                    numdococ.Text = Equivalencias.Right(dt.Rows[0]["numref"].ToString(), 6);

                    ctacte.Text = dt.Rows[0]["ctacte"].ToString();
                    ctactename.Text = dt.Rows[0]["ctactename"].ToString();
                    _validaPais();
                }
                else
                {
                    MessageBox.Show("NO SE UBICÓ documento de referencia ó se encuentra ANULADO, verifique ...", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }

                _CargarDetalle();

                if (dt.Rows.Count > 0)
                {
                    for (var i = 0; i < dgb_importacion1.RowCount ; i++)
                    {
                        var codi = dgb_importacion1.GetRowCellValue(i, "conceptoid").ToString();

                        if (codi.Trim() == "101")
                        {
                            dgb_importacion1.SetRowCellValue(i, "ctacte", dt.Rows[0]["ctacte"].ToString());
                            dgb_importacion1.SetRowCellValue(i, "proveedor", dt.Rows[0]["ctactename"].ToString());
                            dgb_importacion1.SetRowCellValue(i, "tipbou", dt.Rows[0]["tipfac"].ToString());
                            dgb_importacion1.SetRowCellValue(i, "serbou", dt.Rows[0]["serfac"].ToString());
                            dgb_importacion1.SetRowCellValue(i, "numbou", dt.Rows[0]["numfac"].ToString());
                            dgb_importacion1.SetRowCellValue(i, "fechbou", dt.Rows[0]["fechfac"].ToString());
                            dgb_importacion1.SetRowCellValue(i, "tipcamb", dt.Rows[0]["tcamb"].ToString());
                            dgb_importacion1.SetRowCellValue(i, "migv", dt.Rows[0]["igv"].ToString());
                            dgb_importacion1.SetRowCellValue(i, "bimp_sunat2", dt.Rows[0]["valventa"].ToString());
                            Decimal ximp_me = 0;
                            Decimal ximp_mn = 0;
                            Decimal xtcamb = 0;
                            ximp_me = Convert.ToDecimal(dt.Rows[0]["valventa"].ToString());
                            xtcamb = Convert.ToDecimal(dt.Rows[0]["tcamb"].ToString());
                            xvalventa = (ximp_me * xtcamb) + ximp_mn;
                            dgb_importacion1.SetRowCellValue(i, "pven", xvalventa);
                        }
                    }
                }
                else
                {
                    limpiar_documento();
                }
                dgb_importacion1.Focus();
            }
        }
コード例 #5
0
        private void CargarDocde_Traslado()
        {
            var BL = new tb_60movimientoscabBL();
            var BE = new tb_60movimientoscab();

            BE.moduloid = modulo.ToString();
            BE.local = local.ToString();
            BE.tipodoc = "GS";

            Tabladetalleguias = BL.GetAll3(EmpresaID, BE).Tables[0];

            if (Tabladetalleguias.Rows.Count > 0)
            {
                dgb_aceptacionguias.DataSource = Tabladetalleguias;
            }
            else
            {
                dgb_aceptacionguias.DataSource = Tabladetalleguias;
            }
        }