public ActionResult Create([Bind(Include = "ID,NAME")] BOOK_CATEGORY bOOK_CATEGORY)
        {
            if (ModelState.IsValid)
            {
                db.BOOK_CATEGORY.Add(bOOK_CATEGORY);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(bOOK_CATEGORY));
        }
        public ActionResult Create([Bind(Include = "ID,NAME")] MemberType memberType)
        {
            if (ModelState.IsValid)
            {
                db.MemberTypes.Add(memberType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(memberType));
        }
        public ActionResult Create([Bind(Include = "ID,FIRST_NAME,LAST_NAME,ADDRESS,EMAIL,CONTACT_NO,EDUCATION,SPECIALIZATION,REMARKS")] AUTHOR aUTHOR)
        {
            if (ModelState.IsValid)
            {
                db.AUTHORs.Add(aUTHOR);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(aUTHOR));
        }
        public ActionResult Create([Bind(Include = "ID,PublicationTypeId,NAME,ADDRESS,EMAIL,CONTACT_NO")] PUBLISHER pUBLISHER)
        {
            if (ModelState.IsValid)
            {
                db.PUBLISHERs.Add(pUBLISHER);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.PublicationTypeId = new SelectList(db.PublicationTypes, "ID", "NAME", pUBLISHER.PublicationTypeId);
            return(View(pUBLISHER));
        }
Ejemplo n.º 5
0
        public ActionResult Create([Bind(Include = "ID,MemberTypeId,MEMBERSHIP_ID,MEMBERSHIP_DATE,FIRST_NAME,LAST_NAME,ADDRESS,EMAIL,CONTACT_NO,EDUCATION,REMARKS")] MEMBER mEMBER)
        {
            if (ModelState.IsValid)
            {
                db.MEMBERs.Add(mEMBER);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.MemberTypeId = new SelectList(db.MemberTypes, "ID", "NAME", mEMBER.MemberTypeId);
            return(View(mEMBER));
        }
        public ActionResult Create([Bind(Include = "ID,BOOK_CATEGORY_ID,PUBLISHER_ID,BOOK_NAME,BOOK_SUBJECT,BOOK_DESCRIPTION")] BOOK bOOK)
        {
            if (ModelState.IsValid)
            {
                db.BOOKs.Add(bOOK);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.BOOK_CATEGORY_ID = new SelectList(db.BOOK_CATEGORY, "ID", "NAME", bOOK.BOOK_CATEGORY_ID);
            return(View(bOOK));
        }
Ejemplo n.º 7
0
        public ActionResult Create([Bind(Include = "ID,DATE,BOOK_ID,MEMBER_ID,FINE,REMARKS")] BOOK_RECEIEVED bOOK_RECEIEVED)
        {
            if (ModelState.IsValid)
            {
                db.BOOK_RECEIEVED.Add(bOOK_RECEIEVED);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.BOOK_ID = new SelectList(db.BOOKs, "ID", "BOOK_NAME", bOOK_RECEIEVED.BOOK_ID);
            ViewBag.MEMBER_ID = new SelectList(db.MEMBERs, "ID", "MEMBERSHIP_ID", bOOK_RECEIEVED.MEMBER_ID);
            return View(bOOK_RECEIEVED);
        }
Ejemplo n.º 8
0
        public ActionResult Create([Bind(Include = "ID,ISSUE_DATE,BOOK_ID,MEMBER_ID,NO_OF_DAYS,FINE,REMARKS")] BOOK_ISSUE bOOK_ISSUE)
        {
            if (ModelState.IsValid)
            {
                db.BOOK_ISSUE.Add(bOOK_ISSUE);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.BOOK_ID   = new SelectList(db.BOOKs, "ID", "BOOK_NAME", bOOK_ISSUE.BOOK_ID);
            ViewBag.MEMBER_ID = new SelectList(db.MEMBERs, "ID", "MEMBERSHIP_ID", bOOK_ISSUE.MEMBER_ID);
            return(View(bOOK_ISSUE));
        }
Ejemplo n.º 9
0
        public ActionResult AddIssuedbook(Issued_Books v)
        {
            try
            {
                IssuedBooksVM m = new IssuedBooksVM();
                m.Number      = v.Number;
                m.Email       = v.Email;
                m.Issue_date  = v.Issue_date;
                m.Return_date = v.Return_date;
                m.Due_date    = v.Due_date;
                v.Fine        = Fine(v.Return_date, v.Due_date);
                m.Fine        = v.Fine;
                m.Status      = v.Status;

                LibraryManagementSystemEntities db = new LibraryManagementSystemEntities();
                db.Issued_Books.Add(v);

                db.SaveChanges();

                return(RedirectToAction("IssuedBooks"));
            }
            catch
            {
                return(View());
            }
        }
Ejemplo n.º 10
0
        public ActionResult AddTeacher(tbl_teacher t, Email e)
        {
            try
            {
                LibraryManagementSystemEntities DB = new LibraryManagementSystemEntities();
                Teacher teacher = new Teacher();
                teacher.Name  = t.Name;
                teacher.Email = t.Email;



                e.Email1            = t.Email;
                teacher.Designation = t.Designation;


                DB.tbl_teacher.Add(t);
                DB.Emails.Add(e);

                DB.SaveChanges();



                return(RedirectToAction("Teacher"));
            }
            catch
            {
                return(View());
            }
        }
Ejemplo n.º 11
0
        public ActionResult Editst(int id, Student t)
        {
            LibraryManagementSystemEntities db = new LibraryManagementSystemEntities();

            db.tbl_student.Find(id).Name  = t.Name;
            db.tbl_student.Find(id).Email = t.Email;

            db.tbl_student.Find(id).Registration_Number = t.Registration_Number;
            db.SaveChanges();


            return(RedirectToAction("Student"));
        }
Ejemplo n.º 12
0
        // GET: Admin/Delete/5
        public ActionResult Delete(int id)
        {
            LibraryManagementSystemEntities db = new LibraryManagementSystemEntities();

            foreach (tbl_teacher t1 in db.tbl_teacher)
            {
                if (t1.ID == id)
                {
                    db.tbl_teacher.Remove(t1);
                }
            }
            db.SaveChanges();



            return(View("Teacher"));
        }
Ejemplo n.º 13
0
        public ActionResult Edit(int id, Teacher t)
        {
            {
                LibraryManagementSystemEntities db = new LibraryManagementSystemEntities();
                db.tbl_teacher.Find(id).Name  = t.Name;
                db.tbl_teacher.Find(id).Email = t.Email;

                db.tbl_teacher.Find(id).Designation = t.Designation;
                db.SaveChanges();


                return(RedirectToAction("Teacher"));
            }

            /*catch
             * {
             *  return View();
             * }*/
        }
Ejemplo n.º 14
0
        public ActionResult AddStudent(tbl_student s, Email e)
        {
            try
            {
                Student st = new Student();
                st.Email = s.Email;
                e.Email1 = s.Email;
                st.Name  = s.Name;
                st.Registration_Number = s.Registration_Number;
                LibraryManagementSystemEntities db = new LibraryManagementSystemEntities();
                db.tbl_student.Add(s);
                db.Emails.Add(e);
                db.SaveChanges();

                return(RedirectToAction("Student"));
            }
            catch
            {
                return(View());
            }
        }