Ejemplo n.º 1
0
        protected void btnAddFormaPago_Click(object sender, EventArgs e)
        {
            try
            {
                FormaPago oFormaPago = null;

                if (!string.IsNullOrEmpty(this.lblFormaPagoId.Text))
                {
                    oFormaPago = new Auxiliar().GetFormaPago(int.Parse(this.lblFormaPagoId.Text));
                    oFormaPago.Descripcion = this.txtDesc.Text;

                    new Auxiliar().UpdateFormaPago(oFormaPago);
                }
                else
                {
                    oFormaPago = new FormaPago();

                    oFormaPago.Descripcion = this.txtDesc.Text;

                    new Auxiliar().AddFormaPago(oFormaPago);
                }

                this.FillGridFormaPago();
            }
            catch (Exception ex)
            {
                this.lblErrorFormaPago.Text = ex.Message;
            }
        }
Ejemplo n.º 2
0
        private void FixupFormaPago(FormaPago previousValue)
        {
            if (previousValue != null && previousValue.PersonasCuentas.Contains(this))
            {
                previousValue.PersonasCuentas.Remove(this);
            }

            if (FormaPago != null)
            {
                if (!FormaPago.PersonasCuentas.Contains(this))
                {
                    FormaPago.PersonasCuentas.Add(this);
                }
                if (FormaPagoId != FormaPago.FormaPagoId)
                {
                    FormaPagoId = FormaPago.FormaPagoId;
                }
            }
            else if (!_settingFK)
            {
                FormaPagoId = null;
            }
        }
Ejemplo n.º 3
0
        private void FixupFormaPago(FormaPago previousValue)
        {
            if (previousValue != null && previousValue.Recibos.Contains(this))
            {
                previousValue.Recibos.Remove(this);
            }

            if (FormaPago != null)
            {
                if (!FormaPago.Recibos.Contains(this))
                {
                    FormaPago.Recibos.Add(this);
                }
                if (FormaPagoId != FormaPago.FormaPagoId)
                {
                    FormaPagoId = FormaPago.FormaPagoId;
                }
            }
        }