Exemplo n.º 1
0
 public IActionResult Remove(int[] helpIds)
 {
     foreach (int helpId in helpIds)
     {
         LittleHelpData.Remove(helpId);
     }
     return(Redirect("/"));
 }
Exemplo n.º 2
0
        public IActionResult Edit(AddEditHelpViewModel addEditHelpViewModel)
        {
            LittleHelp helpData = LittleHelpData.GetById(addEditHelpViewModel.HelpId);

            helpData.Name    = addEditHelpViewModel.Name;
            helpData.Contact = addEditHelpViewModel.Contact;
            helpData.Comment = addEditHelpViewModel.Comment;

            return(Redirect("/"));
        }
Exemplo n.º 3
0
        public IActionResult Edit(int helpId)
        {
            AddEditHelpViewModel addEditHelpViewModel = new AddEditHelpViewModel();

            LittleHelp helpData = LittleHelpData.GetById(helpId);

            addEditHelpViewModel.Name    = helpData.Name;
            addEditHelpViewModel.Contact = helpData.Contact;
            addEditHelpViewModel.HelpId  = helpData.HelpId;
            addEditHelpViewModel.Comment = helpData.Comment;
            return(View(addEditHelpViewModel));
        }
Exemplo n.º 4
0
        public IActionResult Add(AddHelpViewModel addHelpViewModel)
        {
            LittleHelp helper = new LittleHelp
            {
                Name    = addHelpViewModel.Name,
                Contact = addHelpViewModel.Contact,
                Comment = addHelpViewModel.Comment
            };

            LittleHelpData.Add(helper);
            return(Redirect("/LittleHelp"));
        }
Exemplo n.º 5
0
 public IActionResult Remove()
 {
     ViewBag.helpers = LittleHelpData.GetAll();
     return(View());
 }