Beispiel #1
0
        public ActionResult AddPlaneModel()
        {
            var planeModel = new PlaneModelViewModel
            {
                PlaneTypes = PlaneRequests.GetPlaneTypes()
            };

            return(View(planeModel));
        }
 public ActionResult Delete(PlaneModelViewModel plane)
 {
     try
     {
         _service.DeletePlaneModel(_mapper.Map <PlaneModelDto>(plane));
         return(RedirectToAction(nameof(Index)));
     }
     catch
     {
         return(View());
     }
 }
 public ActionResult Create(PlaneModelViewModel planeModelViewModel, IFormFile uploadedImage)
 {
     try
     {
         planeModelViewModel.Image = ImageToArray(Image.FromStream(uploadedImage.OpenReadStream()));
         _service.CreatePlaneModel(_mapper.Map <PlaneModelDto>(planeModelViewModel));
         return(RedirectToAction(nameof(Index)));
     }
     catch
     {
         return(View());
     }
 }