예제 #1
0
        public ActionResult DeleteByEmployee(int id)
        {
            Assigment assignment = AssignmentService.Get(id);

            AssignmentService.Delete(assignment);

            return(RedirectToAction("Cv", "Home", new { id = assignment.Employeeid }));
        }
예제 #2
0
        public ActionResult Delete(int id)
        {
            var entity = service.GetById(id);

            service.Delete(entity);

            return(RedirectToAction("Index"));
        }
예제 #3
0
 public ActionResult Delete(int id)
 {
     assignmentservie.Delete(id);
     return(RedirectToAction("Index", assignmentservie.getAssign()));
 }
예제 #4
0
        public void DeleteMenu()
        {
            bool ContinueOrExit = true;

            do
            {
                Console.WriteLine("If u want to delete a student to the private school data base write 1 in console");
                Console.WriteLine("If u want to delete a trainer to the private school data base write 2 in console");
                Console.WriteLine("If u want to delete a course to the private school data base write 3 in console");
                Console.WriteLine("If u want to delete a assignment to the private school data base write 4 in console");
                Console.WriteLine("If u want to delete the relationship between student and course to the private school data base write 5 in console");
                Console.WriteLine("If u want to delete the relationship between trainer and course to the private school data base write 6 in console");
                Console.WriteLine("If u want to delete the relationship between assignment and course to the private school data base write 7 in console");
                Console.WriteLine("\nIf u want to return to Bonus Menu write 0 from keyboard\n");
                string userInput = Console.ReadLine();
                ContinueOrExit = CheckToContinueOrExit(userInput);
                switch (userInput)
                {
                case "1":
                    Console.Clear();
                    studentService.Delete();
                    break;

                case "2":
                    Console.Clear();
                    trainerService.Delete();
                    break;

                case "3":
                    Console.Clear();
                    courseService.Delete();
                    break;

                case "4":
                    Console.Clear();
                    assignmentService.Delete();
                    break;

                case "5":
                    Console.Clear();
                    watchService.Delete();
                    break;

                case "6":
                    Console.Clear();
                    teachService.Delete();
                    break;

                case "7":
                    Console.Clear();
                    assignService.Delete();
                    break;

                case "0":
                    Console.Clear();
                    break;

                default:
                    Console.Clear();
                    DeleteMenu();
                    break;
                }
            } while (ContinueOrExit);
        }