public void ConsultaDePrestamos(string numero_Cedula_Socio, string numero_Socio) { JavaScriptSerializer json = new JavaScriptSerializer(); string datoJson = string.Empty; List <Prestamos> lista = new List <Prestamos>(); try { //Valida Si existe Socio var persona = PersonaActor.DamePorIdentificacionSinVerificarExistencia(numero_Cedula_Socio); var cliente = ClienteActor.DameListaPorNumeroCliente(FBSSettingsEmpresa.LeeConfiguracion().Secuencial, int.Parse(numero_Socio), true, 0).FirstOrDefault(); if (cliente != null) { var listaPrestamos = PrestamoMaestroActor.DameListaPorSecuencialCliente(cliente.Secuencial).Where(x => x.CodigoEstadoPrestamo != FBSSettingsEstadoPrestamo.LeeConfiguracion().Cancelado); foreach (var item in listaPrestamos) { lista.Add(new Prestamos(item.TipoPrestamo.Nombre, item.DeudaInicial, item.FechaProximoVencimiento.Day, item.ValorCuota, item.SaldoActual)); } } var datosJson = new { success = true, nombre_Socio = persona.NombreUnido, lista_De_Prestamos = lista }; HttpContext.Current.Response.ContentType = "application/json"; HttpContext.Current.Response.Write(json.Serialize(datosJson)); HttpContext.Current.Response.Flush(); // Sends all currently buffered output to the client. HttpContext.Current.Response.SuppressContent = true; // Gets or sets a value indicating whether to send HTTP content to the client. HttpContext.Current.ApplicationInstance.CompleteRequest(); } catch (Exception ex) { var datosJson = new { success = false, msg = ex }; HttpContext.Current.Response.ContentType = "application/json"; HttpContext.Current.Response.Write(json.Serialize(datosJson)); HttpContext.Current.Response.Flush(); // Sends all currently buffered output to the client. HttpContext.Current.Response.SuppressContent = true; // Gets or sets a value indicating whether to send HTTP content to the client. HttpContext.Current.ApplicationInstance.CompleteRequest(); } }
public void ConfirmaIdentidadDelSocio(string numero_Cedula_Socio, DateTime fecha_Ultima_Transaccion, string agencia_Ultima_Transaccion) { JavaScriptSerializer json = new JavaScriptSerializer(); string datoJson = string.Empty; string error = string.Empty; Oficina oficina = null; Cliente cliente = null; try { //Valida Si existe Socio var persona = PersonaActor.DameListaPorIdentificacion(numero_Cedula_Socio, true, 0).Where(x => x.TipoIdentificacion.NumeroMinimoRepresentantes == 0).FirstOrDefault(); if (persona != null) { //Busca Cliente cliente = ClienteActor.DamePorSecuencialPersonaSinVerificarExistencia(persona.Secuencial); if (cliente != null) { //Valida Oficina var listaOficina = OficinaActor.DameListaPorEstaActiva(true, true, Oficina.CodigoOficinaControlCampo, 0); oficina = listaOficina.Where(x => x.Ciudad.ToLower().Contains(agencia_Ultima_Transaccion.ToLower()) || x.Division.Nombre.ToLower().Contains(agencia_Ultima_Transaccion.ToLower()) || x.Siglas.ToLower().Contains(agencia_Ultima_Transaccion.ToLower()) || agencia_Ultima_Transaccion.ToLower().Contains(x.Siglas.ToLower())).FirstOrDefault(); if (oficina == null) { error = "No Hay Concidencias Para La Agencia Buscada"; } //Valida Ultima Transaccion int ultimoMovimiento = PrestamoMaestroActor.DevuelveUltimoMovimiento(cliente.Secuencial); if (ultimoMovimiento > 0) { MovimientoDetalle movimiento = MovimientoDetalleActor.DameListaPorSecuencialMovimiento(ultimoMovimiento, 0).FirstOrDefault(); if (movimiento != null) { if (movimiento.Movimiento.Fecha != fecha_Ultima_Transaccion) { error = "La Fecha De La Última Transacción No Coincide"; } if (oficina != null) { if (oficina.SecuencialDivision != movimiento.SecuencialOficinaAfectada) { error = "La Oficina De La Última Transacción No Coincide"; } } } } else { error = "No Existen Movimientos Registrados"; } } else { error = "La persona Con Esa Identificación No Es Cliente"; } } else { error = "Identificación No Encontrada"; } if (error != string.Empty) { var datosJson = new { success = false, msg = error }; HttpContext.Current.Response.ContentType = "application/json"; HttpContext.Current.Response.Write(json.Serialize(datosJson)); HttpContext.Current.Response.Flush(); // Sends all currently buffered output to the client. HttpContext.Current.Response.SuppressContent = true; // Gets or sets a value indicating whether to send HTTP content to the client. HttpContext.Current.ApplicationInstance.CompleteRequest(); } else { var datosJson = new { success = true, numero_Socio = cliente.NumeroCliente }; HttpContext.Current.Response.ContentType = "application/json"; HttpContext.Current.Response.Write(json.Serialize(datosJson)); HttpContext.Current.Response.Flush(); // Sends all currently buffered output to the client. HttpContext.Current.Response.SuppressContent = true; // Gets or sets a value indicating whether to send HTTP content to the client. HttpContext.Current.ApplicationInstance.CompleteRequest(); } } catch (Exception ex) { var datosJson = new { success = false, msg = ex }; HttpContext.Current.Response.ContentType = "application/json"; HttpContext.Current.Response.Write(json.Serialize(datosJson)); HttpContext.Current.Response.Flush(); // Sends all currently buffered output to the client. HttpContext.Current.Response.SuppressContent = true; // Gets or sets a value indicating whether to send HTTP content to the client. HttpContext.Current.ApplicationInstance.CompleteRequest(); } }