private void generateEnumsButton_Click(object sender, EventArgs e) { StreamReader reader = new StreamReader("C:\\Users\\Daniel Nilsson\\Desktop\\Entities.txt"); StringBuilder text = new StringBuilder(); EasyBaseSystem easyBaseSystem = new EasyBaseSystem(reader.ReadToEnd()); reader.Close(); TextMessageBox.Show(easyBaseSystem.GenerateEnums()); }
private void generateAllButton_Click(object sender, EventArgs e) { StreamReader reader = new StreamReader(entitiesPathFileNameTextBox.Text.Trim()); StringBuilder text = new StringBuilder(); string xmlString = reader.ReadToEnd(); reader.Close(); EasyBaseSystem easyBaseSystem = new EasyBaseSystem(xmlString); StreamWriter writer = new StreamWriter(projectPathTextBox.Text.Trim() + "\\Shared\\Generated\\Classes.cs"); writer.Write(easyBaseSystem.GenerateDataClasses()); writer.Close(); writer = new StreamWriter(projectPathTextBox.Text.Trim() + "\\Shared\\Generated\\DataTables.cs"); writer.Write(easyBaseSystem.GenerateDataTables()); writer.Close(); writer = new StreamWriter(projectPathTextBox.Text.Trim() + "\\Shared\\Generated\\Collections.cs"); writer.Write(easyBaseSystem.GenerateBusinessCollections()); writer.Close(); writer = new StreamWriter(projectPathTextBox.Text.Trim() + "\\Shared\\Generated\\Enums.cs"); writer.Write(easyBaseSystem.GenerateEnums()); writer.Close(); writer = new StreamWriter(projectPathTextBox.Text.Trim() + "\\DataLayer\\Generated\\DataLayer.cs"); writer.Write(easyBaseSystem.GenerateDataMethods()); writer.Close(); writer = new StreamWriter(projectPathTextBox.Text.Trim() + "\\BusinessLayer\\Generated\\BusinessLayer.cs"); writer.Write(easyBaseSystem.GenerateBusinessMethods()); writer.Close(); MessageBox.Show("Kod genererad!", "Easy Base Generator", MessageBoxButtons.OK, MessageBoxIcon.Information); }