public async Task <ActionResult <CommonAPIResponse <CompanyTypeReturnDTO> > > GetCompanyTypeById(int id)
        {
            #region Vars
            CompanyTypeReturnDTO CompanyTypeReturnDTO = null;
            #endregion
            #region Declare return type with initial value.
            JsonResult jsonResult = GetDefaultJsonResult <object>();
            #endregion
            try
            {
                if (id != default(int))
                {
                    CompanyTypeReturnDTO = await CompanyTypeAppService.GetCompanyTypeById(id);
                }

                #region Validate userIdentityDTO for nullability before prepaing the response.
                if (CompanyTypeReturnDTO != null)
                {
                    jsonResult = JsonResultResponse(CommonHelper.GetResponseMessage(APIResponseMessage.Success, CurrentLanguagId), CompanyTypeReturnDTO, HttpStatusCode.OK);
                }
                else
                {
                    jsonResult = JsonResultResponse(CommonHelper.GetResponseMessage(APIResponseMessage.InvalidCredentials, CurrentLanguagId), new object(), HttpStatusCode.BadRequest);
                }
                #endregion
            }
            catch (Exception exception)
            {
            }
            return(jsonResult);
        }
Пример #2
0
 /// <summary>
 /// Get  CompanyType By Id
 /// </summary>
 /// <returns>CompanyTypeReturnDTO<CompanyTypeReturnDTO></returns>
 public async Task <CompanyTypeReturnDTO> GetCompanyTypeById(int CompanyTypeId)
 {
     #region Declare a return type with initial value.
     CompanyTypeReturnDTO CompanyType = null;
     #endregion
     try
     {
         if (CompanyTypeId > default(int))
         {
             CompanyType = await CompanyTypeBusinessMapping.GetCompanyTypeById(CompanyTypeId);
         }
     }
     catch (Exception exception)  {}
     return(CompanyType);
 }
Пример #3
0
 /// <summary>
 /// Get user Action Activity Log By Id
 /// </summary>
 /// <returns>List<CompanyTypeReturnDTO></returns>
 public async Task<CompanyTypeReturnDTO> GetCompanyTypeById(int CompanyTypeId)
 {
     #region Declare a return type with initial value.
     CompanyTypeReturnDTO CompanyType = new CompanyTypeReturnDTO();
     #endregion
     try
     {
         CompanyType companyType = await UnitOfWork.CompanyTypeRepository.GetById(CompanyTypeId);
         if (companyType != null)
         {
             if (companyType.IsDeleted  != (byte)DeleteStatusEnum.Deleted)
                 CompanyType = CompanyTypeMapping.MappingCompanyTypeToCompanyTypeReturnDTO(companyType);
         }
     }
     catch (Exception exception)
     {
          
     }
     return CompanyType;
 }
Пример #4
0
 public CompanyTypeReturnDTO MappingCompanyTypeToCompanyTypeReturnDTO(CompanyType CompanyType)
 {
     #region Declare a return type with initial value.
     CompanyTypeReturnDTO CompanyTypeReturnDTO = null;
     #endregion
     try
     {
         if (CompanyType != null)
         {
             CompanyTypeReturnDTO = new CompanyTypeReturnDTO
             {
                 CompanyTypeId   = CompanyType.CompanyTypeId,
                 CompanyTypeName = CompanyType.CompanyTypeName
             };
         }
     }
     catch (Exception exception)
     { }
     return(CompanyTypeReturnDTO);
 }