public bool Validacion()
        {
            string xmsg = "";
            decimal ntotmarcados = VariablesPublicas.StringtoDecimal(lbltotregistros.Text);
            string xcodigo = "...";
            decimal vmnpagosoles = 0;
            decimal vmnpagodolares = 0;
            int ncontador = 0;
            decimal vmncambio = VariablesPublicas.StringtoDecimal(txtTipCamb.Text);
            if (ntotmarcados == 0)
            {
                xmsg = "Seleccione al menos 1 documento a cancelar";
            }
            else
            {
                vmnpagosoles = VariablesPublicas.StringtoDecimal(lbltotalpagosoles.Text);
                vmnpagodolares = VariablesPublicas.StringtoDecimal(lbltotalpagodolares.Text);
                if (vmnpagosoles == 0 & vmnpagodolares == 0)
                {
                    xmsg = "Digite montos a cancelar";
                }
                else
                {
                    if (txtCodsubdiario.Text.Trim().Length > 0)
                    {
                        xcodigo = txtCodsubdiario.Text;
                    }
                    try
                    {
                        DataTable cursortipvoucher = new DataTable();
                        tb_co_tipodiarioBL BL = new tb_co_tipodiarioBL();
                        tb_co_tipodiario BE = new tb_co_tipodiario();

                        BE.perianio = VariablesPublicas.perianio;
                        BE.diarioid = xcodigo;

                        cursortipvoucher = BL.GetAll(VariablesPublicas.EmpresaID.ToString(), BE).Tables[0];
                    }
                    catch (Exception ex)
                    {
                        XtraMessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    if (tmptabla.Rows.Count == 0)
                    {
                        xmsg = "Ingrese Sub-Diario ";
                    }
                    if (txtcuentaid.Text.Trim().Length == 0)
                    {
                        xmsg = "Sub-Diario no relacinado con cuenta contable";
                    }
                }
            }
            if (vmncambio == 0)
            {
                xmsg = "Ingrese tipo de cambio";
                txtTipCamb.Focus();
            }
            DataTable cursorformaspagos = new DataTable();
            try
            {
                tb_co_tabla01_mediopagoBL BL = new tb_co_tabla01_mediopagoBL();
                tb_co_tabla01_mediopago BE = new tb_co_tabla01_mediopago();

                BE.codigoid = cboFpago.SelectedValue.ToString();
                cursorformaspagos = BL.GetAll(VariablesPublicas.EmpresaID.ToString(), BE).Tables[0];
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            if (cursorformaspagos.Rows.Count == 0)
            {
                xmsg = "Seleccione Medio de Pago";
                cboFpago.Focus();
            }
            if (txtNumpago.Text.Trim().Length == 0)
            {
                xmsg = "Ingrese Nº de Cheque/Operación";
                txtNumpago.Focus();
            }
            DataTable cursorfefectivo = new DataTable();
            string xFefectivo = "..";
            if (cboFefectivo.Text.ToString().Trim().Length > 0)
            {
                xFefectivo = cboFefectivo.SelectedValue.ToString();
            }
            try
            {
                tb_co_FlujoefectivoBL BL = new tb_co_FlujoefectivoBL();
                tb_co_Flujoefectivo BE = new tb_co_Flujoefectivo();

                BE.fefectivoid = xFefectivo;
                cursorfefectivo = BL.GetAll(VariablesPublicas.EmpresaID.ToString(), BE).Tables[0];
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            if (cursorfefectivo.Rows.Count == 0)
            {
                xmsg = "Seleccione Flujo de Efectivo";
                cboFefectivo.Focus();
            }
            // Validan Detalles seleccinados
            if (xmsg.Length == 0)
            {
                for (ncontador = 0; ncontador <= DocumentosPendientes.Rows.Count - 1; ncontador++)
                {
                    if (Convert.ToBoolean(DocumentosPendientes.Rows[ncontador]["selecciona"]) == true)
                    {
                        if (Convert.ToDecimal(DocumentosPendientes.Rows[ncontador]["pagosoles"]) == 0 & Convert.ToDecimal(DocumentosPendientes.Rows[ncontador]["pagodolares"]) == 0)
                        {
                            xmsg = "Ingrese monto a cancelar";
                            if (DocumentosPendientes.Rows[ncontador]["monedap"].ToString() == "1")
                            {
                                examinar.CurrentCell = examinar.Rows[ncontador].Cells["pagosoles"];
                            }
                            else
                            {
                                examinar.CurrentCell = examinar.Rows[ncontador].Cells["pagodolares"];
                            }
                            examinar.CurrentCell.ReadOnly = true;
                            examinar.BeginEdit(true);
                            examinar.CurrentCell.ReadOnly = false;
                            break;
                        }
                    }
                }
            }
            if (xmsg.Length == 0)
            {
                if (!PuedeEditarEliminar(" Grabar Asiento Tesoreria ", VariablesPublicas.PADL(fEmision.Value.Month.ToString(), 2, "0")))
                {
                    xmsg = "...";
                }
            }
            if (xmsg.Length > 0 & !(xmsg == "..."))
            {
                XtraMessageBox.Show(xmsg, "Validación", MessageBoxButtons.OK, MessageBoxIcon.Question);
            }
            return xmsg.Length == 0;
        }
        private BindingSource NewMethodFlujoe()
        {
            tb_co_FlujoefectivoBL BL = new tb_co_FlujoefectivoBL();
            tb_co_Flujoefectivo BE = new tb_co_Flujoefectivo();

            DataTable table = BL.GetAll(VariablesPublicas.EmpresaID.ToString(), BE).Tables[0];
            DataRowCollection rows = table.Rows;

            object[] cell;
            Dictionary<string, string> dic = new Dictionary<string, string>();
            BindingSource binding = new BindingSource();

            foreach (DataRow item in rows)
            {
                cell = item.ItemArray;
                dic.Add(cell[0].ToString(), cell[0].ToString() + " - " + cell[2].ToString());
                cell = null;
            }
            binding.DataSource = dic;
            return binding;
        }