// GET: Packs/Details/5 public ActionResult DetailsPacks(int id) { PacksService PS = new PacksService(); pack p = PS.GetPackById(id); return(View(p)); }
// GET: Packs public ActionResult Index() { PacksService PS = new PacksService(); List <pack> maListe = PS.getAllPacks(); return(View(maListe)); }
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 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); }
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)); }
public ActionResult Create(pack p) { try { IPacksService test = new PacksService(); p.datemiseenligne = DateTime.Now; test.Add(p); return RedirectToAction("Index"); } catch { return View(); } }
public ActionResult Create(pack p) { try { IPacksService test = new PacksService(); p.datemiseenligne = DateTime.Now; test.Add(p); return(RedirectToAction("Index")); } catch { return(View()); } }
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); }
// GET: Packs/Details/5 public ActionResult DetailsPacks(int id) { PacksService PS = new PacksService(); pack p = PS.GetPackById(id); return View(p); }
// GET: Packs public ActionResult Index() { PacksService PS = new PacksService(); List<pack> maListe = PS.getAllPacks(); return View(maListe); }
public HomeController(PacksService packsService) { _packsService = packsService; }