Beispiel #1
0
 private void ShowInfo(int tid)
 {
     BBS.BLL.BBSTopic   bll   = new BBS.BLL.BBSTopic();
     BBS.Model.BBSTopic model = bll.GetModel(tid);
     this.lbltid.Text         = model.tid.ToString();
     this.lbltsid.Text        = model.tsid.ToString();
     this.lbltuid.Text        = model.tuid.ToString();
     this.lbltreplycount.Text = model.treplycount.ToString();
     this.lblTTopic.Text      = model.TTopic;
     this.lblTContents.Text   = model.TContents;
     this.lblTTime.Text       = model.TTime.ToString();
     this.lblTClickCount.Text = model.TClickCount.ToString();
     this.lblTLastClickT.Text = model.TLastClickT.ToString();
 }
Beispiel #2
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string ID = context.Request.Form["ID"];

            BBS.BLL.BBSTopic bll = new BBS.BLL.BBSTopic();
            // Model.Admin前必须加 [Serializable]
            BBS.Model.BBSTopic model = bll.GetModel(int.Parse(ID));
            //返回一个类的对象
            string jsonString;

            if (model == null)
            {
                jsonString = "{}";
            }
            else
            {
                JavaScriptSerializer serializer = new JavaScriptSerializer();
                jsonString = serializer.Serialize(model);
            }
            context.Response.Write(jsonString);
        }