private void ts_Edit_Click(object sender, EventArgs e) { if (CanEditMinMaxPersons()) { using (FormWorldMinMaxEdit form = new FormWorldMinMaxEdit()) { form.Entity = context; if (form.ShowDialog() == DialogResult.OK) { if (gridControl.DataSource != null) { BindingList <PersonMinMax> lst = (BindingList <PersonMinMax>)gridControl.DataSource; lst.ResetBindings(); UpdateButtonState(); } } } } }
private void ts_AddNew_Click(object sender, EventArgs e) { using (FormWorldMinMaxEdit form = new FormWorldMinMaxEdit()) { context.TakePersonMinMax.CreateNewPerson((long)edWorld.EditValue); form.Entity = context; if (form.ShowDialog() == DialogResult.OK) { context.TakePersonMinMax.AddPerson(); if (gridControl.DataSource != null) { BindingList <PersonMinMax> lst = (BindingList <PersonMinMax>)gridControl.DataSource; lst.Add(context.TakePersonMinMax.PersonMinMax); context.TakePersonMinMax.PersonMinMax = FocusedEntity; } UpdateButtonState(); } else { context.TakePersonMinMax.PersonMinMax = FocusedEntity; } } }
private void ts_Edit_Click(object sender, EventArgs e) { if (CanEditMinMaxPersons()) { using (FormWorldMinMaxEdit form = new FormWorldMinMaxEdit()) { form.Entity = context; if (form.ShowDialog() == DialogResult.OK) { if (gridControl.DataSource != null) { BindingList<PersonMinMax> lst = (BindingList<PersonMinMax>)gridControl.DataSource; lst.ResetBindings(); UpdateButtonState(); } } } } }
private void ts_AddNew_Click(object sender, EventArgs e) { using (FormWorldMinMaxEdit form = new FormWorldMinMaxEdit()) { context.TakePersonMinMax.CreateNewPerson ((long)edWorld.EditValue); form.Entity = context; if (form.ShowDialog() == DialogResult.OK) { context.TakePersonMinMax.AddPerson(); if (gridControl.DataSource != null) { BindingList<PersonMinMax> lst = (BindingList<PersonMinMax>)gridControl.DataSource; lst.Add(context.TakePersonMinMax.PersonMinMax); context.TakePersonMinMax.PersonMinMax = FocusedEntity; } UpdateButtonState(); } else { context.TakePersonMinMax.PersonMinMax = FocusedEntity; } } }