Example #1
0
        public static bool Save(string username, string password)
        {
            bool ischeck = false;

            if (!String.IsNullOrEmpty(TopicId))
            {
                TopicLogin topicLogin = PSCPortal.CMS.TopicLogin.GetTopicLogin(TopicId);
                if (topicLogin != null)
                {
                    if (string.Equals(username, topicLogin.Name) && string.Equals(password, topicLogin.Password))
                    {
                        HttpContext.Current.Session["UserWatchTopic"] = topicLogin.Name;
                        ischeck = true;
                        TopicId = null;
                    }
                }
            }
            if (!String.IsNullOrEmpty(ArticleId))
            {
                ArticleLogin articleLogin = PSCPortal.CMS.ArticleLogin.GetArticleLogin(ArticleId);
                if (articleLogin != null)
                {
                    if (string.Equals(username, articleLogin.Name) && string.Equals(password, articleLogin.Password))
                    {
                        HttpContext.Current.Session["UserWatchArticle"] = articleLogin.Name;
                        ischeck   = true;
                        ArticleId = null;
                    }
                }
            }
            return(ischeck);
        }
Example #2
0
        public static void TopicLoginEdit(string id)
        {
            Guid       idTopic    = new Guid(id);
            TopicLogin topicLogin = TopicLoginList.Where(t => t.Id == idTopic).SingleOrDefault();

            if (topicLogin != null)
            {
                PSCDialog.DataShare = new TopicLoginArgs(topicLogin, true);
            }
            else
            {
                topicLogin          = new TopicLogin();
                topicLogin.Id       = idTopic;
                PSCDialog.DataShare = new TopicLoginArgs(topicLogin, false);
            }
        }
Example #3
0
        public bool AllowWatchTopic(string topicId)
        {
            TopicLogin topicLogin = PSCPortal.CMS.TopicLogin.GetTopicLogin(topicId);

            if (topicLogin == null)
            {
                return(true);
            }
            else
            {
                if (Session["UserWatchTopic"] != null && (string)Session["UserWatchTopic"] == topicLogin.Name)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
        }