Exemplo n.º 1
0
    protected void  LeaveMassage_ItemCommand(object source, DataListCommandEventArgs e)
    {
        if (e.CommandName == "detail")
        {
            string theme = e.CommandArgument.ToString();
            textDiv.InnerHtml = theme;
        }
        if (e.CommandName == "Detail")
        {
            string info = e.CommandArgument.ToString();
            textDiv.InnerHtml = info;
        }

        if (e.CommandName == "delete")
        {
            DLeaveMsg info      = new DLeaveMsg();
            string    isSuccuss = (info.Delete(Convert.ToInt32(e.CommandArgument.ToString())) ? "true" : "false");
            Response.Write("<script language=<'javascript'>alert('" + isSuccuss + "');</script>");
        }

        if (e.CommandName == "answer")
        {
            DReply   dRe     = new DReply();
            int      id      = Convert.ToInt32(e.CommandArgument.ToString());
            LeaveMsg msgInfo = new DLeaveMsg().GetleaveMsgById(id);
            LeaveMsgLbl.Text     = msgInfo.Theme;
            ReplyList.DataSource = dRe.GetreplyByparentld(id);
            ReplyList.DataBind();
        }
    }
Exemplo n.º 2
0
    public void MyBind()
    {
        pid       = Convert.ToInt32(Request.QueryString["Pid"]);
        pageSize  = Convert.ToInt32(Request.QueryString["PageSize"]);
        pageIndex = Convert.ToInt32(Request.QueryString["PageIndex"]);
        DataTable dt = barBll.SelByPid(pid);

        if (dt != null && dt.Rows.Count > 0)
        {
            if (dt.Rows.Count > replyPageSize)
            {
                Literal pageHtml = new Literal(); string html = "";
                pageHtml.EnableViewState = false;
                ReplyList.DataSource     = GetPageDT(replyPageSize, pageIndex, dt, out html);
                ReplyList.DataBind();
                pageHtml.Text = html;
                ReplyList.Items[(ReplyList.Items.Count - 1)].Controls.Add(pageHtml);
            }
            else
            {
                ReplyList.DataSource = dt;
                ReplyList.DataBind();
            }
        }//dt bind end;
    }
Exemplo n.º 3
0
 public FakeTopic(int topicId)
 {
     TopicId    = topicId;
     CreatorId  = RandomHelper.Next(10000);
     TopicTitle = FakeContent.MakeTitle();
     ViewCount  = RandomHelper.Next(32423);
     for (int i = 0; i < RandomHelper.Next(2, 10); i++)
     {
         ReplyList.Add(new FakeTopicReply(topicId, RandomHelper.Next(10000)));
     }
     CreateTime     = RandomHelper.Time();
     LastUpdateTime = RandomHelper.Time();
     Owner          = new FakeCommunityInfo();
     Content        = FakeContent.MakeContent();
 }
Exemplo n.º 4
0
        private void Action_Click(object sender, RoutedEventArgs e)
        {
            Button button  = sender as Button;
            string Tooltip = button.ToolTip as string;
            string content = Tooltip.Split(' ')[0];

            if (content.Equals("Reply"))
            {
                InstInteractionModel _instInteractionModel = this.DataContext as InstInteractionModel;
                _instInteractionModel.CanComment = false;
                id = button.Tag as string;
                Reply.Focus();
            }
            else if (content.Equals("Delete"))
            {
                id = button.Tag as string;
                InstInteractionModel _instInteractionModel = this.DataContext as InstInteractionModel;
                _instInteractionModel.DeleteReply(id);
            }
            else if (content.Equals("Hide"))
            {
                id = button.Tag as string;
                InstInteractionModel _instInteractionModel = this.DataContext as InstInteractionModel;
                _instInteractionModel.HideReply(id);
            }
            else if (content.Equals("Send"))
            {
                InstInteractionModel _instInteractionModel = this.DataContext as InstInteractionModel;
                bool outcome = _instInteractionModel.PushReply(id, Reply.Text);
                if (outcome)
                {
                    System.Windows.Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Background, new System.Action(() =>
                    {
                        if (ReplyList.Items != null && ReplyList.Items.Count > 0)
                        {
                            ReplyList.ScrollIntoView(ReplyList.Items[ReplyList.Items.Count - 1]);
                        }
                    }));
                    _instInteractionModel.CanComment = true;
                    Reply.Text = "Enter reply here...";
                }
            }
        }
Exemplo n.º 5
0
        public InstGenesysView(IInstGenesysModel instGenesysModel, IObjectContainer container)
        {
            //We should find the interaction now
            //instGenesysModel.LoadInteraction("17917907209064079", "10159831212825333");
            this.Model     = instGenesysModel;
            this.container = container;

            InitializeComponent();

            Width   = Double.NaN;
            Height  = Double.NaN;
            MinSize = new MSize()
            {
                Width = 400.0, Height = 400.0
            };
            System.Windows.Application.Current.Dispatcher.BeginInvoke(DispatcherPriority.Background, new System.Action(() =>
            {
                if (ReplyList.Items != null && ReplyList.Items.Count > 0)
                {
                    ReplyList.ScrollIntoView(ReplyList.Items[ReplyList.Items.Count - 1]);
                }
            }));
        }
Exemplo n.º 6
0
 internal void OnReplyList(ListMessage message) => ReplyList?.Invoke(message);