예제 #1
0
 private void cb_afecta_caja_CheckedChanged(object sender, EventArgs e)
 {
     if (cb_afecta_caja.Checked)
     {
         if (ObjCajaDiaria == null)
         {
             cb_afecta_caja.Checked = false;
             tt_general.Show("Debe abrir una caja para registrar la operacion", pn_abm, cb_afecta_caja.Location.X, cb_afecta_caja.Location.Y - 30, 3000);
         }
         else
         {
             bs_formas.ResetBindings(false);
             bs_formas.DataSource = admforma.VerLista();
             bs_formas.Remove(admforma.BuscarPorID(2));
             List <int> columnas = new List <int>();
             columnas.Add(0); columnas.Add(2); columnas.Add(3); columnas.Add(4); columnas.Add(5);
             Frm_Eleccion frm = new Frm_Eleccion("Forma de pago", "la forma de pago", bs_formas, columnas, "");
             frm.ShowDialog();
             if (frm.ObjRespuesta == null)
             {
                 forma = admforma.BuscarPorID(1);
             }
             else
             {
                 forma = (Cforma_pago)frm.ObjRespuesta;
             }
             lbl_formaPago.Text = forma.Descripcion;
         }
     }
     lbl_formaPago.Visible = cb_afecta_caja.Checked;
 }
예제 #2
0
 protected override void btn_Agregar_Click(object sender, EventArgs e)
 {
     Abrir();
     dtp_fecha.Value   = DateTime.Today;
     oCompra           = new Ccompra(0, 0, 0, DateTime.Today, (Cforma_pago)cb_formaPago.SelectedItem);
     cb_formaPago.Text = admformaspagos.BuscarPorID(1).Descripcion;
     ActualizarItems();
 }
예제 #3
0
        private void cbb_FormaPago1_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (cbb_FormaPago1.Items.Count > 1)
                {
                    Cforma_pago forma = (Cforma_pago)cbb_FormaPago1.SelectedItem;
                    if (!FormasPagosIguales())
                    {
                        if (forma.ID == 2)
                        {
                            gb_cuentacorriente.Visible = true;

                            if (cbb_CuentasClientes1.Items.Count == 0)
                            {
                                ActualizarCuentas();
                            }

                            if (cbb_CuentasClientes1.Items.Count == 0)
                            {
                                cbb_CuentasClientes1.Enabled = false;
                            }
                            else
                            {
                                cbb_CuentasClientes1.Enabled = true;
                            }
                        }
                        else
                        {
                            gb_cuentacorriente.Visible = false;
                        }
                        pn_codigo1.Visible = forma.Autorizacion;
                        CalcularDescuentos();
                    }
                    else
                    {
                        if (forma.ID == 2)
                        {
                            cbb_FormaPago1.Text = admformaspagos.BuscarPorID(1).Descripcion;
                        }
                        else
                        {
                            cbb_FormaPago1.Text = admformaspagos.BuscarPorID(2).Descripcion;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Frm_confirmacion frm = new Frm_confirmacion(ex.Message, "Bueno, esto es embarazoso. Pero lo solucionaremos :)", "Aceptar");
                frm.ShowDialog();
            }
        }
예제 #4
0
        private void Frm_Operacion_Load(object sender, EventArgs e)
        {
            Ctrl_formas_pagos admformas = Ctrl_formas_pagos.ClaseActiva();

            bs_FormasPagos.ResetBindings(true);
            bs_FormasPagos.DataSource    = admformas.VerLista();
            cb_FormasPagos.DataSource    = bs_FormasPagos;
            cb_FormasPagos.DisplayMember = "Descripcion";
            cb_FormasPagos.Text          = admformas.BuscarPorID(1).Descripcion;
            ActualizarConceptos();

            if (Gasto)
            {
                cb_registrar.Text = "Generar debito en cuenta";
                Ctrl_proveedores admprove = Ctrl_proveedores.ClaseActiva();
                if (admprove.VerLista().Count == 0)
                {
                    cb_registrar.Visible = false;
                }
                if (Ooperacion == null)
                {
                    this.Text = "Agregar gasto";
                }
                else
                {
                    this.Text        = "Modificar gasto";
                    cb_concepto.Text = ((Cgasto)Ooperacion).Concepto;
                    txt_importe.Text = Ooperacion.Importe.ToString();
                    if (Opersona != null)
                    {
                        cb_registrar.Visible = false;
                        lbl_persona.Text     = Opersona.Nombre;
                    }
                }
            }
            else
            {
                cb_registrar.Text = "Generar recibo en cuenta";
                Ctrl_clientes admclien = Ctrl_clientes.ClaseActiva();
                if (admclien.VerClientesConCuentas().Count == 0)
                {
                    cb_registrar.Visible = false;
                }
                if (Ooperacion == null)
                {
                    this.Text = "Agregar Cobro";
                }
                else
                {
                    this.Text        = "Modificar Cobro";
                    cb_concepto.Text = ((Ccobro)Ooperacion).Concepto;
                    txt_importe.Text = Ooperacion.Importe.ToString();
                    if (Opersona != null)
                    {
                        cb_registrar.Visible = false;
                        lbl_persona.Text     = Opersona.Nombre;
                    }
                }
            }
        }