Exemplo n.º 1
0
        /// <summary>
        /// Method to send the request to Notes resource for the record insertion.
        /// </summary>
        /// <param name="objVid">Filled Notes Entity</param>
        /// <returns>Object containing the Identity or Error Message</returns>
        public void SaveNote(Note objNote)
        {
            NotesResource objNotesManager = new NotesResource();
            TributeResource objTributeResource = new TributeResource();
            Tributes objTribute = new Tributes();
            object[] param = { objNote };
            object noteId = objNotesManager.InsertDataAndReturnId(param);
            objNote.NotesId = int.Parse(noteId.ToString());
            //to send email
            objTribute.TributeId = int.Parse(objNote.UserTributeId.ToString());
            objTribute.TypeDescription = objNote.ModuleTypeName;
            object[] paramMail = { objTribute };
            List<UserInfo> objUser = objTributeResource.GetTributeAdministrators(paramMail);
            if (objUser.Count > 0)
            {
                SendEmail(objUser, objNote);
            }

            //Function to send the mail to the list of users who have added the Tribute in their list of favourites
            List<UserInfo> objUserFav = objTributeResource.GetFavouriteTributeUsers(paramMail);
            if (objUserFav.Count > 0)
            {
                //As per discussion with Rupendra: will send the mail in "To" field.
                //ie a comma separated list of users in the "to" field
                SendEmail(objUserFav, objNote);
            }
        }