public async Task <IActionResult> Edit(int id, [Bind("ComplicationID,ComplicationName,ComplicationInfo")] Complication complication)
        {
            if (id != complication.ComplicationID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(complication);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ComplicationExists(complication.ComplicationID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(complication));
        }
예제 #2
0
        public async Task <IActionResult> Edit(int id, [Bind("FieldID,FieldName,VCID")] Field @field)
        {
            if (id != @field.FieldID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(@field);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!FieldExists(@field.FieldID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["VCID"] = new SelectList(_context.VillageCouncils, "VillageCouncilID", "VCName", @field.VCID);
            return(View(@field));
        }
예제 #3
0
        public async Task <IActionResult> Edit(int id, [Bind("ShareID,ShareName,FiledID,ShareArea,ShareRealArea,ShareCN,ComplicationID")] Share share)
        {
            if (id != share.ShareID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(share);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ShareExists(share.ShareID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ComplicationID"] = new SelectList(_context.Complications, "ComplicationID", "ComplicationID", share.ComplicationID);
            return(View(share));
        }
예제 #4
0
        public async Task <IActionResult> Edit(int id, [Bind("ContractID,ShareID,LLID,ContractBegin,ContractEnd")] Contract contract)
        {
            if (id != contract.ContractID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(contract);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ContractExists(contract.ContractID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["LLID"]    = new SelectList(_context.LandLords, "LandLordID", "LLName", contract.LLID);
            ViewData["ShareID"] = new SelectList(_context.Shares, "ShareID", "ShareName", contract.ShareID);
            return(View(contract));
        }
예제 #5
0
        public async Task <IActionResult> Edit(int id, [Bind("LandLordID,LLName,LLPassID,LLPhone,LLAdress")] LandLord landLord)
        {
            if (id != landLord.LandLordID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(landLord);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!LandLordExists(landLord.LandLordID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(landLord));
        }