コード例 #1
0
        public JsonResult AddModalidadPago(CatModalidadPago modalidadPago, List <CatModalidadPago> listaModalidadPago)
        {
            modalidadPago.usuarioInsert = "alan200531";

            ModalidadPagoBL modalidadPagoBL = new ModalidadPagoBL();

            AddModalidadPagoRequestDTO addModalidadPagoRequest = new AddModalidadPagoRequestDTO();

            addModalidadPagoRequest.ListaModalidadPago = new List <CatModalidadPago>();
            addModalidadPagoRequest.ListaModalidadPago.Add(modalidadPago);

            AddModalidadPagoResponseDTO addModalidadPagoResponse = new AddModalidadPagoResponseDTO();

            addModalidadPagoResponse = modalidadPagoBL.AddModalidadPago(addModalidadPagoRequest);

            if (addModalidadPagoResponse.ListaModalidadPago.Count > 0)
            {
                modalidadPago.mensaje = addModalidadPagoResponse.ListaModalidadPago[0].mensaje;

                listaModalidadPago.Add(modalidadPago);
            }
            else
            {
                modalidadPago.mensaje = "Error: Ocurrio un problema inesperado, no se actualizo correctamente el Plan Empresarial, intenta de nuevo.";
            }

            return(Json(listaModalidadPago, JsonRequestBehavior.AllowGet));
        }
コード例 #2
0
        public JsonResult EditModalidadPago(CatModalidadPago modalidadPago, List <CatModalidadPago> listaModalidadPago)
        {
            ModalidadPagoBL             modalidadPagoBL          = new ModalidadPagoBL();
            EditModalidadPagoRequestDTO editModalidadPagoRequest = new EditModalidadPagoRequestDTO();

            editModalidadPagoRequest.ListaModalidadPago = new List <CatModalidadPago>();
            editModalidadPagoRequest.ListaModalidadPago.Add(modalidadPago);

            EditModalidadPagoResponseDTO editModalidadPagoResponse = new EditModalidadPagoResponseDTO();

            editModalidadPagoResponse = modalidadPagoBL.EditModalidadPago(editModalidadPagoRequest);

            if (editModalidadPagoResponse.ListaModalidadPago.Count > 0)
            {
                modalidadPago.mensaje = editModalidadPagoResponse.ListaModalidadPago[0].mensaje;
            }
            else
            {
                modalidadPago.mensaje = "Error: Ocurrio un problema inesperado, no se actualizo correctamente el Plan Empresarial, intenta de nuevo.";
            }

            return(Json(listaModalidadPago, JsonRequestBehavior.AllowGet));
        }
コード例 #3
0
        public JsonResult AddPlan(CatPlan plan, List <CatPlan> listaPlan, List <CatModalidadPago> listaModalidadPago)
        {
            plan.usuarioInsert = "alan200531";

            PlanBL planBL = new PlanBL();

            AddPlanRequestDTO addPlanRequest = new AddPlanRequestDTO();

            addPlanRequest.ListaPlan = new List <CatPlan>();

            addPlanRequest.ListaPlan.Add(plan);

            AddPlanResponseDTO addPlanResponse = new AddPlanResponseDTO();

            addPlanResponse = planBL.AddPlan(addPlanRequest);

            if (addPlanResponse.ListaPlan.Count > 0)
            {
                plan.mensaje = addPlanResponse.ListaPlan[0].mensaje;

                CatModalidadPago modalidadPago = listaModalidadPago.Where(n => n.idModalidadPago == plan.idModalidadPago).FirstOrDefault();

                if (modalidadPago != null)
                {
                    plan.modalidadPago = modalidadPago.modalidadPago;
                }

                listaPlan.Add(plan);
            }
            else
            {
                plan.mensaje = "Error: Ocurrio un problema inesperado, no se actualizo correctamente el Plan Empresarial, intenta de nuevo.";
            }

            return(Json(listaPlan, JsonRequestBehavior.AllowGet));
        }