Ejemplo n.º 1
0
        /// <summary>
        /// Saves the company note.
        /// </summary>
        /// <param name="companyNote">The company note.</param>
        /// <returns>CompanyNotesDto object.</returns>
        public CompanyNotesDto SaveCompanyNote(CompanyNotesDto companyNote)
        {
            try
            {
                CompanyNotes note = this.mapperFactory.GetMapper<CompanyNotesDto, CompanyNotes>().Map(companyNote);
                this.companyNotesRepository.Insert(note);
                this.companyNotesRepository.Commit();

               //// companyNote.Id = note.Id;
            }
            catch (Exception ex)
            {
                this.LoggerService.LogException("SaveCompanyNote - " + ex.Message);
            }

            return companyNote;
        }
Ejemplo n.º 2
0
        public async Task<IHttpActionResult> SaveCompanyNote(CompanyNotesDto note)
        {
            string companyId = User.Identity.GetUserId();

            List<ApplicationUserDto> appUsers = this.userService.GetUsers(note.UserId, companyId);
            string contactId = appUsers.Where(x => x.Id == note.UserId).Select(x => x.CRMId).First().ToString();
            string organisationId = appUsers.Where(x => x.Id == companyId).Select(x => x.CRMId).First().ToString();

            CRMCompanyNotes notes = new CRMCompanyNotes()
            {
                Note = note.NoteText,
                OrganisationId = organisationId,
                ContactId = contactId
            };

            notes = this.crmManagerService.AddCompanyNote(notes);
            note.Id = notes.Id;
            return this.Ok(note);
        }