public ActionResult Create([Bind(Include = "TenDK,CMND,DiaChi,SDT,TenCongTy,DsLoaiPhong,DsPhong")] TestDK thuePhong) { if (ModelState.IsValid) { return(RedirectToAction("Index")); } ViewBag.loaiphong = SetViewBag(); return(View(thuePhong)); }
public ActionResult Index(LOAIPHONG loaiphong, TestDK test) { if (ModelState.IsValid) { ViewBag.var1 = new SelectList(cc.LoadLoaiPhong(), "ID", "TEN");// load loai phong len ViewBag.var2 = new SelectList(cc.LoadPhong(), "ID", "TENPHONG"); ViewBag.id = new SelectList(loaiPhong, "id", "tenPhong", loaiphong.ID); idMaPhieu = cc.DangKi(test.CMND, test.TenDK, test.DiaChi, test.SDT, test.TenCongTy); return(Redirect("Step2")); } return(View()); }
public ActionResult Edit([Bind(Include = "TenDK,CMND,DiaChi,SDT,TenCongTy,DsLoaiPhong,DsPhong")] TestDK thuePhong) { if (ModelState.IsValid) { //db.Entry(thuePhong).State = EntityState.Modified; //db.SaveChanges(); return(RedirectToAction("Index")); } ///ViewBag.idKhach = new SelectList(db.KhachHangs, "id", "ten", thuePhong.idKhach); ///ViewBag.idPhong = new SelectList(db.phongs, "id", "tenPhong", thuePhong.idPhong); ///return View(thuePhong); return(View()); }