Ejemplo n.º 1
0
        private void EditAccessoryModule()
        {
            if (grdAccessoryView.SelectedRowsCount <= 0)
            {
                MessageBox.Show("You must select the object you want to edit.", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            DataRowView rowView = grdAccessoryView.GetRow(grdAccessoryView.GetSelectedRows()[0]) as DataRowView;

            if (rowView == null)
            {
                return;
            }

            Device module = OTCContext.Project.AccessoryModules.Get((int)rowView[0]);

            if (module == null)
            {
                return;
            }

            FrmAccessoryEditor form = new FrmAccessoryEditor(module);

            form.ShowDialog(this);

            if (form.DialogResult == System.Windows.Forms.DialogResult.OK)
            {
                ListAccessoryModules();
            }
        }
Ejemplo n.º 2
0
        private void AddAccessoryModule()
        {
            FrmAccessoryEditor form = new FrmAccessoryEditor();

            form.ShowDialog(this);

            if (form.DialogResult == System.Windows.Forms.DialogResult.OK)
            {
                ListAccessoryModules();
            }
        }