Exemple #1
0
        private void MostrarValores()
        {
            ListaValores.BeginUpdate();
            ListaValores.Items.Clear();
            Lbl.Comprobantes.Recibo Rec = this.Elemento as Lbl.Comprobantes.Recibo;

            if (this.DePago)
            {
                foreach (Lbl.Comprobantes.Pago Pg in Rec.Pagos)
                {
                    ListViewItem itm = ListaValores.Items.Add(Pg.GetHashCode().ToString());
                    switch (Pg.FormaDePago.Tipo)
                    {
                    case Lbl.Pagos.TiposFormasDePago.Efectivo:
                        itm.SubItems.Add(new ListViewItem.ListViewSubItem(itm, Pg.FormaDePago.ToString()));
                        itm.SubItems.Add(new ListViewItem.ListViewSubItem(itm, Lfx.Types.Formatting.FormatCurrency(Pg.Importe, Lfx.Workspace.Master.CurrentConfig.Moneda.Decimales)));
                        break;

                    case Lbl.Pagos.TiposFormasDePago.Caja:
                        itm.SubItems.Add(new ListViewItem.ListViewSubItem(itm, Pg.FormaDePago.ToString()));
                        itm.SubItems.Add(new ListViewItem.ListViewSubItem(itm, Lfx.Types.Formatting.FormatCurrency(Pg.Importe, Lfx.Workspace.Master.CurrentConfig.Moneda.Decimales)));
                        itm.SubItems.Add(new ListViewItem.ListViewSubItem(itm, "Débito desde " + Pg.CajaOrigen.ToString()));
                        break;

                    default:
                        itm.SubItems.Add(Pg.FormaDePago.ToString());
                        itm.SubItems.Add(Lfx.Types.Formatting.FormatCurrency(Pg.Importe, Lfx.Workspace.Master.CurrentConfig.Moneda.Decimales));
                        itm.SubItems.Add(Pg.ToString());
                        break;
                    }
                }
                EtiquetaValoresImporte.Text = Lfx.Types.Formatting.FormatCurrency(Rec.Pagos.ImporteTotal, Lfx.Workspace.Master.CurrentConfig.Moneda.Decimales);
            }
            else
            {
                foreach (Lbl.Comprobantes.Cobro Cb in Rec.Cobros)
                {
                    ListViewItem itm = ListaValores.Items.Add(Cb.GetHashCode().ToString());
                    switch (Cb.FormaDePago.Tipo)
                    {
                    case Lbl.Pagos.TiposFormasDePago.Efectivo:
                        itm.SubItems.Add(new ListViewItem.ListViewSubItem(itm, Cb.FormaDePago.ToString()));
                        itm.SubItems.Add(new ListViewItem.ListViewSubItem(itm, Lfx.Types.Formatting.FormatCurrency(Cb.Importe, Lfx.Workspace.Master.CurrentConfig.Moneda.Decimales)));
                        break;

                    case Lbl.Pagos.TiposFormasDePago.Tarjeta:
                        itm.SubItems.Add(new ListViewItem.ListViewSubItem(itm, Cb.FormaDePago.ToString()));
                        itm.SubItems.Add(new ListViewItem.ListViewSubItem(itm, Lfx.Types.Formatting.FormatCurrency(Cb.Importe, Lfx.Workspace.Master.CurrentConfig.Moneda.Decimales)));
                        itm.SubItems.Add(new ListViewItem.ListViewSubItem(itm, "Cupón Nº " + Cb.Cupon.Numero + " de " + Cb.Cupon.FormaDePago.ToString()));
                        break;

                    case Lbl.Pagos.TiposFormasDePago.Caja:
                        itm.SubItems.Add(new ListViewItem.ListViewSubItem(itm, Cb.FormaDePago.ToString()));
                        itm.SubItems.Add(new ListViewItem.ListViewSubItem(itm, Lfx.Types.Formatting.FormatCurrency(Cb.Importe, Lfx.Workspace.Master.CurrentConfig.Moneda.Decimales)));
                        itm.SubItems.Add(new ListViewItem.ListViewSubItem(itm, "Depósito en " + Cb.CajaDestino.ToString()));
                        break;

                    default:
                        itm.SubItems.Add(Cb.FormaDePago.ToString());
                        itm.SubItems.Add(Lfx.Types.Formatting.FormatCurrency(Cb.Importe, Lfx.Workspace.Master.CurrentConfig.Moneda.Decimales));
                        itm.SubItems.Add(Cb.ToString());
                        break;
                    }
                }
                EtiquetaValoresImporte.Text = Lfx.Types.Formatting.FormatCurrency(Rec.Cobros.ImporteTotal, Lfx.Workspace.Master.CurrentConfig.Moneda.Decimales);
            }

            LabelAgregarValores.Visible = ListaValores.Items.Count == 0 && this.Elemento.Existe == false;
            BotonQuitarValor.Visible    = ListaValores.Items.Count > 0;

            if (ListaValores.Items.Count > 0 && ListaValores.SelectedItems.Count == 0)
            {
                ListaValores.Items[ListaValores.Items.Count - 1].Selected = true;
                ListaValores.Items[ListaValores.Items.Count - 1].Focused  = true;
            }

            ListaValores.EndUpdate();
        }
 public override int GetHashCode()
 {
     return(Y.GetHashCode() ^ Cb.GetHashCode() ^ Cr.GetHashCode());
 }