示例#1
0
 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));
 }
示例#2
0
        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());
        }
示例#3
0
 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());
 }