예제 #1
0
        public ActionResult Create([Bind(Include = "ID,Content")] Footer footer)
        {
            if (ModelState.IsValid)
            {
                db.Footers.Add(footer);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(footer));
        }
        public ActionResult Create([Bind(Include = "ID,TenPhong,DienTich,ToiDa,DichVuHuyPhong,GiaTien,GomBuaAn,Img,MoTa,KhachSan_ID")] PhongKhachSan phongKhachSan)
        {
            if (ModelState.IsValid)
            {
                db.PhongKhachSans.Add(phongKhachSan);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(phongKhachSan));
        }
예제 #3
0
        public ActionResult Create([Bind(Include = "Username,Password,HoTen")] User user)
        {
            if (ModelState.IsValid)
            {
                db.Users.Add(user);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(user));
        }
예제 #4
0
        public ActionResult Create([Bind(Include = "ID,Img,Description")] Slide slide)
        {
            if (ModelState.IsValid)
            {
                db.Slides.Add(slide);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(slide));
        }
예제 #5
0
        public ActionResult Create([Bind(Include = "IDPhieuDat,Username,NgayDat,TinhTrangThanhToan,HoTen,SoDienThoai,Mail,YeuCauKhac,TinhTrangXuLy")] DatPhong datPhong)
        {
            if (ModelState.IsValid)
            {
                datPhong.IDPhieuDat = Guid.NewGuid();
                db.DatPhongs.Add(datPhong);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(datPhong));
        }
예제 #6
0
        public ActionResult Create([Bind(Include = "ID,TenKhachSan,UnsignedName,DiaChi,XepHang,SoDienThoai,ThongTinLienHe,GiaTien,UuTien,ThongTinMoTa,TienIch,ChinhSach,QuanHuyen_ID,GoogleMap")] KhachSan khachSan)
        {
            if (ModelState.IsValid)
            {
                db.KhachSans.Add(khachSan);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.QuanHuyen_ID = new SelectList(db.QuanHuyens, "ID", "TenQuanHuyen", khachSan.QuanHuyen_ID);
            return(View(khachSan));
        }
예제 #7
0
        public ActionResult Create([Bind(Include = "ID,TenQuanHuyen,ThanhPho_ID")] QuanHuyen quanHuyen)
        {
            if (ModelState.IsValid)
            {
                db.QuanHuyens.Add(quanHuyen);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.ThanhPho_ID = new SelectList(db.ThanhPhoes, "ID", "TenThanhPho", quanHuyen.ThanhPho_ID);
            return(View(quanHuyen));
        }
예제 #8
0
        public ActionResult Create([Bind(Exclude = "NgayDang")] BaiViet baiViet)
        {
            baiViet.NgayDang           = DateTime.Now;
            baiViet.TenBaiVietUnsigned = StringConverter.toUnsignedString(baiViet.TenBaiViet);
            if (ModelState.IsValid)
            {
                db.BaiViets.Add(baiViet);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(baiViet));
        }
예제 #9
0
 public DatPhong Create(DatPhong Order)
 {
     db.DatPhongs.Add(Order);
     db.SaveChanges();
     return(Order);
 }
예제 #10
0
 public bool InsertCity(ThanhPho city)
 {
     db.ThanhPhoes.Add(city);
     db.SaveChanges();
     return(true);
 }