public GetModalidadPagoResponseDTO GetModalidadPago(GetModalidadPagoRequestDTO modalidadPagoRequest) { GetModalidadPagoResponseDTO modalidadPagoResponse = new GetModalidadPagoResponseDTO(); List <CatModalidadPago> listaModalidadPago = new List <CatModalidadPago>(); ModalidadPagoDal modalidadPagoDal = new ModalidadPagoDal(); DataTable dtDatos = new DataTable(); try { dtDatos = modalidadPagoDal.GetModalidadPago(modalidadPagoRequest.IdModalidadPago, modalidadPagoRequest.ModalidadPago); listaModalidadPago = dtDatos.AsEnumerable() .Select(row => new CatModalidadPago { idModalidadPago = row.Field <int?>("idModalidadPago").GetValueOrDefault(), modalidadPago = string.IsNullOrEmpty(row.Field <string>("modalidadPago")) ? "" : row.Field <string>("modalidadPago"), descripcion = string.IsNullOrEmpty(row.Field <string>("descripcion")) ? "" : row.Field <string>("descripcion"), usuarioInsert = string.IsNullOrEmpty(row.Field <string>("usuarioInsert")) ? "" : row.Field <string>("usuarioInsert"), fechaInsert = row.Field <DateTime?>("fechaInsert").GetValueOrDefault(), usuarioUpdate = string.IsNullOrEmpty(row.Field <string>("usuarioUpdate")) ? "" : row.Field <string>("usuarioUpdate"), fechaUpdate = row.Field <DateTime?>("fechaUpdate").GetValueOrDefault(), }).ToList(); modalidadPagoResponse.ListaModalidadPago = listaModalidadPago; modalidadPagoResponse.Mensaje = "OK"; } catch (Exception ex) { modalidadPagoResponse.ListaModalidadPago = new List <CatModalidadPago>(); modalidadPagoResponse.Mensaje = "ERROR: " + ex.Message; } return(modalidadPagoResponse); }
public JsonResult GetPlan() { ModalidadPagoBL modalidadPagoBL = new ModalidadPagoBL(); GetModalidadPagoRequestDTO modalidadPagoRequest = new GetModalidadPagoRequestDTO(); GetModalidadPagoResponseDTO modalidadPagoResponse = new GetModalidadPagoResponseDTO(); modalidadPagoResponse = modalidadPagoBL.GetModalidadPago(modalidadPagoRequest); List <CatModalidadPago> listaModalidadPago = new List <CatModalidadPago>(); if (modalidadPagoResponse.Mensaje == "OK") { listaModalidadPago = modalidadPagoResponse.ListaModalidadPago; } PlanBL planBL = new PlanBL(); GetPlanRequestDTO planRequest = new GetPlanRequestDTO(); GetPlanResponseDTO planResponse = new GetPlanResponseDTO(); planResponse = planBL.GetPlan(planRequest); List <CatPlan> listaPlan = new List <CatPlan>(); if (planResponse.Mensaje == "OK") { listaPlan = planResponse.ListaEmpresa; } List <CatPlan> listaPlanActual = new List <CatPlan>(); listaPlanActual = (from plan in listaPlan join modalidadPago in listaModalidadPago on plan.idModalidadPago equals modalidadPago.idModalidadPago select new CatPlan { idPlan = plan.idPlan, plan = plan.plan, descripcion = plan.descripcion, idModalidadPago = plan.idModalidadPago, modalidadPago = modalidadPago.modalidadPago, fechaInsert = plan.fechaInsert, usuarioInsert = plan.usuarioInsert, fechaUpdate = plan.fechaUpdate, usuarioUpdate = plan.usuarioUpdate }).ToList(); PlanModalidadPago planModalidadPago = new PlanModalidadPago(); planModalidadPago.ListaPlan = listaPlanActual; planModalidadPago.ListaModalidadPago = listaModalidadPago; return(Json(planModalidadPago, JsonRequestBehavior.AllowGet)); }
public JsonResult GetModalidadPago() { ModalidadPagoBL modalidadPagoBL = new ModalidadPagoBL(); GetModalidadPagoResponseDTO modalidadPagoResponse = new GetModalidadPagoResponseDTO(); GetModalidadPagoRequestDTO modalidadPagoRequest = new GetModalidadPagoRequestDTO(); List <CatModalidadPago> listaModalidadPago = new List <CatModalidadPago>(); modalidadPagoResponse = modalidadPagoBL.GetModalidadPago(modalidadPagoRequest); if (modalidadPagoResponse.Mensaje == "OK") { listaModalidadPago = modalidadPagoResponse.ListaModalidadPago; } return(Json(listaModalidadPago, JsonRequestBehavior.AllowGet)); }