Exemplo n.º 1
0
 public HomeModule()
 {
     Get["/"] =_=> {
     return View ["index.cshtml"];
       };
       Get["/new_Cd"]=_=> {
     return View["new_cd.cshtml"];
       };
       Post["/"]=_=>{
     Cd newCd = new Cd (Request.Form["Cd-Name"],Request.Form["Cd-Artist"]);
     List<Cd> Cdlist = Cd.GetAll();
     return View["index.cshtml", Cdlist];
       };
 }
Exemplo n.º 2
0
        public static List <Cd> SearchAll(string searchThingy)
        {
            System.Console.WriteLine(searchThingy);
            searchThingy.ToLower();
            List <Cd> returnList = new List <Cd> {
            };
            List <Cd> searchCds  = Cd.GetAll();

            foreach (var instance in searchCds)
            {
                if (instance.GetArtists().ToLower() == searchThingy.ToLower())
                {
                    returnList.Add(instance);
                }
            }
            return(returnList);
        }
Exemplo n.º 3
0
 public HomeModule()
 {
     Get["/"] =_=> {
     return View ["index.cshtml"];
       };
       Get["/new_Cd"]=_=> {
     return View["new_cd.cshtml"];
       };
       Post["/"]=_=>{
     Cd newCd = new Cd (Request.Form["Cd-Name"],Request.Form["Cd-Artist"]);
     List<Cd> Cdlist = Cd.GetAll();
     return View["index.cshtml", Cdlist];
       };
       Get["/search"]=_=> {
     return View["search.cshtml"];
       };
       Post["/search"]=_=>{
     string returnString = Request.Form["searchString"];
     System.Console.WriteLine(returnString);
     List<Cd> Cdlist = Cd.SearchAll(returnString);
     return View["search.cshtml", Cdlist];
       };
 }