public static bool AddNewEnvironment(EnvironmentDto dto) { var list = GenFormEnvironmentCollection.Create(); try { list.Add(GenFormEnvironment.Create(dto.Name, dto.provider, dto.Database, dto.LogPath, dto.ExportPath)); return true; } catch (System.Exception) { return false; } }
public static bool AddNewEnvironment(EnvironmentDto dto) { var list = GenFormEnvironmentCollection.Create(); try { list.Add(GenFormEnvironment.Create(dto.Name, dto.provider, dto.Database, dto.LogPath, dto.ExportPath)); return(true); } catch (System.Exception) { return(false); } }
//public ActionResult GetEnvironments() //{ // var names = new List<string> { "GenFormTest", "GenFormAcceptatie", "GenFormProductie" }; //ToDo: EnvironmentServices.GetDatabases(); // IList<object> list = new List<object>(); // foreach (var name in names) // { // list.Add(new { Environment = name }); // } // return this.Direct(list); //} public ActionResult RegisterEnvironment(EnvironmentDto environment) { var success = !String.IsNullOrWhiteSpace(environment.Name) && !String.IsNullOrWhiteSpace(environment.Database) && environment.Database.StartsWith("Data Source=") && (String.IsNullOrWhiteSpace(environment.LogPath) || environment.LogPath.StartsWith("c:\\")) && (String.IsNullOrWhiteSpace(environment.ExportPath) || environment.ExportPath.StartsWith("c:\\")); return this.Direct(new { success, data = environment }); }
public ActionResult RegisterEnvironment(EnvironmentDto dto) { var success = EnvironmentServices.AddNewEnvironment(dto); return this.Direct(new {success, Environment = dto}); }