Exemplo n.º 1
0
        public void Init(Comment comment)
        {
            lblPerson.Text = Users.GetName(comment.author) + ":";

            lblDate.Text = comment.time.ToString();
            rtfEditor.Rtf = comment.text;
        }
Exemplo n.º 2
0
 private void btnSend_Click(object sender, EventArgs e)
 {
     if (message.richTextBox.Text != "")
     {
         Comment comment = new Comment();
         comment.text = message.richTextBox.Rtf;
         comment.node = node.id;
         comment.author = Global.loggedUser.id;
         comment.InsertWithCurrentTime();
         message.richTextBox.Text = "";
         SetNode(node);
     }
     else
     {
         MessageBox.Show("Сообщение не может быть пустым");
     }
 }
Exemplo n.º 3
0
        private void btnCreate_Click(object sender, EventArgs e)
        {
            try
            {
                if (txtName.Text == "")
                    throw new Exception("Название не задано");

                Node node = new Node();
                node.name = txtName.Text;
                node.type = ENodeType.TASK;
                node.parent = owner.id;
                node.responsible = ((User)cmbResponsible.SelectedItem).id;
                Object checker = cmbChecker.SelectedItem;
                if (checker.GetType() == typeof(User))
                {
                    node.checkertype = ECheckerType.PERSON;
                    node.checker = ((User)checker).id;
                }
                else
                {
                    node.checkertype = (ECheckerType)(TextObject<ECheckerType>)checker;
                }

                node.InsertWithCurrentTime();

                if (rtfEditor.richTextBox.Text != "")
                {
                    Comment comment = new Comment();
                    comment.text = rtfEditor.richTextBox.Rtf;
                    comment.node = node.id;
                    comment.author = Global.loggedUser.id;
                    comment.InsertWithCurrentTime();
                }

                node.interest = true;
                owner.AddNode(node);

                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            catch (Exception error)
            {
                Utils.ErrorMessage(error.Message);
            }
        }