public ActionResult CargaComboProducto(MontoCredito montoCredito) { try { PlazoCredito plazo = new PlazoCredito(); if (ModelState.IsValid) { montoCredito.ListMontoCredito = Models.Manager.clsInsertaSolicitud.TraeMontoCalcu(montoCredito); if (montoCredito.Monto > 0) { plazo.IdMontoCredito = montoCredito.ListMontoCredito.Last().IdMontoCredito; montoCredito.ListPlazoCredito = Models.Manager.clsInsertaSolicitud.TraePlazoCalcu(plazo); montoCredito.ListFrecuenciaCredito = Models.Manager.clsInsertaSolicitud.TraeFrecuenciaCalcu(); montoCredito.Respuesta = "Datos cargados correctamente"; } else { montoCredito.Respuesta = "El monto del credito aprobado es 0"; } } } catch (ArgumentException) { montoCredito.Respuesta = "Ocurrio un Error"; } //return View(asignacionbuckets); return(Json(montoCredito)); }
public ActionResult CargaMontosProductos(string id = null) { ManagerSolcitudes manage = new ManagerSolcitudes(); try { if (Session["agente"] == null) { return(RedirectToAction("LogOff", "Login")); } MontoCredito montoCredito = new MontoCredito(); var result = manage.CargarProductos(montoCredito); if (result == null) { List <MontoCredito> objetoNulo = new List <MontoCredito>(); objetoNulo.FirstOrDefault().Monto = 0; result = objetoNulo; } return(Json(result)); } catch { throw; } }
internal static List <MontoCredito> TraeMontoCalcu(MontoCredito montoCredito) { string xClase = string.Format("{0}|{1}", MethodBase.GetCurrentMethod().Module.Name, MethodBase.GetCurrentMethod().DeclaringType.Name); string xProceso = MethodBase.GetCurrentMethod().Name; var dto = new DynamicDto(); dto.ParameterList = new List <SpParameter>(); dto.ParameterList.AddRange(from nodo in montoCredito.GetType().GetProperties() where nodo.GetValue(montoCredito) != null select new SpParameter { Name = nodo.Name, Value = nodo.GetValue(montoCredito).ToString() } ); dto.Result = null; dto.SPName = "usp_TraeMonto"; var dto_excepcion = new UTL_TRA_EXCEPCION { STR_CLASE = xClase, STR_EVENTO = xProceso, STR_PARAMETROS = JsonConvert.SerializeObject(montoCredito), STR_APLICATIVO = ConfigurationManager.AppSettings["Aplicativo"], STR_SERVIDOR = System.Net.Dns.GetHostName() }; var dto_obj = new List <MontoCredito>(); try { var obj = DynamicSqlDAO.ExecuterSp <MontoCredito>(dto, GlobalClass.connectionString.Where(a => a.Key == infDto.STR_COD_PAIS).FirstOrDefault().Value); dto_obj = obj.ToList(); } catch (Exception ex) { dto_excepcion.STR_MENSAJE = ex.Message; dto_excepcion.STR_DETALLE = ex.StackTrace; TwoFunTwoMe_DataAccess.Utility.guardaExcepcion(dto_excepcion, GlobalClass.connectionString.Where(a => a.Key == infDto.STR_COD_PAIS).FirstOrDefault().Value); } return(dto_obj); }