Exemple #1
0
        private Lfx.Types.OperationResult Pagar()
        {
            int           IdCajaOrigen = 0;
            int           IdChequera   = 0;
            List <string> Cheques      = new List <string>();

            foreach (System.Windows.Forms.ListViewItem itm in Listado.Items)
            {
                if (itm.Checked && (itm.SubItems["bancos_cheques.estado"].Text == "A pagar"))
                {
                    Cheques.Add(itm.Text);
                    if (IdCajaOrigen == 0)
                    {
                        IdChequera   = this.Connection.FieldInt("SELECT id_chequera FROM bancos_cheques WHERE id_cheque=" + itm.Text);
                        IdCajaOrigen = this.Connection.FieldInt("SELECT id_caja FROM chequeras WHERE (SELECT numero FROM bancos_cheques WHERE id_cheque=" + itm.Text + ") BETWEEN desde AND hasta AND estado=1 AND id_chequera=" + IdChequera);
                    }
                }
            }

            if (Cheques.Count > 0)
            {
                Bancos.Cheques.Pagar FormPagar = new Bancos.Cheques.Pagar();
                FormPagar.EntradaCajaOrigen.ValueInt = IdCajaOrigen;
                if (FormPagar.Mostrar(Cheques) == DialogResult.OK)
                {
                    foreach (System.Windows.Forms.ListViewItem itm in Listado.Items)
                    {
                        if (itm.Checked)
                        {
                            itm.Checked = false;
                        }
                    }
                    this.RefreshList();
                    return(new Lfx.Types.SuccessOperationResult());
                }
                else
                {
                    return(new Lfx.Types.CancelOperationResult());
                }
            }
            else
            {
                return(new Lfx.Types.FailureOperationResult("Por favor marque uno o más cheques a pagar."));
            }
        }
Exemple #2
0
                private Lfx.Types.OperationResult Pagar()
                {
                        int IdCajaOrigen = 0;
                        List<string> Cheques = new List<string>();
                        foreach (System.Windows.Forms.ListViewItem itm in Listado.Items) {
                                if (itm.Checked && (itm.SubItems["bancos_cheques.estado"].Text == "A pagar")) {
                                        Cheques.Add(itm.Text);
                                        if (IdCajaOrigen == 0)
                                                IdCajaOrigen = this.Connection.FieldInt("SELECT id_caja FROM chequeras WHERE (SELECT numero FROM bancos_cheques WHERE id_cheque=" + itm.Text + ") BETWEEN desde AND hasta AND estado=1");
                                }
                        }

                        if (Cheques.Count > 0) {
                                Bancos.Cheques.Pagar FormPagar = new Bancos.Cheques.Pagar();
                                FormPagar.EntradaCajaOrigen.ValueInt = IdCajaOrigen;
                                if (FormPagar.Mostrar(Cheques) == DialogResult.OK) {
                                        foreach (System.Windows.Forms.ListViewItem itm in Listado.Items) {
                                                if (itm.Checked)
                                                        itm.Checked = false;
                                        }
                                        this.RefreshList();
                                        return new Lfx.Types.SuccessOperationResult();
                                } else {
                                        return new Lfx.Types.OperationResult(false);
                                }
                        } else {
                                return new Lfx.Types.FailureOperationResult("Por favor marque uno o más cheques a pagar.");
                        }
                }