private conveniopago CargarRelaciones(conveniopago unObjeto) { int ix; ix = ListaFormaPago.FindIndex(x => x.id == unObjeto.fkformaspago.id); if (ix > -1) { unObjeto.fkformaspago = ListaFormaPago[ix]; } return(unObjeto); }
public void Cargar(ref object unObjeto, string unModulo = null, object listaValores = null) { this.objetoLocal = unObjeto as conveniopago; this.importeTotal = ((IEnumerable <Valores>)listaValores).Where(x => x.Efectivo).Sum(x => x.Valor); if (objetoLocal != null) { if (this.objetoLocal.fkpagos != null) { if (this.objetoLocal.fkpagos.Count > 0) { this.txtRecibido.Text = this.objetoLocal.fkpagos[0].valor.ToString("N2"); } } } this.txtEfectivo.Text = this.importeTotal.ToString("N2"); }
public bool Verificar() { if (decimal.Parse(this.txtEfectivo.Text) + decimal.Parse(this.txtDevuelto.Text) == decimal.Parse(this.txtRecibido.Text)) { pago unPago = new pago() { anulado = false, detalle = "Pago total efectivo", fecha = LinqToDB.Sql.DateTime, //idformapago = objetoLocal.idformapago, idusuarioregistra = General.usuarioActivo.idusuario, idusuariocobranzas = General.usuarioActivo.idusuario, notificacion = false, numero = 1, valor = decimal.Parse(this.txtRecibido.Text) }; if (this.objetoLocal == null) { this.objetoLocal = new conveniopago(); } if (this.objetoLocal.fkpagos == null) { this.objetoLocal.fkpagos = new List <pago>(); } if (this.objetoLocal.fkpagos.Count == 0) { this.objetoLocal.fkpagos.Add(unPago); } else { this.objetoLocal.fkpagos[0] = unPago; } return(true); } else { return(false); } }