コード例 #1
0
        public async Task <IActionResult> GetTimeTableDetailsForStaffAsync([FromBody] GetTimeTableAc getTimeTableAc)
        {
            if (!getTimeTableAc.StaffId.HasValue || getTimeTableAc.StaffId.Value == 0)
            {
                return(BadRequest(new ApiServiceResponse()
                {
                    Status = -100, Message = "Staff Id can't be empty"
                }));
            }
            else
            {
                StaffBasicPersonalInformation staff = await _iMSDbContext.StaffBasicPersonalInformation.FirstOrDefaultAsync(x => x.Id == getTimeTableAc.StaffId.Value);

                if (staff == null)
                {
                    return(NotFound(new ApiServiceResponse()
                    {
                        Status = -100, Message = "Staff not found"
                    }));
                }

                AddTimeTableAc timeTableDetails =
                    await _timeTableManagementRepository.GetTimeTableForStaffAsync(getTimeTableAc.ClassId, getTimeTableAc.SectionId, getTimeTableAc.StaffId.Value, getTimeTableAc.AcademicYearId, getTimeTableAc.InstituteId);

                return(Ok(new ApiServiceResponse {
                    Status = 200, Message = "Success", ResultObj = timeTableDetails
                }));
            }
        }
コード例 #2
0
        public async Task <IActionResult> GetTimeTableDetailsAsync([FromBody] GetTimeTableAc getTimeTableAc)
        {
            AddTimeTableAc timeTableDetails = await _timeTableManagementRepository.GetTimeTableDetailsAsync(getTimeTableAc.ClassId, getTimeTableAc.SectionId, getTimeTableAc.AcademicYearId, getTimeTableAc.InstituteId);

            return(Ok(new ApiServiceResponse {
                Status = 200, Message = "Success", ResultObj = timeTableDetails
            }));
        }