예제 #1
0
        private void EditBtn_Click(object sender, EventArgs e)
        {
            string id = Dgv.SelectedRows[0].Cells[0].Value.ToString();

            switch (ControlType)
            {
            case "Header":
                using (HeaderItemDisplay creator = new HeaderItemDisplay(id))
                {
                    creator.ShowDialog();
                    if (creator.DialogResult == DialogResult.OK)
                    {
                        setDgv();
                    }
                }
                break;

            case "Section":
                using (SectionCreator creator = new SectionCreator(id))
                {
                    creator.ShowDialog();
                    if (creator.DialogResult == DialogResult.OK)
                    {
                        setDgv();
                    }
                }
                break;

            case "Template":
                using (TemplateCreator creator = new TemplateCreator(id))
                {
                    creator.ShowDialog();
                    if (creator.DialogResult == DialogResult.OK)
                    {
                        setDgv();
                    }
                }
                break;
            }
        }
예제 #2
0
        private void AddBtn_Click(object sender, EventArgs e)
        {
            switch (ControlType)
            {
            case "Header":
                using (HeaderItemDisplay creator = new HeaderItemDisplay())
                {
                    creator.ShowDialog();
                    if (creator.DialogResult == DialogResult.OK)
                    {
                        setDgv();
                    }
                }
                break;

            case "Section":
                using (SectionCreator creator = new SectionCreator())
                {
                    creator.ShowDialog();
                    if (creator.DialogResult == DialogResult.OK)
                    {
                        setDgv();
                    }
                }
                break;

            case "Template":
                using (TemplateCreator creator = new TemplateCreator())
                {
                    creator.ShowDialog();
                    if (creator.DialogResult == DialogResult.OK)
                    {
                        setDgv();
                    }
                }
                break;
            }
        }