コード例 #1
0
        // GET: LeaveRequests/Edit/5
        public IActionResult Edit(long?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var leaveRequest = leaveRequestRepository.GetEdit(id);

            if (leaveRequest == null)
            {
                return(NotFound());
            }
            ViewData["LeaveTypeId"] = new SelectList(leaveTypeRepository.GetLeaveTypeList(), "Id", "TypeName", leaveRequest.LeaveTypeId);
            return(View(leaveRequest));
        }
コード例 #2
0
        // GET: LeaveRequests/Edit/5
        public IActionResult Edit(long?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            //var leaveRequest = await _context.LeaveRequests.FindAsync(id);
            var leaveRequest = leaveRequestRepository.GetEdit(id);

            if (leaveRequest == null)
            {
                return(NotFound());
            }
            ViewData["LeaveTypeId"] = new SelectList(leaveTypeRepository.GetLeaveTypeList(), "Id", "Id", leaveRequest.LeaveTypeId);
            return(View(leaveRequest));
        }