Exemple #1
0
        public ActionResult CategoryContent(string categ, int?page)
        {
            ViewBag.Categ = categ;

            var model = FilmeServices.GetByCategory(categ).ToList().ToPagedList(page ?? 1, 6);


            return(View(model));
        }
        public IHttpActionResult ricerca(string cognome = "", string nome = "", string posizione = "", string societa = "", string solution = "")
        {
            if (cognome == null)
            {
                cognome = "";
            }
            if (nome == null)
            {
                nome = "";
            }
            if (posizione == null)
            {
                posizione = "";
            }
            if (societa == null)
            {
                societa = "";
            }

            if ((cognome == null & nome == null & posizione == null & societa == null) | (cognome == "" & nome == "" & posizione == "" & societa == ""))
            {
                return(Json(new List <Custommer>()));
            }



            List <Custommer> custommers = FilmeServices.GetByCustomerProp();

            if (cognome == null | nome == null | posizione == null | societa == null | solution == null)
            {
                return(Json(custommers));
            }

            List <RicercaModel> sel = custommers.Where(el => el.cognome.Contains(cognome) & el.societa.Contains(societa) & el.solution.Contains(solution))
                                      .Select(p => new RicercaModel()
            {
                nome      = p.nome,
                cognome   = p.cognome,
                posizione = p.posizione,
                citta     = p.citta,
                mail      = p.mail,
                societa   = p.societa,
                solution  = p.solution
            }).ToList();

            //return Ok(Json(sel));
            return(Json(sel));
        }
        public IHttpActionResult getContatto(string cognome = "", string mail = "", string nome = "")
        {
            if (cognome == null)
            {
                return(Ok());
            }
            if (mail == null)
            {
                return(Ok());
            }
            if (nome == null)
            {
                return(Ok());
            }

            if ((cognome == null & mail == null & nome == null) | (cognome == "" & mail == "" & nome == ""))
            {
                return(Ok());
            }

            Custommer cust = FilmeServices.GetByCustomerProp().Where(prop => prop.cognome == cognome | prop.mail == mail | prop.nome == nome).FirstOrDefault();

            return(Json(cust));
        }
Exemple #4
0
        ////partial views
        public ActionResult CategoryView()
        {
            var model = FilmeServices.GetAllCategory();

            return(PartialView("_CategoryView", model));
        }
Exemple #5
0
        public ActionResult FilmDetail(int id)
        {
            var model = FilmeServices.GetById(id);

            return(View(model));
        }
Exemple #6
0
        public ActionResult Index(int?page)
        {
            var model = FilmeServices.GetAll().ToList <Film>().ToPagedList(page ?? 1, 6);

            return(View(model));
        }