public async Task <IActionResult> Edit(int id, [Bind("CustomerID,Name,Age,BirthDay,Sex,ProvinceID,DistrictID,Identify,Phone,Email,MetaTitle")] Customer customer)
        {
            if (id != customer.CustomerID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(customer);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CustomerExists(customer.CustomerID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View(customer));
        }
        public async Task <IActionResult> Edit(int id, [Bind("RoomID,Name,Image,TypeID,PriceID,Capacity,Floor,MetaTiTle,Status")] Room room)
        {
            if (id != room.RoomID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(room);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RoomExists(room.RoomID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            ViewData["PriceID"] = new SelectList(_context.Price, "PriceID", "Price1", room.PriceID);
            ViewData["TypeID"]  = new SelectList(_context.Type, "TypeID", "Name", room.TypeID);
            return(View(room));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ConstractID,Name,RoomID,CustomerID,NumOfMonth,BeginDate,EndDate,MetaTitle,Status")] Contract contract)
        {
            if (id != contract.ConstractID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(contract);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ContractExists(contract.ConstractID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            ViewData["CustomerID"] = new SelectList(_context.Customer, "CustomerID", "Name", contract.CustomerID);
            ViewData["RoomID"]     = new SelectList(_context.Room, "RoomID", "Name", contract.RoomID);
            return(View(contract));
        }