public async Task <ActionResult> Create([Bind(Include = "Book_ID,Book_Name,Author_Name,Publication,Purchase_Date,Book_Price,Books_Quantity")] BooksInfoEntry booksInfoEntry)
        {
            if (ModelState.IsValid)
            {
                db.BooksInfoEntries.Add(booksInfoEntry);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(booksInfoEntry));
        }
예제 #2
0
        public async Task <ActionResult> Create([Bind(Include = "Student_ID,Student_Name,Enrollment_No,Department,Student_Semester,Student_Contact,Student_Email")] StudentInfoEntry studentInfoEntry)
        {
            if (ModelState.IsValid)
            {
                db.StudentInfoEntries.Add(studentInfoEntry);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(studentInfoEntry));
        }