Example #1
0
        // GET: Packs/Details/5
        public ActionResult DetailsPacks(int id)
        {
            PacksService PS = new PacksService();
            pack         p  = PS.GetPackById(id);

            return(View(p));
        }
Example #2
0
        // GET: Packs
        public ActionResult Index()
        {
            PacksService PS      = new PacksService();
            List <pack>  maListe = PS.getAllPacks();


            return(View(maListe));
        }
Example #3
0
        static void Main(string[] args)
        {
            // ISimpleMemberService test = new SimpleMemberService();
            //    test.Add(new simplemember {DTYPE="ActiveMember",email="*****@*****.**",name="momo",
               //    password="******",server="euw",summonerName="sdf",surname="fd",username="******",xp=60,approved=true,phone=4654,role="kljlkj"});

            IPacksService test = new PacksService();
            test.Add(new pack { category = "az",datemiseenligne= new DateTime(),name="jlkj",price=50,quantity=65 });

            Console.WriteLine("aaaaaaaaaaaa");
            Console.ReadKey();
        }
Example #4
0
        public ActionResult AllPacks(string searchString)
        {
            PacksService PS = new PacksService();
            List<pack> maListe = PS.getAllPacks();

            if (!String.IsNullOrEmpty(searchString))
            {
                maListe = maListe.Where(p => p.name.Contains(searchString)).ToList();
            }

            return View(maListe);
        }
Example #5
0
        public ActionResult AllPacks(string searchString)
        {
            PacksService PS      = new PacksService();
            List <pack>  maListe = PS.getAllPacks();

            if (!String.IsNullOrEmpty(searchString))
            {
                maListe = maListe.Where(p => p.name.Contains(searchString)).ToList();
            }


            return(View(maListe));
        }
Example #6
0
        public ActionResult Create(pack p)
        {
            try
            {
                IPacksService test = new PacksService();
                p.datemiseenligne = DateTime.Now;
                test.Add(p);

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
Example #7
0
        public ActionResult Create(pack p)
        {
            try
            {
                IPacksService test = new PacksService();
                p.datemiseenligne = DateTime.Now;
                test.Add(p);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Example #8
0
        static void Main(string[] args)
        {
            // ISimpleMemberService test = new SimpleMemberService();
            //    test.Add(new simplemember {DTYPE="ActiveMember",email="*****@*****.**",name="momo",
            //    password="******",server="euw",summonerName="sdf",surname="fd",username="******",xp=60,approved=true,phone=4654,role="kljlkj"});

            IPacksService test = new PacksService();

            test.Add(new pack {
                category = "az", datemiseenligne = new DateTime(), name = "jlkj", price = 50, quantity = 65
            });


            Console.WriteLine("aaaaaaaaaaaa");
            Console.ReadKey();
        }
        public async Task ShouldGetAvailablePacks()
        {
            var result = new List <Pack>
            {
                new Pack("17w15a", "snapshot", "17w15a.json"),
                new Pack("17w14a", "snapshot", "17w14a.json"),
                new Pack("17w13b", "snapshot", "17w13b.json"),
                new Pack("17w06a", "snapshot", "17w06a.json")
            };
            var restClientMock = new Mock <IRestClient>();

            restClientMock.Setup(x => x.ExecuteTaskAsync <List <Pack> >(It.IsAny <IRestRequest>()))
            .ReturnsAsync(new RestResponse <List <Pack> > {
                Data = result
            });
            var service = new PacksService(restClientMock.Object);

            var packs = await service.GetAvailablePacksAsync();

            Assert.IsNotNull(result);
            Assert.AreSame(result, packs);
            restClientMock.Verify(x => x.ExecuteTaskAsync <List <Pack> >(It.IsAny <IRestRequest>()), Times.Once);
        }
Example #10
0
 // GET: Packs/Details/5
 public ActionResult DetailsPacks(int id)
 {
     PacksService PS = new PacksService();
     pack p = PS.GetPackById(id);
     return View(p);
 }
Example #11
0
        // GET: Packs
        public ActionResult Index()
        {
            PacksService PS = new PacksService();
            List<pack> maListe = PS.getAllPacks();

            return View(maListe);
        }
Example #12
0
 public HomeController(PacksService packsService)
 {
     _packsService = packsService;
 }