Ejemplo n.º 1
0
        public ActionResult Edit(Idea idea)
        {
            if (string.IsNullOrEmpty(idea.Title) || string.IsNullOrEmpty(idea.Description))
            {
                IdeaFilter ideaFilter = new IdeaFilter()
                {
                    Id = idea.Id
                };

                Idea ideaBd = _IdeaService.GetIdea(ideaFilter);

                if (idea == null)
                    return View();

                ViewBag.PETianos = _PETianoService.GetPETianos().Select(petiano => new SelectListItem
                {
                    Text = petiano.Name + "(" + petiano.Login + ")",
                    Value = petiano.Id.ToString()
                });

                return View(ideaBd);
            }
            else
            {
                _IdeaService.EditIdea(idea);

                return RedirectToAction("Index");
            }
        }
Ejemplo n.º 2
0
 public List<Idea> GetIdeas(IdeaFilter ideaFilter = null)
 {
     using (IBusinessProvider provider = base.CreateBusinessProvider())
     using (IIdeaBusinessProvider prov = provider.CreateIdeaBusinessProvider())
         return prov.GetIdeas(ideaFilter);
 }
Ejemplo n.º 3
0
 public List<Idea> GetIdeas(IdeaFilter ideaFilter = null)
 {
     using (IDataProvider provider = base.CreateDataProvider())
     using (IIdeaRepository repository = provider.CreateIdeaRepository())
         return repository.GetIdeas(ideaFilter);
 }