private void DeleteBtnClicked(object sender, RoutedEventArgs e) { Button btn = (Button)sender; Bicycle b = (Bicycle)btn.DataContext; service.RemoveBicycle(b.ID); window.Content = new BicyclePage(window); }
//[HttpPost] //public ActionResult CreateBike(DropdownDetails dropDown, string year) //{ //TODO mindske service kald //var id = Session["ID"]; // BicycleType bicycleType = client.GetTypes().Find(a=> a.TypeName== Types); // // Brand brands = client.GetBrands().Find(a => a.Name == Brands); // Wheel wheelSize = client.GetWheelSizes().Find((a => a.Size == Convert.ToInt32(WheelSize))); // Frame frameSize = client.GetFrameSizes().Find(a => a.Size == Convert.ToInt32(FrameSize)); // client.CreateBicycle(year,dropDown.SelectedBrand,dropDown.SelectedType,dropDown.SelectedWheel,dropDown.SelectedFrame,Convert.ToInt32(id)); // Console.WriteLine(year, brands, bicycleType, wheelSize, frameSize, Convert.ToInt32(id)); //return View(dropDown); // } public ActionResult DeleteBike(int ID) { client.RemoveBicycle(ID); return(RedirectToAction("ViewBikes")); }