private void buttonAddCommander_Click(object sender, EventArgs e) { CommanderForm cf = new CommanderForm(); cf.Init(true); if (cf.ShowDialog(this) == DialogResult.OK) { if (cf.Valid && !EDCommander.IsCommanderPresent(cf.CommanderName)) { EDCommander cmdr = new EDCommander(); cf.Update(cmdr); EDCommander.Create(cmdr); UpdateCommandersListBox(); _discoveryForm.TravelControl.LoadCommandersListBox(); _discoveryForm.ExportControl.PopulateCommanders(); _discoveryForm.RefreshHistoryAsync(); // will do a new parse on commander list adding/removing scanners btnDeleteCommander.Enabled = EDCommander.NumberOfCommanders > 1; } else { Forms.MessageBoxTheme.Show(this, "Command name is not valid or duplicate", "Cannot create Commander", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } } }
private void buttonEditCommander_Click(object sender, EventArgs e) { if (dataGridViewCommanders.CurrentCell != null) { int row = dataGridViewCommanders.CurrentCell.RowIndex; EDCommander cmdr = dataGridViewCommanders.Rows[row].DataBoundItem as EDCommander; CommanderForm cf = new CommanderForm(); cf.Init(cmdr, false); if (cf.ShowDialog(this) == DialogResult.OK) { string currentjloc = cmdr.JournalDir; cf.Update(cmdr); List <EDCommander> edcommanders = (List <EDCommander>)dataGridViewCommanders.DataSource; EDCommander.Update(edcommanders, false); if (currentjloc != cmdr.JournalDir) { _discoveryForm.RefreshHistoryAsync(); // will do a new parse on commander list adding/removing scanners } } } }
private void buttonEditCommander_Click(object sender, EventArgs e) { if (dataGridViewCommanders.SelectedRows.Count > 0) { int row = dataGridViewCommanders.SelectedRows[0].Index; EDCommander cmdr = dataGridViewCommanders.Rows[row].DataBoundItem as EDCommander; CommanderForm cf = new CommanderForm(); cf.Init(cmdr, false); if (cf.ShowDialog(FindForm()) == DialogResult.OK) { bool forceupdate = cf.Update(cmdr); List <EDCommander> edcommanders = (List <EDCommander>)dataGridViewCommanders.DataSource; discoveryform.LoadCommandersListBox(); EDCommander.Update(edcommanders, false); dataGridViewCommanders.Refresh(); if (forceupdate) // journal loc change forcing update { discoveryform.RefreshHistoryAsync(); // do a resync } } } }
private void buttonEditCommander_Click(object sender, EventArgs e) { if (dataGridViewCommanders.CurrentCell != null) { int row = dataGridViewCommanders.CurrentCell.RowIndex; EDCommander cmdr = dataGridViewCommanders.Rows[row].DataBoundItem as EDCommander; CommanderForm cf = new CommanderForm(); cf.Init(cmdr, false); if (cf.ShowDialog(FindForm()) == DialogResult.OK) { cf.Update(cmdr); List <EDCommander> edcommanders = (List <EDCommander>)dataGridViewCommanders.DataSource; discoveryform.LoadCommandersListBox(); EDCommander.Update(edcommanders, false); } // CAPI Descoped discoveryform.Capi.Logout(); // logout.. CAPI may have changed discoveryform.RefreshHistoryAsync(); // do a resync, CAPI may have changed, anything else, make it work again } }
private void buttonAddCommander_Click(object sender, EventArgs e) { CommanderForm cf = new CommanderForm(); cf.Init(true); if (cf.ShowDialog(FindForm()) == DialogResult.OK) { if (cf.Valid && !EDCommander.IsCommanderPresent(cf.CommanderName)) { EDCommander cmdr = new EDCommander(); cf.Update(cmdr); EDCommander.Create(cmdr); UpdateCommandersListBox(); discoveryform.LoadCommandersListBox(); discoveryform.RefreshHistoryAsync(); // will do a new parse on commander list adding/removing scanners btnDeleteCommander.Enabled = EDCommander.NumberOfCommanders > 1; } else { ExtendedControls.MessageBoxTheme.Show(FindForm(), "Commander name is not valid or duplicate".T(EDTx.UserControlSettings_AddC), "Cannot create Commander".T(EDTx.UserControlSettings_AddT), MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } } }