public void Page_Load(object sender, EventArgs e)
        {
            var indexDirectory = Path.GetFullPath(WebConfigurationManager.AppSettings ["IndexDirectory"]);

            var computersDirectory = Path.GetFullPath(WebConfigurationManager.AppSettings ["ComputersDirectory"]);

            Manager = new ComputerManager(indexDirectory, computersDirectory);

            var computerName = Request.QueryString ["ComputerName"];

            if (!String.IsNullOrEmpty(computerName))
            {
                Computer = Manager.GetComputerInfo(computerName);
                Action   = "Edit";
            }
            else
            {
                Action = "Add";
            }

            if (!IsPostBack)
            {
                PopulateForm();
            }
            else
            {
                HandleSubmission();
            }
        }
        public void PopulateForm()
        {
            if (!String.IsNullOrEmpty(Request.QueryString ["ComputerName"]))
            {
                Computer = Manager.GetComputerInfo(Request.QueryString ["ComputerName"]);
            }

            ComputerName.Text = Computer.Name;
            ComputerPath.Text = Computer.Host;
            Username.Text     = Computer.Username;
        }
Esempio n. 3
0
        public void Page_Load(object sender, EventArgs e)
        {
            var indexDirectory = Path.GetFullPath(WebConfigurationManager.AppSettings ["IndexDirectory"]);

            var computersDirectory = Path.GetFullPath(WebConfigurationManager.AppSettings ["ComputersDirectory"]);

            var devicesDirectory = Path.GetFullPath(WebConfigurationManager.AppSettings ["DevicesDirectory"]);

            Manager       = new ComputerManager(indexDirectory, computersDirectory);
            DeviceManager = new DeviceManager(indexDirectory, devicesDirectory);

            var computerName = Request.QueryString ["ComputerName"];

            Computer = Manager.GetComputerInfo(computerName);

            Devices = DeviceManager.GetDevicesInfo(Computer.Host);
        }