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(); }
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(); }
private void planToolStripMenuItem_Click(object sender, EventArgs e) { var o = this.MdiChildren.Where(t => t.Name == "PlanEntry"); if (o.Count() > 0) { o.First().Activate(); } else { PlanEntry listForm = new PlanEntry(this.container, UIState.New, new Plan()); listForm.MdiParent = this; listForm.WindowState = FormWindowState.Maximized; listForm.Show(); } }