Updates to MyGeneration Templates

This commit is contained in:
Rich
2010-09-29 17:01:42 +00:00
parent fd69da45b9
commit f3782ea2a2
4 changed files with 136 additions and 50 deletions

View File

@@ -76,6 +76,8 @@ public class GeneratedGui : DotNetScriptGui
chkFKCalc2.Checked = false;
GuiCheckBox chkColumns2 = MakeGuiCheckBox("chkColumns2","PrimFK",true,"Primary Foreign Key",150,chkDetail,300, -1);
chkColumns2.Checked = false;
GuiCheckBox chkNewFK = MakeGuiCheckBox( "chkNewFK", "NewFK", true, "NewFK" ,150,chkDetail,450,-1);
chkNewFK.Checked = false;
GuiCheckBox chkRelated = MakeGuiCheckBox("chkRelated","Related",true,"Related",150,chkDetail,0,-2);
chkRelated.Checked = false;
GuiCheckBox chkOne2One = MakeGuiCheckBox("chkOne2One","One to One",true,"One to Many and One to One",150,chkDetail,150, -2);
@@ -230,6 +232,7 @@ public class GeneratedGui : DotNetScriptGui
GuiCheckBox chkAlias= ui["chkAlias"] as GuiCheckBox;
GuiCheckBox chkNames= ui["chkNames"] as GuiCheckBox;
GuiCheckBox chkProc = ui["chkProc"] as GuiCheckBox;
GuiCheckBox chkNewFK = ui["chkNewFK"] as GuiCheckBox;
GuiLabel labelTest = ui["labelTest"] as GuiLabel;
string status = "";
if(chkDetail.Checked)status+=", " + chkDetail.Text;
@@ -245,6 +248,7 @@ public class GeneratedGui : DotNetScriptGui
if(chkAlias.Checked)status+=", " + chkAlias.Text;
if(chkNames.Checked)status+=", " + chkNames.Text;
if(chkProc.Checked)status+=", " + chkProc.Text;
if(chkNewFK.Checked)status+=", " + chkNewFK.Text;
if(status == "")
{
btnOK.Enabled = false;
@@ -352,6 +356,7 @@ public class GeneratedTemplate : DotNetScriptTemplate
if((bool)input["chkInternal"])ShowInternalRelated( _workingTable );
if((bool)input["chkAlias"])ShowAlias( _workingTable );
if((bool)input["chkNames"])ShowNames( _workingTable );
if((bool)input["chkNewFK"])ShowNewFK( _workingTable );
}
}
//foreach(ITable tbl in db.Tables)
@@ -382,6 +387,19 @@ public class GeneratedTemplate : DotNetScriptTemplate
}
}
}
private void ShowNewFK(ITable tbl)
{
%>NewFK Output:<%=tbl.Name%>
<%
foreach(IForeignKey fk in tbl.ForeignKeys)
{
if(tbl.Name == fk.PrimaryTable.Name)
{
%>Foreign Table <%=fk.ForeignTable.Name%> Column <%=fk.ForeignColumns[0].Name%>
<%
}
}
}
private string ForeignKeyCheck(IColumn col)
{