public ActionResult Create([Bind(Include = "Id,SchoolName,RegNo")] School school) { if (ModelState.IsValid) { db.Schools.Add(school); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(school)); }
public ActionResult Create([Bind(Include = "Id,StreamName")] Stream stream) { if (ModelState.IsValid) { db.Streams.Add(stream); db.SaveChanges(); return(RedirectToAction("Create")); } return(View(stream)); }
public ActionResult Create([Bind(Include = "Id,TeacherNo,SchoolId,EnlistedDate")] Teacher teacher) { if (ModelState.IsValid) { db.Teachers.Add(teacher); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(teacher)); }
public ActionResult Create([Bind(Include = "Id,Type")] ExamType examType) { if (ModelState.IsValid) { db.ExamTypes.Add(examType); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(examType)); }
public ActionResult Create([Bind(Include = "Id,FirstName,MiddleName,LastName,DateOfBirth,Gender,MaritalStatus,CreatedBy,CreatedDate,EditedBy,EditedDate")] Parent parent) { if (ModelState.IsValid) { db.Parents.Add(parent); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(parent)); }
public ActionResult Create([Bind(Include = "Id,StudentId")] Attendence attendence) { if (ModelState.IsValid) { db.Attendences.Add(attendence); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.StudentId = new SelectList(db.Students, "Id", "AdmissionNo", attendence.StudentId); return(View(attendence)); }
public ActionResult Create([Bind(Include = "Id,DomitoryName,DomitoryNo,SchoolId")] Domitory domitory) { if (ModelState.IsValid) { db.Domitories.Add(domitory); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.SchoolId = new SelectList(db.Schools, "Id", "SchoolName", domitory.SchoolId); return(View(domitory)); }
public ActionResult Create([Bind(Include = "Id,EmployeeId,TeacherId")] Leave leave) { if (ModelState.IsValid) { db.Leaves.Add(leave); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.EmployeeId = new SelectList(db.Employees, "Id", "EmployNumber", leave.EmployeeId); return(View(leave)); }
public ActionResult Create([Bind(Include = "Id,ClassName,SchoolId")] Class @class) { if (ModelState.IsValid) { db.Classes.Add(@class); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.SchoolId = new SelectList(db.Schools, "Id", "SchoolName", @class.SchoolId); return(View(@class)); }
public ActionResult Create([Bind(Include = "Id,EmployNumber,SchoolId,EnlistedDate")] Employee employee) { if (ModelState.IsValid) { db.Employees.Add(employee); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.SchoolId = new SelectList(db.Schools, "Id", "SchoolName", employee.SchoolId); return(View(employee)); }
public ActionResult Create([Bind(Include = "Id,ExamName,ExamType,SubjectId")] Exam exam) { if (ModelState.IsValid) { db.Exams.Add(exam); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.SubjectId = new SelectList(db.Subjects, "Id", "Name", exam.SubjectId); return(View(exam)); }
public ActionResult Create([Bind(Include = "Id,Day,StartTime,EndTime,SubjectId")] TimeTable timeTable) { if (ModelState.IsValid) { db.TimeTables.Add(timeTable); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.SubjectId = new SelectList(db.Subjects, "Id", "Name", timeTable.SubjectId); return(View(timeTable)); }
public ActionResult Create([Bind(Include = "Id,AdmissionNo,SchoolId,ClassId,ParentId,FirstName,MiddleName,LastName,DateOfBirth,Gender,MaritalStatus,CreatedBy,CreatedDate,EditedBy,EditedDate")] Student student) { if (ModelState.IsValid) { db.Students.Add(student); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ClassId = new SelectList(db.Classes, "Id", "ClassName", student.ClassId); ViewBag.ParentId = new SelectList(db.Parents, "Id", "FirstName", student.ParentId); return(View(student)); }
public ActionResult Create([Bind(Include = "Id,Name,StudentId,TeacherId")] Subject subject) { if (ModelState.IsValid) { db.Subjects.Add(subject); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.StudentId = new SelectList(db.Students, "Id", "AdmissionNo", subject.StudentId); ViewBag.TeacherId = new SelectList(db.Teachers, "Id", "TeacherNo", subject.TeacherId); return(View(subject)); }
public ActionResult Create([Bind(Include = "Id,ClassName,SchoolId")] ClassViewModel classViewModel) { if (ModelState.IsValid) { var klas = new Class() { //mapping ClassName = classViewModel.ClassName, SchoolId = classViewModel.SchoolId }; db.Classes.Add(klas); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.SchoolId = new SelectList(db.Schools, "Id", "SchoolName", classViewModel.SchoolId); return(View(classViewModel)); }