コード例 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("did,dname,dphone,daddress,dgender,demail,dpassword,ddate_of_brith,dqualification,VillageId")] Doctor doctor)
        {
            if (id != doctor.did)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(doctor);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DoctorExists(doctor.did))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(doctor));
        }
コード例 #2
0
        public async Task <IActionResult> Edit(int id, [Bind("pid,pname,pphone,paddress,pgender,pweight,phight,pbmi,pbmr,pbp,pdate_of_brith,ppassword")] Patient patient)
        {
            if (id != patient.pid)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(patient);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PatientExists(patient.pid))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(patient));
        }
コード例 #3
0
        public async Task <IActionResult> Edit(int id, [Bind("VillageId,VillageName,District")] VillageDetails villageDetails)
        {
            if (id != villageDetails.VillageId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(villageDetails);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!VillageDetailsExists(villageDetails.VillageId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(villageDetails));
        }
コード例 #4
0
        public async Task <IActionResult> Edit(int id, [Bind("mid,mname,minfo")] test test)
        {
            if (id != test.mid)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(test);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!testExists(test.mid))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(test));
        }
コード例 #5
0
        public async Task <IActionResult> Edit(int id, [Bind("aid,aname,aphone,aaddress,agender,aemail,apassword,adate_of_brith")] AdminMediCare adminMediCare)
        {
            if (id != adminMediCare.aid)
            {
                return(NotFound());
            }

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