Ejemplo n.º 1
0
        // GET: Article
        public ActionResult Random()
        {
            //var article = new Article() { DesignationArticle = "SOUFFI GAFSA GI" };

            var magazin = new Magasin()
            {
                NomMagasin = "Matieres Premieres"
            };

            // Passing data parameters
            //ViewData["Article"] = article;

            var arts = new List <Article> {
                new Article {
                    RefArticle         = "A1",
                    DesignationArticle = "A1",
                    UniteArticle       = "KG"
                },
                new Article {
                    RefArticle         = "A2",
                    DesignationArticle = "A2",
                    UniteArticle       = "KG"
                }
            };

            var viewModel = new RandomArticleViewModel {
                magasin  = magazin,
                articles = arts
            };



            //return View();
            return(View(viewModel));
            //return Content("Hello World");
            //return HttpNotFound();
            //return new EmptyResult();
            //return RedirectToAction("Index","Home", new {page=1, sortBy="name"} );
        }
Ejemplo n.º 2
0
        // GET: Article/Random
        public ActionResult Random()
        {
            var article = new Article()
            {
                Name = "ArticolActivitate!"
            };
            var users = new List <User>
            {
                new User {
                    Name = "User 1"
                },
                new User {
                    Name = "User 2"
                }
            };

            var viewModel = new RandomArticleViewModel
            {
                Article = article,
                Users   = users
            };

            return(View(viewModel));
        }