コード例 #1
0
        public async Task <ActionResult> Edit([Bind(Include = "Id,FirstName,LastName,Age,Email,Password,Information,Location")] DoctorEntity doctorEntity)
        {
            if (ModelState.IsValid)
            {
                db.Entry(doctorEntity).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(doctorEntity));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "Id,PharmacyName,Address,PhoneNo,Email")] Register register)
 {
     if (ModelState.IsValid)
     {
         register.PharmacyName    = security.Encrypt(register.PharmacyName);
         register.Address         = security.Encrypt(register.Address);
         register.Email           = security.Encrypt(register.Email);
         register.PhoneNo         = security.Encrypt(register.PhoneNo);
         db.Entry(register).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Message = "Update Values Successfully";
     return(View(register));
 }