示例#1
0
 /// <summary>
 /// Updae CompanyInformation AppService
 /// </summary>
 /// <returns>bool<bool></returns>
 public async Task <bool> UpdateCompanyInformation(CompanyInformationUpdateDTO companyInformationUpdateDTO)
 {
     #region Declare a return type with initial value.
     bool isUpdated = false;
     #endregion
     try
     {
         if (companyInformationUpdateDTO != null)
         {
             isUpdated = await CompanyInformationBusinessMapping.UpdateCompanyInformation(companyInformationUpdateDTO);
         }
     }
     catch (Exception exception) {}
     return(isUpdated);
 }
示例#2
0
        /// <summary>
        /// Update User Action Activity Log
        /// </summary>
        /// <param name=></param>
        /// <returns>bool</returns>
        public async Task <bool> UpdateCompanyInformation(CompanyInformationUpdateDTO CompanyInformationUpdateDTO)
        {
            #region Declare a return type with initial value.
            bool isCompanyInformationUpdated = default(bool);
            #endregion
            try
            {
                if (CompanyInformationUpdateDTO != null)
                {
                    #region Vars
                    CompanyInformation CompanyInformation = null;
                    #endregion
                    #region Get Activity By Id
                    CompanyInformation = await UnitOfWork.CompanyInformationRepository.GetById(CompanyInformationUpdateDTO.CompanyInformationId);

                    #endregion
                    if (CompanyInformation != null)
                    {
                        #region  Mapping
                        CompanyInformation = CompanyInformationMapping.MappingCompanyInformationupdateDTOToCompanyInformation(CompanyInformation, CompanyInformationUpdateDTO);
                        #endregion
                        if (CompanyInformation != null)
                        {
                            #region  Update Entity
                            UnitOfWork.CompanyInformationRepository.Update(CompanyInformation);
                            isCompanyInformationUpdated = await UnitOfWork.Commit() > default(int);

                            #endregion
                        }
                    }
                }
            }
            catch (Exception exception)
            {
            }
            return(isCompanyInformationUpdated);
        }
        public async Task <ActionResult <CommonAPIResponse <bool> > > UpdateCompanyInformation(CompanyInformationUpdateDTO CompanyInformationUpdateDTO)
        {
            #region Declare return type with initial value.
            JsonResult jsonResult = GetDefaultJsonResult <bool>();
            #endregion

            try
            {
                #region Validate userUpdateDTO for nullability before prepaing the response.
                if (await CompanyInformationAppService.UpdateCompanyInformation(CompanyInformationUpdateDTO))
                {
                    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);
        }
 /// <summary>
 /// Mapping User Activity Log DTO to Action
 /// </summary>
 /// <param name=></param>
 /// <param name=></param>
 /// <returns></returns>
 public CompanyInformation MappingCompanyInformationupdateDTOToCompanyInformation(CompanyInformation companyInformation, CompanyInformationUpdateDTO CompanyInformationUpdateDTO)
 {
     #region Declare Return Var with Intial Value
     CompanyInformation CompanyInformation = companyInformation;
     #endregion
     try
     {
         if (CompanyInformationUpdateDTO.CompanyInformationId > default(int))
         {
             CompanyInformation.CompanyInformationId = CompanyInformationUpdateDTO.CompanyInformationId;
             CompanyInformation.CompanyName          = CompanyInformationUpdateDTO.CompanyName;
             CompanyInformation.CompanyPhone         = CompanyInformationUpdateDTO.CompanyPhone;
             CompanyInformation.CompanyProfile       = CompanyInformationUpdateDTO.CompanyProfile;
             CompanyInformation.CompanySizeId        = CompanyInformationUpdateDTO.CompanySizeId;
             CompanyInformation.CompanyTypeId        = (byte)CompanyInformationUpdateDTO.CompanyTypeId;
             CompanyInformation.CompanyWebsite       = CompanyInformationUpdateDTO.CompanyWebsite;
             CompanyInformation.EmployerId           = CompanyInformationUpdateDTO.EmployerId;
             CompanyInformation.Fax              = CompanyInformationUpdateDTO.Fax;
             CompanyInformation.IsMultinational  = (bool)CompanyInformationUpdateDTO.IsMultinational;
             CompanyInformation.IsStartupCompany = (bool)CompanyInformationUpdateDTO.IsStartupCompany;
             CompanyInformation.Specialties      = CompanyInformationUpdateDTO.Specialties;
             CompanyInformation.YearFounded      = (int)CompanyInformationUpdateDTO.YearFounded;
             CompanyInformation.Logo             = CompanyInformationUpdateDTO.Logo;
         }
     }
     catch (Exception exception) { }
     return(CompanyInformation);
 }