public ActionResult Edit([Bind(Include = "LecturerID,Firstname,LastName")] Lecturer lecturer, string password)
 {
     if (ModelState.IsValid)
     {
         lecturer.L_Password      = EncryptionDll.EncryptData(password, "ffhhgfgh");
         db.Entry(lecturer).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("ViewTest"));
     }
     return(View(lecturer));
 }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "StudentNumber,Age,Firstname,LastName")] Student student, string password)
 {
     if (ModelState.IsValid)
     {
         student.S_Password      = EncryptionDll.EncryptData(password, "ffhhgfgh");
         db.Entry(student).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("StudentViewMarks"));
     }
     return(View(student));
 }