Example #1
0
        public IActionResult CreateMovie(Movie.WebUI.Models.MovieModel model, IFormFile file)
        {
            if (ModelState.IsValid)
            {
                var entity = new Entity.Movie()
                {
                    Name        = model.Name,
                    Description = model.Description,
                };

                if (file != null)
                {
                    entity.ImageUrl = file.FileName;

                    var path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot\\img", file.FileName);
                    using (var stream = new FileStream(path, FileMode.Create))
                    {
                        file.CopyTo(stream);
                    }
                }

                _movieService.Create(entity);

                return(RedirectToAction("Index"));
            }
            else
            {
                return(View(model));
            }
        }
Example #2
0
        public object Completo(Entity.Movie movie)
        {
            if (Equals(movie, null))
            {
                return(null);
            }

            return(new
            {
                Id = movie.Id,
                Title = movie.Title,
                Genre = movie.Genre,
                ReleaseDate = movie.ReleaseDate,
                Cpf = movie.Cpf,
                Address = _addresDesv.Completo(movie.Address)
            });
        }
Example #3
0
 public void Update(Entity.Movie entity, int[] categoryIds)
 {
     _movieDal.Update(entity, categoryIds);
 }
Example #4
0
 public void Update(Entity.Movie entity)
 {
     _movieDal.Update(entity);
 }
Example #5
0
 public void Delete(Entity.Movie entity)
 {
     _movieDal.Delete(entity);
 }
Example #6
0
 public void Create(Entity.Movie entity)
 {
     _movieDal.Create(entity);
 }
 public void Update(Entity.Movie entity, int[] categoryIds)
 {
     throw new NotImplementedException();
 }
 public void Update(Entity.Movie entity)
 {
     throw new NotImplementedException();
 }