예제 #1
0
        public ActionResult CreateOrEdit(int id = -1)
        {
            var model = new PersonaVm();

            if (id > 0)
            {
                var searchParam = new PersonaGetParams {
                    IdPersona = id
                };
                var persona = BLLPcpModel_App.GetPersonas(searchParam).FirstOrDefault();
                if (persona != null)
                {
                    model.Persona = persona;
                }
            }
            return(View(model));
        }
예제 #2
0
        public void GerPersonasTest()
        {
            var mensajeError = string.Empty;
            var searchParam  = new PersonaGetParams()
            {
                Nombres = "Pedro"
            };
            IEnumerable <Persona> result = null;

            try
            {
                result = BLLPcpModel_App.GetPersonas(searchParam);
            }
            catch (Exception e)
            {
                mensajeError = e.Message;
            }

            Assert.IsTrue(result.Count() == 0, $"No se obtuvieron resultados de la busqueda ver el mensaje con mas detalles {mensajeError}");
        }
예제 #3
0
        // GET: Personas
        public ActionResult Index()
        {
            var personas = BLLPcpModel_App.GetPersonas(new PersonaGetParams());

            return(View(personas));
        }