public IActionResult DeleteLeaner(int id) { ViewData["Message"] = "Delete Leaner"; StudentProcessor.DeleteLeaner(id); return(RedirectToAction(nameof(ViewLeaners))); }
public IActionResult AddModule(int id) { ViewData["Message"] = "Add Module To Leaner"; var data = StudentProcessor.LoadModulesPerTrainee(id).ToList(); List <Student_ModuleModel> modules = new List <Student_ModuleModel>(); foreach (var row in data) { modules.Add(new Student_ModuleModel { Id = row.Id, Title = row.Title }); } ViewBag.listofitems = modules; var studentModule = StudentProcessor.GetTraineeModules(id).ToList(); var GetStudent = StudentProcessor.GetTrainee(id); ViewBag.listofModules = studentModule; StudentModel LeanerInfo = new StudentModel() { Id = GetStudent[0].Id, FirstName = GetStudent[0].Firstname, LastName = GetStudent[0].Lastname }; TempData["Name"] = "" + LeanerInfo.FirstName + " " + LeanerInfo.LastName + ""; return(View()); }
public IActionResult DeleteModule(int id) { ViewData["Message"] = "Delete Module"; StudentProcessor.DeleteModule(id); return(RedirectToAction(nameof(ViewModules))); }
public IActionResult AddModule(int id, ModuleModel model) { StudentProcessor.AddModuleToStudent(id, Convert.ToInt32(model.Title)); string url = $"../AddModule/{id}"; return(Redirect(url)); }
static void Main(string[] args) { StudentProcessor p = new StudentProcessor(); Student s = p.GetStudentInfo(); p.printStudentInfo(s); }
public AccountController() { studentProcessor = new StudentProcessor(); classProcessor = new ClassProcessor(); studentClassProcessor = new StudentClassProcessor(); sqlConnection = System.Configuration.ConfigurationManager.ConnectionStrings["LocalPC"].ConnectionString; }
// POST api/values public bool DeleteStudent(Student student) { if (student == null) { return(false); } return(StudentProcessor.ProcessDeleteStudent(student)); }
public IActionResult AddScore(Student_ModuleModel model) { ViewData["Message"] = "Add Score"; StudentProcessor.AddScore(model.User_Id, model.Title_id, model.Score, DateTime.Now); string url = $"AddModule/{model.User_Id}"; return(Redirect(url)); }
public IActionResult AddModule(ModuleModel model) { if (ModelState.IsValid) { StudentProcessor.CreateModule(model.Title, model.Language); return(RedirectToAction(nameof(ViewModules))); } return(View()); }
public static void ProcessStudents(IEnumerable <Student> Students, StudentProcessor Processor) { var index = 0; foreach (var s in Students) { Console.WriteLine(Processor(s, index++)); } }
private static void ProcessStudent(IEnumerable <Student> Students, StudentProcessor Processor) { var index = 0; foreach (var student in Students) { Console.WriteLine(Processor(student, index++)); } }
public IActionResult SignUp(StudentModel model) { if (ModelState.IsValid) { StudentProcessor.CreateLearner(model.FirstName, model.LastName); return(RedirectToAction(nameof(ViewLeaners))); } return(View()); }
public ActionResult EditStudent(StudentModel model) { if (ModelState.IsValid) { int RecordUpdateded = StudentProcessor.UpdateStudent(model.Student_IDX, model.FirstName, model.LastName, model.Age, model.IsAlive); return(RedirectToAction("ViewStudents")); } return(View()); }
public ActionResult DeleteStudent(int StudentID) { ViewBag.Message = "Delete Student"; if (ModelState.IsValid) { int RecordDeleted = StudentProcessor.DeleteStudent(StudentID); return(RedirectToAction("ViewStudents")); } return(View()); }
public IActionResult ViewLeaners() { ViewData["Message"] = "View Leaners"; var data = StudentProcessor.LoadLeaners(); List <StudentModel> learners = new List <StudentModel>(); foreach (var row in data) { learners.Add(new StudentModel { Id = row.Id, FirstName = row.Firstname, LastName = row.Lastname }); } return(View(learners)); }
public IActionResult ViewModules() { ViewData["Message"] = "View Modules"; var data = StudentProcessor.LoadModules(); List <ModuleModel> modules = new List <ModuleModel>(); foreach (var row in data) { modules.Add(new ModuleModel { Id = row.Id, Title = row.Title, Language = row.Language }); } return(View(modules)); }
public ActionResult ViewStudents() { ViewBag.Message = "Student List"; var data = StudentProcessor.LoadStudents(); List <StudentModel> students = new List <StudentModel>(); foreach (var row in data) { students.Add(new StudentModel { Student_IDX = row.Student_IDX, FirstName = row.FirstName, LastName = row.LastName, Age = row.Age, IsAlive = row.IsAlive }); } return(View(students)); }
public IActionResult ScoresReport() { ViewData["Message"] = "Report Scores"; var data = StudentProcessor.ReportScores(); List <Scores_reportModel> Scores = new List <Scores_reportModel>(); foreach (var row in data) { Scores.Add(new Scores_reportModel { Trainee_id = row.Trainee_id, FirstName = row.FirstName, LastName = row.LastName, Year = row.Year, Scores = row.Scores }); } return(View(Scores)); }
public ActionResult ViewStudent(int StudentID) { ViewBag.Message = "Student Detail"; var data = StudentProcessor.LoadStudents(); List <StudentModel> students = new List <StudentModel>(); foreach (var row in data) { students.Add(new StudentModel { Student_IDX = row.Student_IDX, FirstName = row.FirstName, LastName = row.LastName, Age = row.Age, IsAlive = row.IsAlive }); } var student = students.Where(s => s.Student_IDX == StudentID).FirstOrDefault(); return(View(student)); }