コード例 #1
0
        public IHttpActionResult SavePlan(MultiDataModel model)
        {
            PlanBE data   = JsonConvert.DeserializeObject <PlanBE>(model.String1);
            var    result = PlanBL.SavePlan(data);

            return(Ok(result));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        public ActionResult PlanTab(PreNatal_Plan model)
        {
            PlanBL obj = new PlanBL();

            if (ModelState.IsValid)
            {
                var toReturn = obj.Save(model, out outmodel);
                return(RedirectToAction("GeneralTab", "PaedsPhyExamination", new { area = "PN" }));
            }
            ViewBag.PatientId = new SelectList(Dropdowns.PatientDropDown, "Value", "Text");

            return(View(model));
        }
コード例 #4
0
        public JsonResult EditPlan(CatPlan plan, List <CatPlan> listaPlan)
        {
            PlanBL             planBL          = new PlanBL();
            EditPlanRequestDTO editPlanRequest = new EditPlanRequestDTO();

            editPlanRequest.ListaPlan = new List <CatPlan>();
            editPlanRequest.ListaPlan.Add(plan);

            EditPlanResponseDTO editPlanResponse = new EditPlanResponseDTO();

            editPlanResponse = planBL.EditPlan(editPlanRequest);

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


            return(Json(listaPlan, JsonRequestBehavior.AllowGet));
        }
コード例 #5
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));
        }
コード例 #6
0
        public IHttpActionResult DeletedPlan(int planId)
        {
            var result = PlanBL.DeletedPlan(planId);

            return(Ok(result));
        }
コード例 #7
0
        public IHttpActionResult GetPlanByProtocolId(string protocolId)
        {
            var result = PlanBL.GetPlanByProtocolId(protocolId);

            return(Ok(result));
        }