Esempio n. 1
0
 public void SaveChanges()
 {
     if (!ValidateForm())
     {
         return;
     }
     newmiscbindingSource.EndEdit();
     _micellaneous     = (MiscellaneousItems)newmiscbindingSource.DataSource;
     this.DialogResult = DialogResult.OK;
 }
Esempio n. 2
0
 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();
     }
 }
Esempio n. 3
0
        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);
            }
        }
Esempio n. 4
0
 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";
     }
 }
Esempio n. 5
0
 internal void AddmiscItem(MiscellaneousItems micellaneous)
 {
     _invoice.MiscellaneousItems.Add(micellaneous);
 }