Exemplo n.º 1
0
        public ActionResult Create([Bind(Include = "MaTheLoai, TenTheLoai, GhiChu")] TheLoai obj)
        {
            if (ModelState.IsValid)
            {
                db.TheLoais.Add(obj);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(obj));
        }
Exemplo n.º 2
0
        public ActionResult Create([Bind(Include = "MaSach, TenSach, MaTacGia, MaTheLoai, MaNXB, NamXuatBan, TinhTrang")] Sach obj)
        {
            if (ModelState.IsValid)
            {
                db.Saches.Add(obj);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(obj));
        }
Exemplo n.º 3
0
        public ActionResult Create([Bind(Include = "MaNXB, TenNXB, DiaChi, Email, SoDT, GhiChu")] NhaXuatBan obj)
        {
            if (ModelState.IsValid)
            {
                db.NhaXuatBans.Add(obj);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(obj));
        }
Exemplo n.º 4
0
        public ActionResult Create([Bind(Include = "MaDocGia, TenDocGia, DonVi, SoDT, DiaChi, CMT, MaSoThe")] DocGia obj, [Bind(Include = "MaSoThe, NgayCap, NgayHetHan, GhiChu")] TheThuVien obj2)
        {
            if (ModelState.IsValid)
            {
                db.TheThuViens.Add(obj2);
                db.DocGias.Add(obj);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(obj));
        }
Exemplo n.º 5
0
        public ActionResult Create([Bind(Include = "MaMuonTra, MaSoThe, MaSach, NgayMuonSach, HanTraSach, TinhTrangKhiMuon, DaTra, NgayTraSach, TinhTrangKhiTra, GhiChu")] MuonTraSach obj)
        {
            if (ModelState.IsValid)
            {
                obj.DaTra = false;
                db.MuonTraSaches.Add(obj);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(obj));
        }