public void SetHostConfiguration(ConfigurationFormViewModel config)
 {
     var delete = dataDB.HostConfiguration.First();
     dataDB.HostConfiguration.Remove(delete);
     dataDB.HostConfiguration.Add(new HostConfiguration(config));
     dataDB.SaveChanges();
 }
Beispiel #2
0
 public HostConfiguration(ConfigurationFormViewModel cfg)
 {
     MaxVMCount = cfg.MaxVMCount;
     MinIP = cfg.MinIP;
     MaxIP = cfg.MaxIP;
     CreateVMTime = DateTime.Parse(cfg.CreateVMTime.ToString());
     BackupVMTime = DateTime.Parse(cfg.BackupVMTime.ToString());
     ArchiveVMTime = DateTime.Parse(cfg.ArchiveVMTime.ToString());
 }
        public ActionResult Host(ConfigurationFormViewModel config)
        {
            if (ModelState.IsValid)
            {
                configRepo.SetHostConfiguration(config);

                return RedirectToAction("Index", "VirtualMachine");
            }

            return View(config);
        }