Ejemplo n.º 1
0
        public async Task <ActionResult <CommonAPIResponse <TypeOfJobReturnDTO> > > GetTypeOfJobById(int id)
        {
            #region Vars
            TypeOfJobReturnDTO TypeOfJobReturnDTO = null;
            #endregion
            #region Declare return type with initial value.
            JsonResult jsonResult = GetDefaultJsonResult <object>();
            #endregion
            try
            {
                if (id != default(int))
                {
                    TypeOfJobReturnDTO = await TypeOfJobAppService.GetTypeOfJobById(id);
                }

                #region Validate userIdentityDTO for nullability before prepaing the response.
                if (TypeOfJobReturnDTO != null)
                {
                    jsonResult = JsonResultResponse(CommonHelper.GetResponseMessage(APIResponseMessage.Success, CurrentLanguagId), TypeOfJobReturnDTO, HttpStatusCode.OK);
                }
                else
                {
                    jsonResult = JsonResultResponse(CommonHelper.GetResponseMessage(APIResponseMessage.InvalidCredentials, CurrentLanguagId), new object(), HttpStatusCode.BadRequest);
                }
                #endregion
            }
            catch (Exception exception)
            {
            }
            return(jsonResult);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Get  TypeOfJob By Id
 /// </summary>
 /// <returns>TypeOfJobReturnDTO<TypeOfJobReturnDTO></returns>
 public async Task <TypeOfJobReturnDTO> GetTypeOfJobById(int TypeOfJobId)
 {
     #region Declare a return type with initial value.
     TypeOfJobReturnDTO TypeOfJob = null;
     #endregion
     try
     {
         if (TypeOfJobId > default(int))
         {
             TypeOfJob = await TypeOfJobBusinessMapping.GetTypeOfJobById(TypeOfJobId);
         }
     }
     catch (Exception exception)  {}
     return(TypeOfJob);
 }
 public TypeOfJobReturnDTO MappingTypeOfJobToTypeOfJobReturnDTO(TypeOfJob TypeOfJob)
 {
     #region Declare a return type with initial value.
     TypeOfJobReturnDTO TypeOfJobReturnDTO = null;
     #endregion
     try
     {
         if (TypeOfJob != null)
         {
             TypeOfJobReturnDTO = new TypeOfJobReturnDTO
             {
                 TypeOfJobId   = TypeOfJob.TypeOfJobId,
                 TypeOfJobName = TypeOfJob.TypeOfJobName
             };
         }
     }
     catch (Exception exception)
     { }
     return(TypeOfJobReturnDTO);
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Get user Action Activity Log By Id
        /// </summary>
        /// <returns>List<TypeOfJobReturnDTO></returns>
        public async Task <TypeOfJobReturnDTO> GetTypeOfJobById(int TypeOfJobId)
        {
            #region Declare a return type with initial value.
            TypeOfJobReturnDTO TypeOfJob = new TypeOfJobReturnDTO();
            #endregion
            try
            {
                TypeOfJob typeOfJob = await UnitOfWork.TypeOfJobRepository.GetById(TypeOfJobId);

                if (typeOfJob != null)
                {
                    if (typeOfJob.IsDeleted != (byte)DeleteStatusEnum.Deleted)
                    {
                        TypeOfJob = TypeOfJobMapping.MappingTypeOfJobToTypeOfJobReturnDTO(typeOfJob);
                    }
                }
            }
            catch (Exception exception)
            {
            }
            return(TypeOfJob);
        }