コード例 #1
0
        /// <summary>
        /// This method will call the Story Resource access class method to update the tribute detail
        /// and also send a email to all admin user
        /// </summary>
        /// 
        /// <param name="objTribute">Stories object which contain the Tribute detail which user want to update
        /// </param>
        public void UpdateTributeDetail(Stories objStory)
        {
            try
            {
                StoryResource objStoryRes = new StoryResource();
                objStoryRes.UpdateTributeDetail(objStory);

                StateManager objStateManager = StateManager.Instance;
                SessionValue objSessionValue = (SessionValue)objStateManager.Get(PortalEnums.SessionValueEnum.objSessionvalue.ToString(), StateManager.State.Session);

                StateManager objStateManager_ = StateManager.Instance;
                Tributes objTribute = (Tributes)objStateManager_.Get(PortalEnums.SessionValueEnum.TributeSession.ToString(), StateManager.State.Session);

                TributesPortal.Utilities.StateManager stateManager = TributesPortal.Utilities.StateManager.Instance;
                string Servername = (string)stateManager.Get("SERVERNAME", TributesPortal.Utilities.StateManager.State.Session);

                string UserName = objSessionValue.FirstName == string.Empty ? objSessionValue.UserName : (objSessionValue.FirstName + " " + objSessionValue.LastName);
                string EmailSubject = UserName + " updated a story on Your Tribute...";
                StringBuilder obhstrb = new StringBuilder();
                obhstrb.Append("<font style='font-size: 12px; font-family:Lucida Sans;'><p>" + UserName + " updated the story in the " + objTribute.TributeName + " " + objTribute.TypeDescription + " Tribute.</p>");
                obhstrb.Append("<p>To read the story, follow the link below:<br/>");
                string strLink = "http://" + objTribute.TypeDescription.Replace("New Baby", "newbaby").ToLower() + "." + WebConfig.TopLevelDomain + "/" + objTribute.TributeUrl + "/story.aspx";
                obhstrb.Append("<a href='" + strLink + "' >" + strLink + "</a><p>");
                obhstrb.Append("<p>---<br/>");
                obhstrb.Append("Your Tribute Team</p></font>");

                SendEmail(objStory.TributeId, EmailSubject, obhstrb.ToString());
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }