/// <summary>
 /// Add CompanyOnlinePresence AppService
 /// </summary>
 /// <returns>bool<bool></returns>
 public async Task <bool> AddCompanyOnlinePresence(CompanyOnlinePresenceAddDTO companyOnlinePresenceAddDTO)
 {
     #region Declare a return type with initial value.
     bool isCreated = false;
     #endregion
     try
     {
         if (companyOnlinePresenceAddDTO != null)
         {
             isCreated = await CompanyOnlinePresenceBusinessMapping.AddCompanyOnlinePresence(companyOnlinePresenceAddDTO);
         }
     }
     catch (Exception exception) {}
     return(isCreated);
 }
        /// <summary>
        /// Create User Action Activity Log
        /// </summary>
        /// <param name=></param>
        /// <returns>bool</returns>
        public async Task <bool> AddCompanyOnlinePresence(CompanyOnlinePresenceAddDTO CompanyOnlinePresenceAddDTO)
        {
            #region Declare a return type with initial value.
            bool isCompanyOnlinePresenceCreated = default(bool);
            #endregion
            try
            {
                #region Vars
                CompanyOnlinePresence CompanyOnlinePresence = null;
                #endregion
                CompanyOnlinePresence = CompanyOnlinePresenceMapping.MappingCompanyOnlinePresenceAddDTOToCompanyOnlinePresence(CompanyOnlinePresenceAddDTO);
                if (CompanyOnlinePresence != null)
                {
                    await UnitOfWork.CompanyOnlinePresenceRepository.Insert(CompanyOnlinePresence);

                    isCompanyOnlinePresenceCreated = await UnitOfWork.Commit() > default(int);
                }
            }
            catch (Exception exception)
            {
            }
            return(isCompanyOnlinePresenceCreated);
        }
Ejemplo n.º 3
0
        public async Task <ActionResult <CommonAPIResponse <bool> > > AddCompanyOnlinePresence(CompanyOnlinePresenceAddDTO CompanyOnlinePresenceAddDTO)
        {
            #region Declare return type with initial value.
            JsonResult jsonResult = GetDefaultJsonResult <bool>();
            #endregion

            try
            {
                #region Validate AddCompanyOnlinePresence for nullability before prepaing the response.

                if (await CompanyOnlinePresenceAppService.AddCompanyOnlinePresence(CompanyOnlinePresenceAddDTO))
                {
                    jsonResult = JsonResultResponse(CommonHelper.GetResponseMessage(APIResponseMessage.Success, CurrentLanguagId), true, HttpStatusCode.OK);
                }
                else
                {
                    jsonResult = JsonResultResponse(CommonHelper.GetResponseMessage(APIResponseMessage.InvalidCredentials, CurrentLanguagId), false, HttpStatusCode.BadRequest);
                }
                #endregion
            }
            catch (Exception exception)
            {
            }
            return(jsonResult);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Mapping user Action Actitvity Log
 /// </summary>
 /// <param name=></ param >
 /// <returns>Task<CompanyOnlinePresence></returns>
 public CompanyOnlinePresence MappingCompanyOnlinePresenceAddDTOToCompanyOnlinePresence(CompanyOnlinePresenceAddDTO CompanyOnlinePresenceAddDTO)
 {
     #region Declare a return type with initial value.
     CompanyOnlinePresence CompanyOnlinePresence = null;
     #endregion
     try
     {
         CompanyOnlinePresence = new CompanyOnlinePresence
         {
             CompanyInformationId = (int)CompanyOnlinePresenceAddDTO.CompanyInformationId,
             Blog         = CompanyOnlinePresenceAddDTO.Blog,
             Facebook     = CompanyOnlinePresenceAddDTO.Facebook,
             LinkedIn     = CompanyOnlinePresenceAddDTO.LinkedIn,
             Twitter      = CompanyOnlinePresenceAddDTO.Twitter,
             CreationDate = DateTime.Now,
             IsDeleted    = (byte)DeleteStatusEnum.NotDeleted
         };
     }
     catch (Exception exception) { }
     return(CompanyOnlinePresence);
 }