public void SaveChanges() { if (!ValidateForm()) { return; } newmiscbindingSource.EndEdit(); _micellaneous = (MiscellaneousItems)newmiscbindingSource.DataSource; this.DialogResult = DialogResult.OK; }
private void gridControl1_DoubleClick(object sender, EventArgs e) { if (MiscellaneousgridView.SelectedRowsCount > 0) { var selected = (MiscellaneousItemsInfo)MiscellaneousgridView.GetRow((int)MiscellaneousgridView.GetSelectedRows().GetValue(0)); if (selected != null) { _miscellaneous = _context.MiscellaneousItems.FirstOrDefault(mi => mi.MisPartId == selected.PartId); } OpenSelectedItem(); } }
private void btnMiNew_Click(object sender, EventArgs e) { var misceditor = new MicilaneousView(); var misc = new MiscellaneousItems(); misceditor.ShowObject(misc); var result = misceditor.ShowDialog(); if (result == DialogResult.OK) { _invoice.MiscellaneousItem.Add(misceditor.CurrentObject); } }
public void ShowObject(object keyValue) { _micellaneous = keyValue as MiscellaneousItems; newmiscbindingSource.DataSource = _micellaneous; if (_micellaneous != null && _micellaneous.MisPartId == 0) { LoadLookups(); Text = @"New Miscellaneous Items"; } if (_micellaneous != null && _micellaneous.MisPartId != 0) { LoadLookups(); Text = @"Edit Miscellaneous Items"; } }
internal void AddmiscItem(MiscellaneousItems micellaneous) { _invoice.MiscellaneousItems.Add(micellaneous); }