Exemple #1
0
        public async Task Send(string message, string userName, string groupId)
        {
            DbManager.AddComment(message, userName, groupId);
            await Groups.AddToGroupAsync(Context.ConnectionId, groupId);

            await Clients.Group(groupId).SendAsync("Send", message, userName);
        }
Exemple #2
0
        protected void AddCommentButton_Click1(object sender, EventArgs e)
        {
            DbManager manager = new DbManager();

            manager.AddComment(Convert.ToInt32(DropDownList1.SelectedValue), 1, CommentTextBox.Text, Convert.ToInt32(Session["UserId"]), Convert.ToInt32(DropDownList4.SelectedValue));
            MessageBox.Show(this.Page, "Başarılı", "Yorumunuz Başarılı bir şekilde eklenmiştir.");

            DropDownList1.SelectedIndex = 0;
            CommentTextBox.Text         = string.Empty;
        }
        protected void btnAddComment_Click(object sender, EventArgs e)
        {
            var res = DbManager.AddComment(int.Parse(hfArticleId.Value), int.Parse(ddlCommentWriter.SelectedValue), txtbxCommentContent.Text);

            if (res.Success)
            {
                Response.Redirect("Article.aspx?id=" + hfArticleId.Value);
            }
            else
            {
                InfoLabel(res.Message);
            }
        }