Ejemplo n.º 1
0
 /// <summary>
 /// Build the message and send to the add method in the db
 /// </summary>
 /// <param name="ucRTBMessage">the message</param>
 private void AddMessageDB(UcRichTextBox ucRTBMessage)
 {
     Message = new Message();
     Message.ReplyContent  = ucRTBMessage.RichTextBox.Rtf; //.Text
     Message.Topic.TopicId = ucRTBMessage.TopicId;
     Message.Person        = _personConnected;
     Controller.AddNewTopicReply(Message);
 }
Ejemplo n.º 2
0
        private void AddMessageDB(UcRichTextBox ucRTBMessage)
        {
            Message = new Message();
            Message.ReplyContent  = ucRTBMessage.RichTextBox.Text;
            Message.Topic.TopicId = ucRTBMessage.TopicId;
            Message.Person        = PersonConnected;
            //message.TypeReply = ucRTBMessage.

            Controller.AddNewTopicReply(Message);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Build and send the message in DB
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AddMessage_Click(object sender, EventArgs e)
        {
            UcRichTextBox ucRichTextBoxReply = (UcRichTextBox)sender;

            AddMessageDB(ucRichTextBoxReply);
            ucRichTextBoxReply.RichTextBox.Text = "";
            // Reload message after add
            if (MessageAdd != null)
            {
                MessageAdd(this, e);
            }
        }
Ejemplo n.º 4
0
        public UcRichTextBox CreateRTB(int topicId)
        {
            UcRichTextBox URTB = new UcRichTextBox();

            URTB.Dock             = DockStyle.Fill;
            URTB.ButtonClick     += new EventHandler(AddMessage_Click);
            URTB.TopicId          = topicId;
            URTB.Enabled          = false;
            URTB.RichTextBox.Text = "Veuillez vous autentifiez pour poster des messages";

            RTBList.Add(URTB);
            return(URTB);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Build user control RichTextBox
        /// </summary>
        /// <param name="topicId">topic id</param>
        /// <returns>object richTextBox</returns>
        public UcRichTextBox BuildRTB(int topicId)
        {
            UcRichTextBox URTB = new UcRichTextBox();

            URTB.Dock         = DockStyle.Fill;
            URTB.ButtonClick += new EventHandler(AddMessage_Click);
            URTB.TopicId      = topicId;
            if (_connection)
            {
                URTB.RichTextBox.Text = "";
                URTB.Enabled          = true;
            }

            RTBList.Add(URTB);
            return(URTB);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Build and send the message in DB
        /// </summary>
        /// <param name="sender">object richTextBox</param>
        /// <param name="e"></param>
        private void AddMessage_Click(object sender, EventArgs e)
        {
            UcRichTextBox ucRichTextBoxReply = (UcRichTextBox)sender;

            if (ucRichTextBoxReply.RichTextBox.Text.Trim() == Properties.Resources.EMPTY)
            {
                MessageBox.Show(Properties.Resources.EMPTYFIELDS, Properties.Resources.CAPTIONEMPTYFIELDS, MessageBoxButtons.OK);
                return;
            }
            AddMessageDB(ucRichTextBoxReply);
            ucRichTextBoxReply.RichTextBox.Text = Properties.Resources.EMPTY;
            // Reload message after add
            if (MessageAdd != null)
            {
                MessageAdd(this, new AddMessageEventArgs {
                    TopicId = ucRichTextBoxReply.TopicId
                });
            }
        }