Пример #1
0
        private void tsbDetail_Click(object sender, EventArgs e)
        {
            if (container.BindingSource.Current == null)
            {
                MessageBox.Show("please choose one.");
                return;
            }

            PlanHeader header = (PlanHeader)container.BindingSource.Current;

            PlanEntry entry = new PlanEntry(container.UnityContainer, Common.UIState.ReadOnly, header.Id);

            entry.StartPosition = FormStartPosition.CenterParent;

            DialogResult result = entry.ShowDialog(this);

            if (result == DialogResult.OK)
            {
                //container.BindingSource
                //BindingSource.EndEdit();
            }
            else
            {
                //BindingSource.CancelEdit();
            }

            entry.Close();
        }
Пример #2
0
        private void tsbAdd_Click(object sender, EventArgs e)
        {
            PlanContainer planContainer = new PlanContainer(this.container.UnityContainer, UIState.New, new Plan());
            PlanEntry listForm = new PlanEntry(planContainer);
            listForm.ShowDialog(this);

            ICollection collection = container.BindingSource;

            //container.BindingSource.Add();
        }