Exemplo n.º 1
0
        private void AddClick()
        {
            var dlg = new NoteDialog();

            dlg.DialogTitle = "Add Note";
            dlg.OkClick     = () =>
            {
                var text = dlg.Text.TrimToNull();
                if (text == null)
                {
                    return;
                }

                this.items = this.items ?? new List <NoteRow>();
                items.Insert(0, new NoteRow
                {
                    Text = text,
                    InsertUserDisplayName = Authorization.UserDefinition.DisplayName,
                    InsertDate            = Q.Externals.FormatISODateTimeUTC(JsDate.Now)
                });

                UpdateContent();
                dlg.DialogClose();

                IsDirty = true;
                if (OnChange != null)
                {
                    OnChange();
                }
            };

            dlg.DialogOpen();
        }
Exemplo n.º 2
0
        private void AddClick()
        {
            var dlg = new NoteDialog();

            dlg.DialogTitle = "Add Note";
            dlg.OkClick = () =>
            {
                var text = dlg.Text.TrimToNull();
                if (text == null)
                    return;

                this.items = this.items ?? new List<NoteRow>();
                items.Insert(0, new NoteRow
                {
                    Text = text,
                    InsertUserDisplayName = Authorization.UserDefinition.DisplayName,
                    InsertDate = Q.Externals.FormatISODateTimeUTC(JsDate.Now)
                });

                UpdateContent();
                dlg.DialogClose();

                IsDirty = true;
                if (OnChange != null)
                    OnChange();
            };

            dlg.DialogOpen();
        }
Exemplo n.º 3
0
        private void EditClick(jQueryEvent e)
        {
            e.PreventDefault();

            var index = J(e.Target).GetDataValue("index").As <int>();
            var old   = items[index];

            var dlg = new NoteDialog();

            dlg.DialogTitle = "Edit Note";
            dlg.Text        = old.Text;
            dlg.OkClick     = () =>
            {
                var text = dlg.Text.TrimToNull();
                if (text == null)
                {
                    return;
                }

                items[index].Text = text;
                UpdateContent();
                dlg.DialogClose();
                IsDirty = true;
                if (OnChange != null)
                {
                    OnChange();
                }
            };

            dlg.DialogOpen();
        }
Exemplo n.º 4
0
        private void EditClick(jQueryEvent e)
        {
            e.PreventDefault();

            var index = J(e.Target).GetDataValue("index").As<int>();
            var old = items[index];

            var dlg = new NoteDialog();

            dlg.DialogTitle = "Edit Note";
            dlg.Text = old.Text;
            dlg.OkClick = () =>
            {
                var text = dlg.Text.TrimToNull();
                if (text == null)
                    return;

                items[index].Text = text;
                UpdateContent();
                dlg.DialogClose();
                IsDirty = true;
                if (OnChange != null)
                    OnChange();
            };

            dlg.DialogOpen();
        }