Exemplo n.º 1
0
        /// <summary>
        /// Add company Notes
        /// </summary>
        /// <param name="notes"> The notes</param>
        /// <returns> VTigerCompanyNotes obj </returns>
        public VTigerCompanyNotes CreateNote(CRMCompanyNotes notes)
        {
            try
            {
                VTigerCompanyNotes note = this.vTigerService.AddCompanyNotes(notes.Note, notes.Assigned_User_Id, notes.ContactId, notes.OrganisationId);
                return note;
            }
            catch (Exception ex)
            {
                this.LoggerService.LogException("Adding Notes :- " + ex.Message);
            }

            return new VTigerCompanyNotes();
        }
Exemplo 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);
        }