예제 #1
0
        // GET: Student/Create
        public ActionResult Create()
        {
            Student s = db.Students.FirstOrDefault(p => p.Id == db.Students.Max(x => x.Id));
            var     newstudentNumber = AccountNumber.NextStudentNumber(s.StudentNumber);
            var     student          = new Student {
                StudentNumber = newstudentNumber, Password = newstudentNumber
            };

            return(View(student));
        }
예제 #2
0
        // GET: Admin/Create
        public ActionResult Create()
        {
            Admin a = db.Admins.FirstOrDefault(p => p.Id == db.Admins.Max(x => x.Id));
            var   newAdminNumber = AccountNumber.NextStudentNumber(a.AdminNumber);
            var   admin          = new Admin {
                AdminNumber = newAdminNumber, Password = newAdminNumber
            };

            return(View(admin));
        }