Esempio n. 1
0
        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;
            }
        }
Esempio n. 2
0
 private void wizardPage2_NextButtonClick(object sender, CancelEventArgs e)
 {
     try
     {
         if (Path != string.Empty)
         {
             if (CheckAssembly(Path))
             {
                 FileInfo flinfo = new FileInfo(Path);
                 FileName = flinfo.Name;
                 File.Copy(Path, Environment.CurrentDirectory + "\\" + FileName, true);
                 VpnManagerDal.InsertNewVpnType(FileName);
                 VpnManagerDAL.DTO.VpnTypeDTO VpnType = VpnManagerDal.GetVpnTypes().Where(x => x.Name.Equals(FileName)).FirstOrDefault();
                 IDConection = VpnType.Id;
             }
             else
             {
                 e.Cancel = true;
                 MessageBox.Show("File Non Valido!");
             }
         }
         else
         {
             e.Cancel = true;
             MessageBox.Show("Nessun File Selezionato!");
         }
     }
     catch (Exception ex)
     {
         e.Cancel = true;
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 3
0
 public AddConnection()
 {
     InitializeComponent();
     vpnTypeDTOBindingSource.DataSource        = VpnManagerDal.GetVpnTypes();
     connectionTypeDTOBindingSource.DataSource = VpnManagerDal.GetConnectionTypes();
     cmbCustomer.DataSource = VpnManagerDal.GetCustomersList();
 }
Esempio n. 4
0
        private void cmdAddConnectionType_Click(object sender, EventArgs e)
        {
            WizardConnection wzrd = new WizardConnection();

            wzrd.ShowDialog();
            vpnTypeDTOBindingSource.DataSource = VpnManagerDal.GetVpnTypes();
        }
Esempio n. 5
0
 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);
     }
 }
Esempio n. 6
0
        public AddConnection(int Plant)
        {
            InitializeComponent();
            vpnTypeDTOBindingSource.DataSource        = VpnManagerDal.GetVpnTypes();
            connectionTypeDTOBindingSource.DataSource = VpnManagerDal.GetConnectionTypes();
            machineDTOBindingSource.DataSource        = VpnManagerDal.GetMachinesByPlant(Plant);
            PlantDTO plant = VpnManagerDal.GetPlant(Plant);

            cmbCustomer.DataSource = VpnManagerDal.GetCustomersList();
            cmbCustomer.Text       = plant.DisplayedName;
            //cmbCustomer.Text = plant.Name;
            txtServerHost.Text       = plant.ServerAddress;
            txtUser.Text             = plant.Username;
            txtPassword.Text         = plant.Password;
            txtConfrimPassword.Text  = plant.Password;
            cmbVpnType.SelectedValue = plant.IdConnectionType;
            Loading            = false;
            Modifing           = true;
            grpMachine.Enabled = true;
            _plant             = Plant;
            cmdNext.Text       = "Modify Plant";
            extensionObjectDTOBindingSource.DataSource = VpnManagerDal.GetExtensionObjects(_plant, (int)TargetTable.Plant);
            // cmdMachine.Text = "Edit";
        }