public async Task <IActionResult> Create([Bind("Id,Name,Password,Department")] Teacher teacher) { if (ModelState.IsValid) { _context.Add(teacher); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(teacher)); }
public async Task <IActionResult> Create([Bind("CStage,CType")] Class @class) { if (ModelState.IsValid) { _context.Add(@class); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(@class)); }
public async Task <IActionResult> Create([Bind("RoomNo,Type")] Room room) { if (ModelState.IsValid) { _context.Add(room); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(room)); }
public async Task <IActionResult> Create([Bind("Id,Name,Password,Email")] Registry registry) { if (ModelState.IsValid) { _context.Add(registry); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(registry)); }
public async Task <IActionResult> Create([Bind("Id,Name,Password,Email")] Admin admin) { if (ModelState.IsValid) { _context.Add(admin); await _context.SaveChangesAsync(); return(RedirectToAction("Create")); } return(View(admin)); }
public async Task <IActionResult> Create([Bind("Id,Name,Password,Class")] Student student) { if (ModelState.IsValid) { _context.Add(student); await _context.SaveChangesAsync(); return(RedirectToAction("Create")); } ViewData["Class"] = new SelectList(_context.Class, "CStage", "CStage", student.Class); return(View(student)); }
public async Task <IActionResult> Create([Bind("SCode,SName,SType,TId")] Subject subject) { if (ModelState.IsValid) { _context.Add(subject); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewData["TId"] = new SelectList(_context.Teacher, "Id", "Name", subject.TId); return(View(subject)); }
public async Task <IActionResult> Create([Bind("Id,CStage,SCode")] ClaSub claSub) { if (ModelState.IsValid) { _context.Add(claSub); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewData["CStage"] = new SelectList(_context.Class, "CStage", "CStage", claSub.CStage); ViewData["SCode"] = new SelectList(_context.Subject, "SCode", "SName", claSub.SCode); return(View(claSub)); }
public async Task <IActionResult> Create([Bind("Serial,SCode,CStage,RoomNo,Date,Time")] ExamRoutine examRoutine) { if (ModelState.IsValid) { _context.Add(examRoutine); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewData["CStage"] = new SelectList(_context.Class, "CStage", "CStage", examRoutine.CStage); ViewData["RoomNo"] = new SelectList(_context.Room, "RoomNo", "RoomNo", examRoutine.RoomNo); ViewData["SCode"] = new SelectList(_context.Subject, "SCode", "SName", examRoutine.SCode); return(View(examRoutine)); }