Updates to MyGeneration Templates
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user