コード例 #1
0
        public async Task <ActionResult <CommonAPIResponse <IndustryReturnDTO> > > GetIndustryById(int id)
        {
            #region Vars
            IndustryReturnDTO IndustryReturnDTO = null;
            #endregion
            #region Declare return type with initial value.
            JsonResult jsonResult = GetDefaultJsonResult <object>();
            #endregion
            try
            {
                if (id != default(int))
                {
                    IndustryReturnDTO = await IndustryAppService.GetIndustryById(id);
                }

                #region Validate userIdentityDTO for nullability before prepaing the response.
                if (IndustryReturnDTO != null)
                {
                    jsonResult = JsonResultResponse(CommonHelper.GetResponseMessage(APIResponseMessage.Success, CurrentLanguagId), IndustryReturnDTO, HttpStatusCode.OK);
                }
                else
                {
                    jsonResult = JsonResultResponse(CommonHelper.GetResponseMessage(APIResponseMessage.InvalidCredentials, CurrentLanguagId), new object(), HttpStatusCode.BadRequest);
                }
                #endregion
            }
            catch (Exception exception)
            {
            }
            return(jsonResult);
        }
コード例 #2
0
 /// <summary>
 /// Get  Industry By Id
 /// </summary>
 /// <returns>IndustryReturnDTO<IndustryReturnDTO></returns>
 public async Task <IndustryReturnDTO> GetIndustryById(int IndustryId)
 {
     #region Declare a return type with initial value.
     IndustryReturnDTO Industry = null;
     #endregion
     try
     {
         if (IndustryId > default(int))
         {
             Industry = await IndustryBusinessMapping.GetIndustryById(IndustryId);
         }
     }
     catch (Exception exception)  {}
     return(Industry);
 }
コード例 #3
0
 public IndustryReturnDTO MappingIndustryToIndustryReturnDTO(Industry Industry)
 {
     #region Declare a return type with initial value.
     IndustryReturnDTO IndustryReturnDTO = null;
     #endregion
     try
     {
         if (Industry != null)
         {
             IndustryReturnDTO = new IndustryReturnDTO
             {
                 IndustryId   = Industry.IndustryId,
                 IndustryName = Industry.IndustryName
             };
         }
     }
     catch (Exception exception)
     {}
     return(IndustryReturnDTO);
 }
コード例 #4
0
        /// <summary>
        /// Get user Action Activity Log By Id
        /// </summary>
        /// <returns>List<IndustryReturnDTO></returns>
        public async Task <IndustryReturnDTO> GetIndustryById(int IndustryId)
        {
            #region Declare a return type with initial value.
            IndustryReturnDTO Industry = new IndustryReturnDTO();
            #endregion
            try
            {
                Industry industry = await UnitOfWork.IndustryRepository.GetById(IndustryId);

                if (industry != null)
                {
                    if (industry.IsDeleted != (byte)DeleteStatusEnum.Deleted)
                    {
                        Industry = IndustryMapping.MappingIndustryToIndustryReturnDTO(industry);
                    }
                }
            }
            catch (Exception exception)
            {
            }
            return(Industry);
        }