制作主页面菜单调用eco各模块的mygeneration模板(原)
来源:互联网 发布:程序员喜欢女生的表现 编辑:程序博客网 时间:2024/05/13 02:25
发表时间:2006-9-4 7:59:47
<%
Dim bFirst
Dim name
Dim pname
Dim objTable
Dim objColumn
Dim tableNames
Dim databaseName
Dim tableName
'dim ecospace
dim jj
' Grab the namespace
namespace = input.Item("txtNamespace")
Set tableName = input.Item("lstTables")
MyMeta.Language = input.Item("cmbLanguages")
MyMeta.DbTarget = "OleDb"
' Grab the choices the user made in our UI Script (see Interface Code tab)
Set tableNames = input.Item("lstTables")
'ecospace=input.item("txtecospace")
databaseName = input.Item("cmbDatabase")
Set database = MyMeta.Databases(0)
%>
unit fmmainmenu;
interface
uses
System.Drawing, System.Collections, System.ComponentModel,
System.Windows.Forms, System.Data
<%' Loop through the tables the user select and generate the stored procs and save them to disk
For intLp = 0 To tableNames.Count - 1
set objTable = database.Tables(tablenames.item(intLp))
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Now we have the table that we desire to build a Business Object From, let us begin.
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%> ,fm<%=objtable.alias%>
<%next %>;
type
tmainmenu = class(System.Windows.Forms.Form)
{$REGION 'Designer Managed Code'}
strict private
/// <summary>
/// Required designer variable.
/// </summary>
Components: System.ComponentModel.Container;
MainMenu1: System.Windows.Forms.MainMenu;
MenuItem1: System.Windows.Forms.MenuItem;
MenuItem2: System.Windows.Forms.MenuItem;
<%' Loop through the tables the user select and generate the stored procs and save them to disk
k=3
For intLp = 0 To tableNames.Count - 1
set objTable = database.Tables(tablenames.item(intLp))
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Now we have the table that we desire to build a Business Object From, let us begin.
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
output.write" MenuItem"&k&":System.Windows.Forms.MenuItem;" &vbcrlf
k=k+1
next %>
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
procedure InitializeComponent;
<%' Loop through the tables the user select and generate the stored procs and save them to disk
k=3
For intLp = 0 To tableNames.Count - 1
set objTable = database.Tables(tablenames.item(intLp))
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Now we have the table that we desire to build a Business Object From, let us begin.
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
output.write" procedure MenuItem"&k&"_Click(sender: System.Object; e: System.EventArgs);" &vbcrlf
k=k+1
next %>
{$ENDREGION}
strict protected
/// <summary>
/// Clean up any resources being used.
/// </summary>
procedure Dispose(Disposing: Boolean); override;
private
{ Private Declarations }
<%' Loop through the tables the user select and generate the stored procs and save them to disk
k=3
For intLp = 0 To tableNames.Count - 1
set objTable = database.Tables(tablenames.item(intLp))
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Now we have the table that we desire to build a Business Object From, let us begin.
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%> procedure doform<%=objtable.alias%>();
<% k=k+1
next %>
public
constructor Create;
end;
[assembly: RuntimeRequiredAttribute(TypeOf(Tmainmenu))]
implementation
{$AUTOBOX ON}
{$REGION 'Windows Form Designer generated code'}
/// <summary>
/// Required method for Designer support -- do not modify
/// the contents of this method with the code editor.
/// </summary>
procedure tmainmenu.InitializeComponent;
type
TArrayOfSystem_Windows_Forms_MenuItem = array of System.Windows.Forms.MenuItem;
begin
Self.MainMenu1 := System.Windows.Forms.MainMenu.Create;
Self.MenuItem1 := System.Windows.Forms.MenuItem.Create;
Self.MenuItem2 := System.Windows.Forms.MenuItem.Create;
<%' Loop through the tables the user select and generate the stored procs and save them to disk
k=3
For intLp = 0 To tableNames.Count - 1
set objTable = database.Tables(tablenames.item(intLp))
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Now we have the table that we desire to build a Business Object From, let us begin.
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%> Self.MenuItem<%=k%> := System.Windows.Forms.MenuItem.Create;
<%k=k+1
next
%>
//
// MainMenu1
//
Self.MainMenu1.MenuItems.AddRange(TArrayOfSystem_Windows_Forms_MenuItem.Create(Self.MenuItem1,
Self.MenuItem2));
//
// MenuItem1
//
Self.MenuItem1.Index := 0;
Self.MenuItem1.MenuItems.AddRange(TArrayOfSystem_Windows_Forms_MenuItem.Create(
<%' Loop through the tables the user select and generate the stored procs and save them to disk
k=3
bfirst=true
For intLp = 0 To tableNames.Count - 1
set objTable = database.Tables(tablenames.item(intLp))
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Now we have the table that we desire to build a Business Object From, let us begin.
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if bfirst then
output.write " Self.MenuItem" & k
bfirst=false
else
output.write " ,Self.MenuItem" & k
end if
k=k+1
next %>
));
Self.MenuItem1.Text := '功能';
//
// MenuItem2
//
Self.MenuItem2.Index := 1;
Self.MenuItem2.Text := '系统';
//
// MenuItem3
//
<%' Loop through the tables the user select and generate the stored procs and save them to disk
k=3
For intLp = 0 To tableNames.Count - 1
set objTable = database.Tables(tablenames.item(intLp))
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Now we have the table that we desire to build a Business Object From, let us begin.
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
output.write " Self.MenuItem" & k & ".Index := 0;" &vbcrlf
output.write " Self.MenuItem" & k & ".Text := '" & objtable.alias &"';" &vbcrlf
output.write " Include(Self.MenuItem" & k & ".Click, Self.MenuItem" & k &"_Click);" &vbcrlf
k=k+1
next %>
//
// TWinForm
//
Self.AutoScaleBaseSize := System.Drawing.Size.Create(6, 14);
Self.ClientSize := System.Drawing.Size.Create(536, 358);
Self.Menu := Self.MainMenu1;
Self.Name := 'TWinForm';
Self.Text := 'WinForm';
end;
{$ENDREGION}
procedure tmainmenu.Dispose(Disposing: Boolean);
begin
if Disposing then
begin
if Components <> nil then
Components.Dispose();
end;
inherited Dispose(Disposing);
end;
<%' Loop through the tables the user select and generate the stored procs and save them to disk
k=3
For intLp = 0 To tableNames.Count - 1
set objTable = database.Tables(tablenames.item(intLp))%>
procedure tmainmenu.doform<%=objtable.alias%>;
var aform:form<%=objtable.alias%>;
begin
aform:=form<%=objtable.alias%>.create();
try
aform.showdialog;
finally
aform.dispose;
end;
end;
<%k=k+1
next %>
constructor tmainmenu.Create;
begin
inherited Create;
//
// Required for Windows Form Designer support
//
InitializeComponent;
//
// TODO: Add any constructor code after InitializeComponent call
//
end;
<%' Loop through the tables the user select and generate the stored procs and save them to disk
k=3
For intLp = 0 To tableNames.Count - 1
set objTable = database.Tables(tablenames.item(intLp))
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Now we have the table that we desire to build a Business Object From, let us begin.
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
output.write"procedure tmainmenu.MenuItem"&k&"_Click(sender: System.Object; e: System.EventArgs);" &vbcrlf
output.write"begin" &vbcrlf
output.write" doform" & objtable.alias &"();" &vbcrlf
output.write"end;" &vbcrlf &vbcrlf
k=k+1
next %>
end.
==================================================
**************************************************
<%
' Save the output file for this Table
Dim filename
filename = input.item("txtPath")
Dim length
Dim pos
lenth = Len(filename)
pos = InStrRev(filename, "/")
If Not pos = lenth Then
filename = filename & "/"
End If
filename = filename & "mainmenu.pas"
output.save filename, false
buffer = buffer & output.text
output.clear
'Next ' tableName
output.write buffer
%>
<%
'===========================================================================
' These are support routines called by the above scirpt
'===========================================================================
Function GetAlias(objColumn)
Dim name
name = TrimSpaces(objColumn.Alias)
GetAlias = UCase(Left(name, 1)) & Right(name, Len(name) -1)
End Function
Function GetName(objColumn)
Dim name
name = objColumn.Name
GetName = UCase(Left(name, 1)) & Right(name, Len(name) -1)
End Function
Function TrimSpaces(str)
Dim tname
Dim name
Dim char
Dim l
name = ""
tname = str
l = Len(tname)
For j = 1 To l
char = Mid(tname, j, 1)
If Not char = " " Then
name = name & char
End If
Next
TrimSpaces = name
End Function
%>
- 制作主页面菜单调用eco各模块的mygeneration模板(原)
- mygeneration中自己做的winform模板,用于eco的输入,access数据源
- eco自动表单(mygeneration模板)续改进中..
- Lesson_for_java_day03---微信主页面的制作
- 第二篇:主页面及主页的两个模块
- ajax调用主页面方法
- 在iframe里调用主页面里的js函数
- 主页面调用iframe里面匿名Javascript函数的问题
- 主页的制作
- 使用easyobjects + asp.net ajax + mygeneration(3) 如何写mygeneration的模板
- 主页面RadioButton切换Fragment模板
- javascript 拖动鼠标改变两个单元格的界线,(菜单|页面、样式的主页面)
- 音乐播放器app(二)—主页面的分析与制作
- Joomla模板制作教程:菜单
- 设置访问的主页面
- tablayout的主页面应用
- Joomla模板制作教程:模块
- 在用户控件中如何调用主页面的事件之事件委托
- 快速用flash做课件的秘技(原创)
- 快速用flash做课件的秘技(原创) 二
- flash中载入外部文件的动作
- 使用心得:[屏幕录制专家]与[Macromedia Captivate]的比拼
- mygeneration中自己做的winform模板,用于eco的输入,access数据源
- 制作主页面菜单调用eco各模块的mygeneration模板(原)
- eco使用中逐步解决的问题
- 一个猎头给人才的十点忠告
- Access创建表结构及DataTable与数据库同步的问题
- MySQL用户管理
- python的一个小例子
- 记录一种宽带故障
- "不是所有工作区中的窗口无法打开"错误消息(Not all of the Windows in the workspace could be open)
- WinSock学习笔记