Example #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;
            }
        }
Example #2
0
 public AddConnection()
 {
     InitializeComponent();
     vpnTypeDTOBindingSource.DataSource        = VpnManagerDal.GetVpnTypes();
     connectionTypeDTOBindingSource.DataSource = VpnManagerDal.GetConnectionTypes();
     cmbCustomer.DataSource = VpnManagerDal.GetCustomersList();
 }
Example #3
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);
     }
 }
Example #4
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";
        }