public async Task <IActionResult> Edit(int id, [Bind("PkUserId,Fname,Lname,Email,Contact,Pswd,Dob,CreatedDate,FkRoleId,IsActive,IsDeleted")] MstUser mstUser) { if (id != mstUser.PkUserId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(mstUser); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MstUserExists(mstUser.PkUserId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(mstUser)); }
public async Task <IActionResult> Edit(int id, [Bind("PkDeptId,DepartmentName,IsActive")] MstDepartment mstDepartment) { if (id != mstDepartment.PkDeptId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(mstDepartment); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MstDepartmentExists(mstDepartment.PkDeptId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(mstDepartment)); }
public async Task <IActionResult> Edit(int id, [Bind("PkAdminId,EmployeeId,FirstName,LastName,DateOfBirth,Email,Contact,Pswd,Address,FatherName,CreatedDate,IsActive,IsDeleted")] AdminDetail adminDetail) { if (id != adminDetail.PkAdminId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(adminDetail); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AdminDetailExists(adminDetail.PkAdminId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(adminDetail)); }
public async Task <IActionResult> Edit(int id, [Bind("PkSubjectId,FkSemId,SubjectName,IsActive")] MstSubject mstSubject) { if (id != mstSubject.PkSubjectId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(mstSubject); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MstSubjectExists(mstSubject.PkSubjectId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["FkSemId"] = new SelectList(_context.MstSemesters, "PkSemId", "PkSemId", mstSubject.FkSemId); return(View(mstSubject)); }
public async Task <IActionResult> Edit(int id, [Bind("PkMarksId,FkSemId,FkStudId,FkSubId,SessionalMarks,MainExamMarks,TotalMarks")] MarksDetail marksDetail) { if (id != marksDetail.PkMarksId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(marksDetail); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!MarksDetailExists(marksDetail.PkMarksId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["FkSemId"] = new SelectList(_context.MstSemesters, "PkSemId", "PkSemId", marksDetail.FkSemId); ViewData["FkStudId"] = new SelectList(_context.StudentDetails, "PkStudentId", "Contact", marksDetail.FkStudId); ViewData["FkSubId"] = new SelectList(_context.MstSubjects, "PkSubjectId", "PkSubjectId", marksDetail.FkSubId); return(View(marksDetail)); }
public async Task <IActionResult> Edit(int id, [Bind("PkFacultyId,FacultyId,FirstName,LastName,DateOfBirth,Address,Email,Contact,Pswd,FkDeptId,FatherName,CreatedDate,IsActive,IsDeleted")] FacultyDetail facultyDetail) { if (id != facultyDetail.PkFacultyId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(facultyDetail); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FacultyDetailExists(facultyDetail.PkFacultyId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["FkDeptId"] = new SelectList(_context.MstDepartments, "PkDeptId", "PkDeptId", facultyDetail.FkDeptId); return(View(facultyDetail)); }
public async Task <IActionResult> Edit(int id, [Bind("PkAttndId,FkStudId,Attendance,CreatedDate")] AttendanceDetail attendanceDetail) { if (id != attendanceDetail.PkAttndId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(attendanceDetail); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AttendanceDetailExists(attendanceDetail.PkAttndId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["FkStudId"] = new SelectList(_context.StudentDetails, "PkStudentId", "Contact", attendanceDetail.FkStudId); return(View(attendanceDetail)); }
public async Task <IActionResult> Edit(int id, [Bind("PkStudentId,EnrollId,Email,FirstName,LastName,DateOfBirth,Contact,Address,Pswd,Course,FatherName,CreatedDate,IsActive,IsDeleted,PProfilepic,studentPic")] StudentDetail studentDetail) { if (id != studentDetail.PkStudentId) { return(NotFound()); } if (studentDetail.PProfilepic != null) { string wwwRootPath = hostEnvironment.WebRootPath; string fileName = Path.GetFileNameWithoutExtension(studentDetail.PProfilepic.FileName); string ext = Path.GetExtension(studentDetail.PProfilepic.FileName); studentDetail.studentPic = fileName + DateTime.Now.ToString("yymmssff") + ext; string path = Path.Combine(wwwRootPath + "/images/", studentDetail.studentPic); using (var filestrem = new FileStream(path, FileMode.Create)) { await studentDetail.PProfilepic.CopyToAsync(filestrem); } } if (ModelState.IsValid) { try { _context.Update(studentDetail); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!StudentDetailExists(studentDetail.PkStudentId)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Myprofilee", "StudentDetails")); } return(RedirectToAction("Myprofilee", "StudentDetails")); }