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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
public DatPhong Create(DatPhong Order) { db.DatPhongs.Add(Order); db.SaveChanges(); return(Order); }
public bool InsertCity(ThanhPho city) { db.ThanhPhoes.Add(city); db.SaveChanges(); return(true); }