public Hipotecario CotizaHipotecarioPRYBE(string Avaluo, string Credito, string CodigoPostal,string Plazo, string AnoCredito, string FechaInicio, string TasaAnual) { Hipotecario cotizacion = new Hipotecario(); Vivienda vivienda = new Vivienda(); Vida vida = new Vida(); double primerPago, pagoSubsecuente; try { vivienda = CotizaViviendaPRYBE(Avaluo, CodigoPostal); vida = CotizaVidaCPM(Credito, Plazo, AnoCredito, FechaInicio, TasaAnual); if (vivienda.ErrorBool != true) { primerPago = (Convert.ToDouble(vivienda.PrimerPago)) + (Convert.ToDouble(vida.PagoMensual)); pagoSubsecuente = (Convert.ToDouble(vivienda.PagoSubsecuente)) + (Convert.ToDouble(vida.PagoMensual)); cotizacion.PrimerPago = Convert.ToString(Math.Round(primerPago, 2)); cotizacion.PagoSubsecuente = Convert.ToString(Math.Round(pagoSubsecuente, 2)); cotizacion.Saldos = vida.saldos; cotizacion.CoberturasVida = vida.coberturas; cotizacion.CoberturasVivienda = vivienda.coberturas; cotizacion.vivienda = vivienda; cotizacion.vida = vida; } else { cotizacion.ErrorBool = true; cotizacion.ErrorDesc = "No fue posible realizar la cotización debido a que el Código Postal capturado no tiene zonas de riesgo registradas"; } } catch(Exception ex) { cotizacion.ErrorBool = true; cotizacion.ErrorDesc = ex.Message; } return cotizacion; }
public List <Hipotecario> GetAllOperaciones(Hipotecario h, int busqueda) { return(busqueda == 0 ? new HipotecarioDAC().GetAllOperacionesSinSeleccionar(h) : new HipotecarioDAC().GetAllOperacionesSeleccionadas(h)); }
public void GetOperaciones(int semaforo, int semaforoOperacion) { var h = new Hipotecario(); var o = new Operacion(); var to = new TipoOperacion(); var cli = new Cliente(); var sucu = new SucursalCliente(); var eje = new Usuario(); var vend = new Persona(); var ciu = new Ciudad(); var reg = new Region(); o.Id_solicitud = txt_idSolicitud.Text == "" ? 0 : Convert.ToInt32(txt_idSolicitud.Text.Trim()); to.Codigo = dl_producto.SelectedValue; o.Tipo_operacion = to; cli.Id_cliente = dl_cliente.SelectedValue == "" ? Convert.ToInt16(0) : Convert.ToInt16(dl_cliente.SelectedValue); o.Cliente = cli; sucu.Id_sucursal = dl_sucursal.SelectedValue == "" ? Convert.ToInt16(0) : Convert.ToInt16(dl_sucursal.SelectedValue); o.Sucursal = sucu; o.Numero_cliente = txt_numCliente.Text.Trim(); o.Id_estado = dpl_estado.SelectedValue == "" ? 0 : Convert.ToInt32(dpl_estado.SelectedValue); eje.UserName = dl_ejecutivo.SelectedValue == "" ? "0" : dl_ejecutivo.SelectedValue; h.EjecutivoIngreso = eje; h.FechaDesde = string.Format("{0:yyyyMMdd}", Convert.ToDateTime(txt_desde.Text.Trim())); h.FechaHasta = string.Format("{0:yyyyMMdd}", Convert.ToDateTime(this.txt_hasta.Text.Trim())); vend.Rut = txtRutCliBanco.Text.Trim() == "" ? 0 : Convert.ToInt32(txtRutCliBanco.Text); h.Vendedor = vend; h.TipoPropiedad = dlTipoPropiedad.SelectedValue; h.IdComuna = 0; h.TipoCredito = dl_credito.SelectedValue; h.SemaforoBusqueda = semaforo; h.SemaforoOperacion = semaforoOperacion; h.CuentaUsuarioSession = Session["usrname"].ToString(); reg.Id_region = Convert.ToInt32(dl_region.SelectedValue ?? "0"); ciu.Id_Ciudad = Convert.ToInt32(dl_provincia.SelectedValue == ""?"0":dl_provincia.SelectedValue); h.Ciudad = ciu; h.Region = reg; h.Operacion = o; var busqueda = Convert.ToInt32(Hidden1.Value); var loperacion = new HipotecarioBC().GetAllOperaciones(h, busqueda); divBotones.Visible = loperacion.Count > 0; switch (busqueda) { case 0: SinSeleccionar.GetOperaciones(loperacion, Convert.ToBoolean(busqueda)); SinSeleccionar.EnableViewState = true; break; case 1: MisPendientes.GetOperaciones(loperacion, Convert.ToBoolean(busqueda)); MisPendientes.EnableViewState = true; break; } }