Beispiel #1
0
        public static List <CoTopicVM> RetrieveTopic(string topicid)
        {
            var ret = new List <CoTopicVM>();
            var sql = "select topicid,subject,creator,status,createdate,topiccontent from CoTopicVM where topicid = '<topicid>'";

            sql = sql.Replace("<topicid>", topicid);

            var dbret = DBUtility.ExeLocalSqlWithRes(sql);

            foreach (var line in dbret)
            {
                var imgresize = SeverHtmlDecode.ResizeImageFromHtml(Convert.ToString(line[5]));

                var tempvm = new CoTopicVM(Convert.ToString(line[0]), Convert.ToString(line[1]), imgresize, Convert.ToString(line[2])
                                           , Convert.ToString(line[3]), Convert.ToDateTime(line[4]).ToString("yyyy-MM-dd HH:mm:ss"));

                tempvm.eventtimelist      = RetrieveTopicDueDate(tempvm.topicid);
                tempvm.ProjectWorkingList = TopicProject.RetrieveTopicPJ(tempvm.topicid, TopicPJStatus.Working);
                tempvm.ProjectDoneList    = TopicProject.RetrieveTopicPJ(tempvm.topicid, TopicPJStatus.Done);
                tempvm.CommentList        = TopicCommentVM.RetrieveComment(tempvm.topicid);

                ret.Add(tempvm);
            }

            return(ret);
        }
Beispiel #2
0
        public static List <TopicCommentVM> RetrieveComment(string tid, string cid)
        {
            var ret = new List <TopicCommentVM>();
            var sql = "select topicid,commentid,commentcontent,creator,commentdate from TopicCommentVM where topicid = '<topicid>' and commentid = '<commentid>'";

            sql = sql.Replace("<topicid>", tid).Replace("<commentid>", cid);
            var dbret = DBUtility.ExeLocalSqlWithRes(sql);

            foreach (var line in dbret)
            {
                var imgresize = SeverHtmlDecode.ResizeImageFromHtml(Convert.ToString(line[2]));
                ret.Add(new TopicCommentVM(Convert.ToString(line[0]), Convert.ToString(line[1])
                                           , imgresize, Convert.ToString(line[3]), Convert.ToDateTime(line[4]).ToString("yyyy-MM-dd HH:mm:ss")));
            }
            return(ret);
        }