public ActionResult AddNewManafacturer(ManafacturerViewModel model)
        {
            var newManafacturer = new Manafacturer
            {
                Name = model.ManafacturerName,
                Website = model.ManafacturerWebsite
            };
            _manafacturerRepository.Add(newManafacturer);

            return Redirect("/Admin/Index");
        }
        public ActionResult ViewManafacturer(ManafacturerViewModel model, string searchWord)
        {
            var manafacturerViewModel = new ManafacturerViewModel
                                            {
                                                ManafacturerId = model.ManafacturerId,
                                                ManafacturerName = _manafacturerRepository.GetByManafacturerId(model.ManafacturerId).Name,
                                                ManafacturerWebsite =
                                                    _manafacturerRepository.GetByManafacturerId(model.ManafacturerId).Website,
                                                SearchWord = searchWord
            };

            return View(manafacturerViewModel);
        }
 public ActionResult AddNewManafacturer()
 {
     var manafacturerViewModel = new ManafacturerViewModel();
     return View(manafacturerViewModel);
 }
        public ActionResult ViewManafacturer(int id)
        {
            var manafacturerViewModel = new ManafacturerViewModel
            {
                ManafacturerId = id,
                ManafacturerName = _manafacturerRepository.GetByManafacturerId(id).Name,
                ManafacturerWebsite =
                    _manafacturerRepository.GetByManafacturerId(id).Website,
            };

            return View(manafacturerViewModel);
        }
        public ActionResult EditManafacturer(ManafacturerViewModel model)
        {
            var updatedManafacturer = _manafacturerRepository.GetByManafacturerId(model.ManafacturerId);

            updatedManafacturer.Name = model.ManafacturerName;
            updatedManafacturer.Website = model.ManafacturerWebsite;

            _manafacturerRepository.Update(updatedManafacturer);
            return Redirect("/Admin/ViewManafacturer?id=" + model.ManafacturerId);
        }