private void cmbType_SelectedIndexChanged(object sender, EventArgs e) { switch (cmbType.Text) { case "ConnectionType": dataGridView1.DataSource = ConnTypeDto; ConnTypeDto.DataSource = VpnManagerDal.GetConnectionTypes(); sTargetTable = TargetTable.ConnectionType.ToString(); dataGridView1.Columns["Id"].Visible = false; break; case "Machine": //dataGridView1.DataSource = MachineDto; //MachineDto.DataSource = VpnManagerDal.Get break; case "Plant": dataGridView1.DataSource = plantDTOBindingSource; plantDTOBindingSource.DataSource = VpnManagerDal.GetPlants(); sTargetTable = "Plant"; dataGridView1.Columns["Id"].Visible = false; break; case "VpnType": dataGridView1.DataSource = VpnType; VpnType.DataSource = VpnManagerDal.GetVpnTypes(); sTargetTable = "VpnType"; dataGridView1.Columns["Id"].Visible = false; break; default: break; } }
public void ReloadAll() { OnInfoFromCore("Controller: Reloading VPN", false); try { ListClients = VpnManagerDal.GetCustomers().ToDictionary(x => x.Id); ListPlants = VpnManagerDal.GetPlants().ToDictionary(f => f.Id); ListConnectionsType = VpnManagerDal.GetConnectionTypes().ToDictionary(g => g.Id); VpnTypes = VpnManagerDal.GetVpnTypes().ToDictionary(j => j.Id); // OnInfoFromCore("Core: Loaded Completed", false); } catch (Exception e) { OnInfoFromCore("Controller: Error in Loading Vpn", false); OnInfoFromCore(e.Message, false); } }