Пример #1
0
        protected void RadToolBar1_OnButtonClick(object sender, RadToolBarEventArgs e)
        {
            if (e.Item.Text == "Send")
            {
                var cMessage = new CMessage();
                var message  = new Message();

                message             = new Message();
                message.CreatedDate = DateTime.Now;
                message.CreatedId   = CurrentUserId;

                message.UserId  = Convert.ToInt32(RadComboBoxUserName.SelectedValue);
                message.Content = RadEditorContent.Text;
                message.IsRead  = false;

                if (cMessage.Add(message) > 0)
                {
                    // save other tables
                    RunClientScript("Close();");
                }
                else
                {
                    ShowMessage("Error sending message");
                }
            }
            // reply
            else if (e.Item.Text == "Reply")
            {
                RunClientScript("ShowPop('" + RadComboBoxUserName.SelectedValue + "', '2');");
            }
            // close
            else if (e.Item.Text == "Close")
            {
                RunClientScript("Close();");
            }
        }