예제 #1
0
        public void ToItemModifyTextBox(int id)
        {
            BBSItemViewData ItemViewData = new BBSItemViewData();
            try
            {
                // 获取BBSItem的信息
                ItemViewData.BBSItem = (from bbsitem in CQGJ.BBSItem where bbsitem.ItemID == id select bbsitem).First();

                RenderView("EditorForItem", ItemViewData);

            }
            catch (InvalidOperationException)
            {

            }
            catch (ArgumentNullException)
            {
                Response.Write("该帖子已被删除!");
            }
        }
예제 #2
0
        /// <summary>
        /// 根据BBSItem的ID来获取该Item的信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public BBSItemViewData GetBBSItemInfoByID(int id)
        {
            BBSItemViewData ItemViewData = new BBSItemViewData();

            try
            {
                // 获取BBSItem的信息
                ItemViewData.BBSItem = (from bbsitem in CQGJ.BBSItem where bbsitem.ItemID == id select bbsitem).First();
                ItemViewData.BBSID = (int)ItemViewData.BBSItem.BBSReference.EntityKey.EntityKeyValues[0].Value;
                //ItemViewData.BBSID = ItemViewData.BBSItem.BBS.BBSID;

            }
            catch (InvalidOperationException)
            {

            }
            catch (ArgumentNullException)
            {
                Response.Write("该帖子已被删除!");
            }

            return ItemViewData;
        }
예제 #3
0
        /// <summary>
        /// 跳转到新建BBS Item页面
        /// </summary>
        public void ToCreateTopicItem(int id)
        {
            BBSItemViewData BBSItemViewData = new BBSItemViewData();

            BBSItemViewData.BBSID = id;

            RenderView("CreateTopic", BBSItemViewData);
            //RenderView("CreateTopic");
        }
예제 #4
0
        public void toCreateReplyItem()
        {
            BBSItemViewData item = new BBSItemViewData();

            item.BBSID = GetInt("bbsId");
            item.BBSItem = new BBSItem();
            item.BBSItem.ItemID = GetInt("itemId");

            RenderView("CreateReply", item);
        }
예제 #5
0
        /// <summary>
        /// 根据BBSItem 的 ID 对其进行修改
        /// </summary>
        /// <param name="id">BBSItem的ID</param>
        public void ShowEditBBSItem(int id)
        {
            BBSItemViewData ItemViewData = new BBSItemViewData();
            try
            {
                // 获取BBSItem的信息
                ItemViewData.BBSItem = (from bbsitem in CQGJ.BBSItem where bbsitem.ItemID == id select bbsitem).First();
                ItemViewData.BBSID = (int)ItemViewData.BBSItem.BBSReference.EntityKey.EntityKeyValues[0].Value;
                //ItemViewData.BBSID = ItemViewData.BBSItem.BBS.BBSID;
                RenderView("ShowEditBBSItem", ItemViewData);

            }
            catch (InvalidOperationException)
            {

            }
            catch (ArgumentNullException)
            {
                Response.Write("该帖子已被删除!");
            }
        }
예제 #6
0
 /// <summary>
 /// 跳转到新建BBS Item页面
 /// </summary>
 public ActionResult ToCreateTopicItem(int id)
 {
     BBSItemViewData BBSItemViewData = new BBSItemViewData();
     BBSItemViewData.BBSID = id;
     return View("CreateTopic", BBSItemViewData);
 }
예제 #7
0
        public ActionResult toCreateReplyItem()
        {
            BBSItemViewData item = new BBSItemViewData();

            item.BBSID = GetInt("bbsId");
            item.BBSItem = new BBSItem();
            item.BBSItem.ItemID = GetInt("itemId");
            return View("CreateReply", item);
        }