ExtAspNet學習-利用AppBox框架快速創建項目(五)—完成項目含源代碼


我們前邊四個部分已經完成了框架需要的基礎配置,

現在我們來完成項目

1、Subsonic 配置,首先在OraSurvey.DAO中添加App.config配置相關信息

View Code
 1 <?xml version="1.0" encoding="utf-8" ?>
2 <configuration>
3 <configSections>
4 <section name="SubSonicService" type="SubSonic.SubSonicSection, SubSonic" allowDefinition="MachineToApplication" restartOnExternalChanges="true" requirePermission="false"/>
5 </configSections>
6 <connectionStrings>
7 <add name="OraSurvey" connectionString="Password=test1;Persist Security Info=True;User ID=test1;Data Source=vmdb"/>
8 </connectionStrings>
9 <SubSonicService defaultProvider="OraSurvey" enableTrace="false" templateDirectory="">
10 <providers>
11 <clear/>
12 <add name="OraSurvey" type="SubSonic.OracleDataProvider, SubSonic" connectionStringName="OraSurvey" generatedNamespace="OraSurvey.DAO" removeUnderscores="true" spClassName="SPs"/>
13 </providers>
14 </SubSonicService>
15 </configuration>

2、ExtAspNet和Subsonic配置到Web.config中

View Code
 1 <?xml version="1.0" encoding="utf-8"?>
2
3 <!--
4 有關如何配置 ASP.NET 應用程序的詳細消息,請訪問
5 http://go.microsoft.com/fwlink/?LinkId=169433
6 -->
7
8 <configuration>
9 <configSections>
10 <section name="SubSonicService" type="SubSonic.SubSonicSection, SubSonic" allowDefinition="MachineToApplication" restartOnExternalChanges="true" requirePermission="false"/>
11 <section name="ExtAspNet" type="ExtAspNet.ConfigSection, ExtAspNet"/>
12 </configSections>
13 <ExtAspNet EnableBigFont="true" DebugMode="true" />
14
15 <connectionStrings>
16 <add name="OraSurvey" connectionString="Password=zhangyi;Persist Security Info=True;User ID=liurong;Data Source=vmdb"/>
17 </connectionStrings>
18
19 <SubSonicService defaultProvider="OraSurvey" enableTrace="false" templateDirectory="">
20 <providers>
21 <clear/>
22 <add name="OraSurvey" type="SubSonic.OracleDataProvider, SubSonic" connectionStringName="OraSurvey" generatedNamespace="OraSurvey.DAO" removeUnderscores="true" spClassName="SPs"/>
23 </providers>
24 </SubSonicService>
25
26 <system.web>
27 <pages>
28 <controls>
29 <add assembly="ExtAspNet" namespace="ExtAspNet" tagPrefix="ext"/>
30 </controls>
31 </pages>
32 <httpModules>
33 <add name="ExtAspNetScriptModule" type="ExtAspNet.ScriptModule, ExtAspNet"/>
34 </httpModules>
35 <httpHandlers>
36 <add verb="GET" path="res.axd" type="ExtAspNet.ResourceHandler, ExtAspNet"/>
37 </httpHandlers>
38 <compilation debug="true" targetFramework="4.0" />
39 </system.web>
40
41 </configuration>

3、運行配置好的Susonic工具OraSubsonic,自動生成Subsonic文件

4、復制AppBox中Helper、Util和pagebase.cs;最后將main.aspx,復制到OraSuvey.Web中,然后根據生成,根據錯誤提示進行修改

需要注意的是Sql server 中有int,但oracle中均定義的是number,因此需要把int 都替換為decimal;

最后運行吧,可以使用了;

這里的源代碼僅是程序部分,關於數據庫的創建,請參看“ExtAspNet學習-利用AppBox框架快速創建項目(二)-創建Oralce數據庫

在這里下載源代碼


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM