Beispiel #1
0
        public ActionResult ChangePassword(string id, FormCollection collection)
        {
            PLStudent student = StudentClientService.GetStudentDetail(id);//new PLStudent();

            if (collection.Count == 0)
            {
                return(View("ChangePassword", student));
            }

            try
            {
                //PLStudent student = StudentClientService.GetStudentDetail(collection["ID"]);//new PLStudent();
                student.Password = collection["Password"];
                StudentClientService.UpdateStudent(student);
                return(RedirectToAction("Index"));// this brings us to the student List page
            }
            catch (Exception e)
            {
                Console.Write(e.ToString());
                return(RedirectToAction("Error"));
            }
            //return View("ChangePassword", student);
        }
Beispiel #2
0
 public ActionResult Edit(string id, FormCollection collection)
 {
     try
     {
         PLStudent student = new PLStudent();
         student.ID           = id;//collection["ID"];
         student.FirstName    = collection["FirstName"];
         student.LastName     = collection["LastName"];
         student.SSN          = collection["SSN"];
         student.EmailAddress = collection["EmailAddress"];
         student.Password     = collection["Password"];
         student.ShoeSize     = float.Parse(collection["ShoeSize"]);
         student.Weight       = Convert.ToInt32(collection["Weight"]);
         student.StudentLevel = collection["StudentLevel"];
         student.Major        = Convert.ToInt32(collection["Major"]);
         student.Status       = Convert.ToInt32(collection["Status"]);
         StudentClientService.UpdateStudent(student);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View("Error"));
     }
 }