Esempio n. 1
0
 public ActionResult Edit([Bind(Include = "RoleId,RoleName")] Roles roles)
 {
     if (ModelState.IsValid)
     {
         db.Entry(roles).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(roles));
 }
 public ActionResult Edit([Bind(Include = "FacultyId,FacultyName,Email,Address,PhoneNumber,IsDelete,IsActive,LastUpdate")] Faculties faculties)
 {
     faculties.LastUpdate = DateTime.Now;
     if (ModelState.IsValid)
     {
         db.Entry(faculties).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(faculties));
 }
 public ActionResult Edit([Bind(Include = "ClassCode,ClassName,LastUpdate,IsDelete,IsActive,SpecializationId")] Classes classes)
 {
     classes.LastUpdate = DateTime.Now;
     if (ModelState.IsValid)
     {
         db.Entry(classes).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.SpecializationId = new SelectList(db.Specializations, "SpecializationId", "SpecializationName", classes.SpecializationId);
     return(View(classes));
 }
 public ActionResult Edit([Bind(Include = "TeacherCode,TeacherName,Position,PhoneNumber,Note,LastUpdate,GuideStudent,SpecializationId")] Teachers teachers)
 {
     teachers.LastUpdate = DateTime.Now;
     if (ModelState.IsValid)
     {
         db.Entry(teachers).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.SpecializationId = new SelectList(db.Specializations, "SpecializationId", "SpecializationName", teachers.SpecializationId);
     return(View(teachers));
 }
Esempio n. 5
0
 public ActionResult Edit([Bind(Include = "IndustryId,IndustryName,IsDelete,IsActive,LastUpdate,DepartmentId")] Industries industries)
 {
     industries.LastUpdate = DateTime.Now;
     if (ModelState.IsValid)
     {
         db.Entry(industries).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.DepartmentId = new SelectList(db.Departments, "DepartmentId", "DepartmentName", industries.DepartmentId);
     return(View(industries));
 }
 public ActionResult Edit([Bind(Include = "DepartmentId,DepartmentName,Email,Address,PhoneNumber,IsDelete,IsActive,LastUpdate,FacultyId")] Departments departments)
 {
     departments.LastUpdate = DateTime.Now;
     if (ModelState.IsValid)
     {
         db.Entry(departments).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.FacultyId = new SelectList(db.Faculties, "FacultyId", "FacultyName", departments.FacultyId);
     return(View(departments));
 }
 public ActionResult Edit([Bind(Include = "SpecializationId,SpecializationName,IsDelete,IsActive,LastUpdate,IndustryId")] Specializations specializations)
 {
     specializations.LastUpdate = DateTime.Now;
     if (ModelState.IsValid)
     {
         db.Entry(specializations).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.IndustryId = new SelectList(db.Industries, "IndustryId", "IndustryName", specializations.IndustryId);
     return(View(specializations));
 }
 public ActionResult Edit([Bind(Include = "StudentCode,StudentName,Note,LastUpdate,PhoneNumber,ClassCode")] Students students)
 {
     students.LastUpdate = DateTime.Now;
     if (ModelState.IsValid)
     {
         db.Entry(students).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ClassCode = new SelectList(db.Classes, "ClassCode", "ClassName", students.ClassCode);
     return(View(students));
 }
 public ActionResult Edit([Bind(Include = "EnrollmentId,LastUpdate,StudentCode,TeacherCode")] Enrollment enrollment)
 {
     enrollment.LastUpdate = DateTime.Now;
     if (ModelState.IsValid)
     {
         db.Entry(enrollment).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.StudentCode = new SelectList(db.Students, "StudentCode", "StudentName", enrollment.StudentCode);
     ViewBag.TeacherCode = new SelectList(db.Teachers, "TeacherCode", "TeacherName", enrollment.TeacherCode);
     return(View(enrollment));
 }
Esempio n. 10
0
        public ActionResult Edit([Bind(Include = "AccountId,UserName,Email,Password,ConfirmPassword,RoleId,StudentCode,TeacherCode")] Accounts accounts)
        {
            string strMD5 = strPro.GetMD5(accounts.Password);

            if (accounts.Password == accounts.ConfirmPassword)
            {
                accounts.Password        = strMD5;
                accounts.ConfirmPassword = strMD5;
            }
            if (ModelState.IsValid)
            {
                db.Entry(accounts).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            ViewBag.RoleId      = new SelectList(db.Roles, "RoleId", "RoleName", accounts.RoleId);
            ViewBag.StudentCode = new SelectList(db.Students, "StudentCode", "StudentName", accounts.StudentCode);
            ViewBag.TeacherCode = new SelectList(db.Teachers, "TeacherCode", "TeacherName", accounts.TeacherCode);
            return(View(accounts));
        }