Esempio n. 1
0
        private void coloringBookDetailAddNewPageBtn_Click(object sender, EventArgs e)
        {
            var item   = _coloringBookPageRepo.GetForAdd(_coloringBookId);
            var dialog = new ColoringBookPageDialog(item, false, _artSupplyRepo.GetAll());

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                _coloringBookPageRepo.Add(dialog.Item);
                reloadColoringBookPages();
            }
        }
Esempio n. 2
0
        private void coloringBookDetailEditPageBtn_Click(object sender, EventArgs e)
        {
            var selected = coloringBookDetailLv.SelectedIndices;

            if (selected.Count == 1)
            {
                var selectedIndex = selected[0];
                var item          = _coloringBookPageRepo.GetForEdit(_coloringBookPageIds[selectedIndex]);
                if (item == null)
                {
                    return;
                }
                var dialog = new ColoringBookPageDialog(item, true, _artSupplyRepo.GetAll());
                var result = dialog.ShowDialog();
                if (result == DialogResult.OK)
                {
                    _coloringBookPageRepo.Edit(dialog.Item);
                    reloadColoringBookPages();
                }
            }
        }