public void SendPhotoEmail(List<Photos> objPhotoList)
        {
            //to send mail
            TributeResource objTribute = new TributeResource();
            Tributes objTrib = new Tributes();
            objTrib.TributeId = int.Parse(objPhotoList[0].UserTributeId.ToString());
            objTrib.TypeDescription = objPhotoList[0].ModuleTypeName;
            object[] paramTrib = { objTrib };
            List<UserInfo> objUser = objTribute.GetTributeAdministrators(paramTrib);
            if (objUser.Count > 0)
            {
                Photos objPhoto = objPhotoList[objPhotoList.Count - 1];
                SendEmail(objUser, "Photo", objPhoto);
            }

            //Function to send the mail to the list of users who have added the Tribute in their list of favourites
            List<UserInfo> objUserFav = objTribute.GetFavouriteTributeUsers(paramTrib);
            if (objUserFav.Count > 0)
            {
                Photos objPhoto = objPhotoList[objPhotoList.Count - 1];
                //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, "Photo", objPhoto);
            }
        }
        /// <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);
            }
        }
        public bool SaveVideoTributeAndSendEmail(Videos objVid, string type)
        {
            object objIdentity = null;
            bool videocaptionexist = false;
            try
            {
                VideoResource objVideo = new VideoResource();
                object[] param = { objVid };
                //objVideo.InsertRecord(param);
                object objVideoId = objVideo.InsertDataAndReturnId(param);
                if (objVideoId != null)
                {
                    objVid.VideoId = int.Parse(objVideoId.ToString());
                    //to send mail
                    TributeResource objTribute = new TributeResource();
                    Tributes objTrib = new Tributes();
                    objTrib.TributeId = int.Parse(objVid.UserTributeId.ToString());
                    objTrib.TypeDescription = objVid.ModuleTypeName;
                    object[] paramTrib = { objTrib };
                    List<UserInfo> objUser = objTribute.GetTributeAdministrators(paramTrib);
                    if (objUser.Count > 0)
                    {
                        SendEmailForNewVideoTribute(objUser, objVid, type);
                    }

                    //Function to send the mail to the list of users who have added the Tribute in their list of favourites
                    List<UserInfo> objUserFav = objTribute.GetFavouriteTributeUsers(paramTrib);
                    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, objVid, type);
                    }

                }
                else
                    videocaptionexist = true;

            }
            catch (Exception ex)
            {
                throw ex;
            }
            return videocaptionexist;
        }
 public IList<UserInfo> GetTributeAdministrators(object[] UserTributeID)
 {
     TributeResource objResource = new TributeResource();
     return objResource.GetTributeAdministrators(UserTributeID);
 }