SlideShare a Scribd company logo
現在,在 OO 的程式語言框架下,不管是元件、模組 皆由 Class 所以
定義,所以均會使用到 OO 的好處。
會有的差別在於,元件(語言/平台(x64/x86)/OS)的不同、UI 元件、非 UI元件
private void Page_Load(System.Object sender, System.EventArgs e)
{
if (!IsPostBack)
{
RoleFunProperty role = null;
if (ViewState["RoleFunProperty"] == null)
{
RoleFunProperty rfP = new RoleFunProperty();
DataTable dtPermission = sqlDt(Sql);
DataRow dr = null;
foreach (DataRow dr_loopVariable in dtPermission.Rows)
{
dr = dr_loopVariable;
rfP.RF_FunQuery = (dr["RF_FunQuery"] == DBNull.Value ? false : bool.Parse(dr["RF_FunQuery"].ToString()));
rfP.RF_FunAdd = (dr["RF_FunAdd"] == DBNull.Value ? false : bool.Parse(dr["RF_FunAdd"].ToString()));
rfP.RF_FunUpdate = (dr["RF_FunUpdate"] == DBNull.Value ? false : bool.Parse(dr["RF_FunUpdate"].ToString()));
rfP.RF_FunDel = (dr["RF_FunDel"] == DBNull.Value ? false : bool.Parse(dr["RF_FunDel"].ToString()));
rfP.RF_FunPrint = (dr["RF_FunPrint"] == DBNull.Value ? false : bool.Parse(dr["RF_FunPrint"].ToString()));
}
}
else
rfP = (RoleFunProperty)ViewState["RoleFunProperty"];
if (!rfP.RF_FunAdd)
{
btnAdd.Enabled = false;
btnAdd.ToolTip = "目前使用者無新增權限";
}
}
}
protected RoleFunProperty GetFuncPermission()
{
string UR_RMRoleID = Session["UR_RMRoleID"].ToString();
string id = MenuID;
string Sql = "select * from RoleFun RF " + "where RF.RF_RMRoleId='" + UR_RMRoleID + "' " + "AND RF.RF_MCId=" + id;
if (id == null | string.IsNullOrEmpty(id))
{
return null;
}
RoleFunProperty rfP = new RoleFunProperty();
DataTable dtPermission = sqlDt(Sql);
DataRow dr = null;
foreach (DataRow dr_loopVariable in dtPermission.Rows)
{
dr = dr_loopVariable;
rfP.RF_FunQuery = (dr["RF_FunQuery"] == DBNull.Value ? false : bool.Parse(dr["RF_FunQuery"].ToString()));
rfP.RF_FunAdd = (dr["RF_FunAdd"] == DBNull.Value ? false : bool.Parse(dr["RF_FunAdd"].ToString())); rfP.RF_FunUpdate = (dr["RF_FunUpdate"
] == DBNull.Value ? false : bool.Parse(dr["RF_FunUpdate"].ToString()));
rfP.RF_FunDel = (dr["RF_FunDel"] == DBNull.Value ? false : bool.Parse(dr["RF_FunDel"].ToString()));
rfP.RF_FunPrint = (dr["RF_FunPrint"] == DBNull.Value ? false : bool.Parse(dr["RF_FunPrint"].ToString()));
}
return rfP;
}
protected bool GetAddButtonSecurity()
{
RoleFunProperty role = null;
if (ViewState["RoleFunProperty"] == null)
role = GetFuncPermission();
else
role = (RoleFunProperty)ViewState["RoleFunProperty"];
return role.RF_FunAdd;
}
protected RoleFunProperty GetAndKeepFuncPermission()
{
RoleFunProperty role = null;
if (ViewState["RoleFunProperty"] == null)
role = GetFuncPermission();
else
role = (RoleFunProperty)ViewState["RoleFunProperty"];
return role;
}
/// <summary>
/// 取得新增按鈕權限
/// </summary>
/// <returns></returns>
protected bool GetAddButtonSecurity()
{
RoleFunProperty role = GetAndKeepFuncPermission();
return role.RF_FunAdd;
}
/// <summary>
/// 取得修改按鈕權限
/// </summary>
/// <returns></returns>
protected bool GetUpdateButtonSecurity()
{
RoleFunProperty role = GetAndKeepFuncPermission();
return role.RF_FunUpdate;
}
/// <summary>
/// 取得刪除按鈕權限
/// </summary>
/// <returns></returns>
protected bool GetDelButtonSecurity()
{
RoleFunProperty role = GetAndKeepFuncPermission();
return role.RF_FunDel;
}
程式碼不僅較為乾淨
也更具彈性,擴充性、可維護性
也都提高
這裡只有欄位
View
View
• Implementing the Repository and Unit of Work Patterns in an ASP.NET MVC
Application (9 of 10)
http://www.asp.net/mvc/overview/older-versions/getting-started-with-ef-5-using-mvc-
4/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application
http://openhome.cc/Gossip/DesignPattern/
• Learn About ASP.NET MVC
http://www.asp.net/mvc
• Visual Studio UML 軟體工程 (OOA/OOD 塑模化應用程式設計)
http://gelis-dotnet.blogspot.tw/2011/03/visual-studio-2010.html
• Gelis 技術隨筆-架構設計系列
http://www.dotblogs.com.tw/gelis/Tags/%e8%bb%9f%e9%ab%94%e6%9e%b6%e6%a7%8b
%e8%a8%ad%e8%a8%88/default.aspx
如何將現有 Web form 轉換到mvc

More Related Content

What's hot

MongoDB Configパラメータ解説
MongoDB Configパラメータ解説MongoDB Configパラメータ解説
MongoDB Configパラメータ解説
Shoken Fujisaki
 
Les bases pour utiliser SPARQL
Les bases pour utiliser SPARQLLes bases pour utiliser SPARQL
Les bases pour utiliser SPARQL
BorderCloud
 
オープンデータなんかでよく使うTurtle形式なんだけどXMLと違ってどう便利なの?
オープンデータなんかでよく使うTurtle形式なんだけどXMLと違ってどう便利なの?オープンデータなんかでよく使うTurtle形式なんだけどXMLと違ってどう便利なの?
オープンデータなんかでよく使うTurtle形式なんだけどXMLと違ってどう便利なの?
Tomoya Shimaguchi
 
Apache Airflow 概要(Airflowの基礎を学ぶハンズオンワークショップ 発表資料)
Apache Airflow 概要(Airflowの基礎を学ぶハンズオンワークショップ 発表資料)Apache Airflow 概要(Airflowの基礎を学ぶハンズオンワークショップ 発表資料)
Apache Airflow 概要(Airflowの基礎を学ぶハンズオンワークショップ 発表資料)
NTT DATA Technology & Innovation
 
今更聞けない!?Microsoft Graph で始める Office 365 データ活用と事例の紹介
今更聞けない!?Microsoft Graph で始める Office 365 データ活用と事例の紹介今更聞けない!?Microsoft Graph で始める Office 365 データ活用と事例の紹介
今更聞けない!?Microsoft Graph で始める Office 365 データ活用と事例の紹介
Kenichiro Nakamura
 
LOD連続講義 第5回「LODの作り方・使い方」
LOD連続講義 第5回「LODの作り方・使い方」LOD連続講義 第5回「LODの作り方・使い方」
LOD連続講義 第5回「LODの作り方・使い方」
Fuyuko Matsumura
 
C++でNVMeと(*´Д`)ハァハァ 戯れていたら一年経ってた。
C++でNVMeと(*´Д`)ハァハァ 戯れていたら一年経ってた。C++でNVMeと(*´Д`)ハァハァ 戯れていたら一年経ってた。
C++でNVMeと(*´Д`)ハァハァ 戯れていたら一年経ってた。
hiyohiyo
 
CPX Tokyo 2019 のDay 1 - 今さら聞けないAnaplanの超入門<概要編>
CPX Tokyo 2019 のDay 1 - 今さら聞けないAnaplanの超入門<概要編>CPX Tokyo 2019 のDay 1 - 今さら聞けないAnaplanの超入門<概要編>
CPX Tokyo 2019 のDay 1 - 今さら聞けないAnaplanの超入門<概要編>
Anaplanジャパン株式会社
 
Web エンジニアが postgre sql を選ぶ 3 つの理由
Web エンジニアが postgre sql を選ぶ 3 つの理由Web エンジニアが postgre sql を選ぶ 3 つの理由
Web エンジニアが postgre sql を選ぶ 3 つの理由
Soudai Sone
 
設計してますか?
設計してますか?設計してますか?
設計してますか?
ke-m kamekoopa
 
PlaySQLAlchemyORM2017.key
PlaySQLAlchemyORM2017.keyPlaySQLAlchemyORM2017.key
PlaySQLAlchemyORM2017.key
泰 増田
 
Fess/Elasticsearchを使った業務で使える?全文検索への道
Fess/Elasticsearchを使った業務で使える?全文検索への道Fess/Elasticsearchを使った業務で使える?全文検索への道
Fess/Elasticsearchを使った業務で使える?全文検索への道
Shinsuke Sugaya
 
PacemakerのMaster/Slave構成の基本と事例紹介(DRBD、PostgreSQLレプリケーション) @Open Source Confer...
PacemakerのMaster/Slave構成の基本と事例紹介(DRBD、PostgreSQLレプリケーション) @Open Source Confer...PacemakerのMaster/Slave構成の基本と事例紹介(DRBD、PostgreSQLレプリケーション) @Open Source Confer...
PacemakerのMaster/Slave構成の基本と事例紹介(DRBD、PostgreSQLレプリケーション) @Open Source Confer...
Tatsuya Watanabe
 
Cours python avancé
Cours python avancéCours python avancé
Cours python avancépierrepo
 
Cours JavaScript
Cours JavaScriptCours JavaScript
Cours JavaScript
Olivier Le Goaër
 
Keycloak & midPoint の紹介
Keycloak & midPoint の紹介Keycloak & midPoint の紹介
Keycloak & midPoint の紹介
Hiroyuki Wada
 
[C16] インメモリ分散KVSの弱点。一貫性が崩れる原因と、それを克服する技術とは? by Taichi Umeda
[C16] インメモリ分散KVSの弱点。一貫性が崩れる原因と、それを克服する技術とは? by Taichi Umeda[C16] インメモリ分散KVSの弱点。一貫性が崩れる原因と、それを克服する技術とは? by Taichi Umeda
[C16] インメモリ分散KVSの弱点。一貫性が崩れる原因と、それを克服する技術とは? by Taichi UmedaInsight Technology, Inc.
 
大規模データ処理基盤における MLOpsについて.pdf
大規模データ処理基盤における MLOpsについて.pdf大規模データ処理基盤における MLOpsについて.pdf
大規模データ処理基盤における MLOpsについて.pdf
NTTDOCOMO-ServiceInnovation
 
トランザクションスクリプトのすすめ
トランザクションスクリプトのすすめトランザクションスクリプトのすすめ
トランザクションスクリプトのすすめ
pospome
 

What's hot (20)

MongoDB Configパラメータ解説
MongoDB Configパラメータ解説MongoDB Configパラメータ解説
MongoDB Configパラメータ解説
 
Les bases pour utiliser SPARQL
Les bases pour utiliser SPARQLLes bases pour utiliser SPARQL
Les bases pour utiliser SPARQL
 
オープンデータなんかでよく使うTurtle形式なんだけどXMLと違ってどう便利なの?
オープンデータなんかでよく使うTurtle形式なんだけどXMLと違ってどう便利なの?オープンデータなんかでよく使うTurtle形式なんだけどXMLと違ってどう便利なの?
オープンデータなんかでよく使うTurtle形式なんだけどXMLと違ってどう便利なの?
 
Apache Airflow 概要(Airflowの基礎を学ぶハンズオンワークショップ 発表資料)
Apache Airflow 概要(Airflowの基礎を学ぶハンズオンワークショップ 発表資料)Apache Airflow 概要(Airflowの基礎を学ぶハンズオンワークショップ 発表資料)
Apache Airflow 概要(Airflowの基礎を学ぶハンズオンワークショップ 発表資料)
 
今更聞けない!?Microsoft Graph で始める Office 365 データ活用と事例の紹介
今更聞けない!?Microsoft Graph で始める Office 365 データ活用と事例の紹介今更聞けない!?Microsoft Graph で始める Office 365 データ活用と事例の紹介
今更聞けない!?Microsoft Graph で始める Office 365 データ活用と事例の紹介
 
LOD連続講義 第5回「LODの作り方・使い方」
LOD連続講義 第5回「LODの作り方・使い方」LOD連続講義 第5回「LODの作り方・使い方」
LOD連続講義 第5回「LODの作り方・使い方」
 
C++でNVMeと(*´Д`)ハァハァ 戯れていたら一年経ってた。
C++でNVMeと(*´Д`)ハァハァ 戯れていたら一年経ってた。C++でNVMeと(*´Д`)ハァハァ 戯れていたら一年経ってた。
C++でNVMeと(*´Д`)ハァハァ 戯れていたら一年経ってた。
 
CPX Tokyo 2019 のDay 1 - 今さら聞けないAnaplanの超入門<概要編>
CPX Tokyo 2019 のDay 1 - 今さら聞けないAnaplanの超入門<概要編>CPX Tokyo 2019 のDay 1 - 今さら聞けないAnaplanの超入門<概要編>
CPX Tokyo 2019 のDay 1 - 今さら聞けないAnaplanの超入門<概要編>
 
iostatの見方
iostatの見方iostatの見方
iostatの見方
 
Web エンジニアが postgre sql を選ぶ 3 つの理由
Web エンジニアが postgre sql を選ぶ 3 つの理由Web エンジニアが postgre sql を選ぶ 3 つの理由
Web エンジニアが postgre sql を選ぶ 3 つの理由
 
設計してますか?
設計してますか?設計してますか?
設計してますか?
 
PlaySQLAlchemyORM2017.key
PlaySQLAlchemyORM2017.keyPlaySQLAlchemyORM2017.key
PlaySQLAlchemyORM2017.key
 
Fess/Elasticsearchを使った業務で使える?全文検索への道
Fess/Elasticsearchを使った業務で使える?全文検索への道Fess/Elasticsearchを使った業務で使える?全文検索への道
Fess/Elasticsearchを使った業務で使える?全文検索への道
 
PacemakerのMaster/Slave構成の基本と事例紹介(DRBD、PostgreSQLレプリケーション) @Open Source Confer...
PacemakerのMaster/Slave構成の基本と事例紹介(DRBD、PostgreSQLレプリケーション) @Open Source Confer...PacemakerのMaster/Slave構成の基本と事例紹介(DRBD、PostgreSQLレプリケーション) @Open Source Confer...
PacemakerのMaster/Slave構成の基本と事例紹介(DRBD、PostgreSQLレプリケーション) @Open Source Confer...
 
Cours python avancé
Cours python avancéCours python avancé
Cours python avancé
 
Cours JavaScript
Cours JavaScriptCours JavaScript
Cours JavaScript
 
Keycloak & midPoint の紹介
Keycloak & midPoint の紹介Keycloak & midPoint の紹介
Keycloak & midPoint の紹介
 
[C16] インメモリ分散KVSの弱点。一貫性が崩れる原因と、それを克服する技術とは? by Taichi Umeda
[C16] インメモリ分散KVSの弱点。一貫性が崩れる原因と、それを克服する技術とは? by Taichi Umeda[C16] インメモリ分散KVSの弱点。一貫性が崩れる原因と、それを克服する技術とは? by Taichi Umeda
[C16] インメモリ分散KVSの弱点。一貫性が崩れる原因と、それを克服する技術とは? by Taichi Umeda
 
大規模データ処理基盤における MLOpsについて.pdf
大規模データ処理基盤における MLOpsについて.pdf大規模データ処理基盤における MLOpsについて.pdf
大規模データ処理基盤における MLOpsについて.pdf
 
トランザクションスクリプトのすすめ
トランザクションスクリプトのすすめトランザクションスクリプトのすすめ
トランザクションスクリプトのすすめ
 

Viewers also liked

2016 ModernWeb 分享 - 恰如其分 MySQL 程式設計 (修)
2016 ModernWeb 分享 - 恰如其分 MySQL 程式設計 (修)2016 ModernWeb 分享 - 恰如其分 MySQL 程式設計 (修)
2016 ModernWeb 分享 - 恰如其分 MySQL 程式設計 (修)
Win Yu
 
ASP.NET MVC 5 新功能探索
ASP.NET MVC 5 新功能探索ASP.NET MVC 5 新功能探索
ASP.NET MVC 5 新功能探索
Will Huang
 
Learning django step 1
Learning django step 1Learning django step 1
Learning django step 1永昇 陳
 
保哥線上講堂:LINQ 快速上手
保哥線上講堂:LINQ 快速上手保哥線上講堂:LINQ 快速上手
保哥線上講堂:LINQ 快速上手
Will Huang
 
恰如其分的 MySQL 設計技巧 [Modern Web 2016]
恰如其分的 MySQL 設計技巧 [Modern Web 2016]恰如其分的 MySQL 設計技巧 [Modern Web 2016]
恰如其分的 MySQL 設計技巧 [Modern Web 2016]
Yi-Feng Tzeng
 
大型 Web Application 轉移到 微服務的經驗分享
大型 Web Application 轉移到微服務的經驗分享大型 Web Application 轉移到微服務的經驗分享
大型 Web Application 轉移到 微服務的經驗分享
Andrew Wu
 
MySQL数据库设计、优化
MySQL数据库设计、优化MySQL数据库设计、优化
MySQL数据库设计、优化
Jinrong Ye
 
MySQL技术分享:一步到位实现mysql优化
MySQL技术分享:一步到位实现mysql优化MySQL技术分享:一步到位实现mysql优化
MySQL技术分享:一步到位实现mysql优化
Jinrong Ye
 
2016年逢甲大學資訊系:ASP.NET MVC 4 教育訓練1(20160222)
2016年逢甲大學資訊系:ASP.NET MVC 4 教育訓練1(20160222)2016年逢甲大學資訊系:ASP.NET MVC 4 教育訓練1(20160222)
2016年逢甲大學資訊系:ASP.NET MVC 4 教育訓練1(20160222)
Duran Hsieh
 
無瑕的程式碼 Clean Code 心得分享
無瑕的程式碼 Clean Code 心得分享無瑕的程式碼 Clean Code 心得分享
無瑕的程式碼 Clean Code 心得分享
Win Yu
 
團隊開發永遠的痛 談導入團隊開發的共同規範(Final)
團隊開發永遠的痛   談導入團隊開發的共同規範(Final)團隊開發永遠的痛   談導入團隊開發的共同規範(Final)
團隊開發永遠的痛 談導入團隊開發的共同規範(Final)
Gelis Wu
 
活用 Application insight
活用 Application insight活用 Application insight
活用 Application insight
Gelis Wu
 
Css java script 前端網頁設計概論(day2).pics
Css java script 前端網頁設計概論(day2).picsCss java script 前端網頁設計概論(day2).pics
Css java script 前端網頁設計概論(day2).pics
Gelis Wu
 
企業現代化網站架構
企業現代化網站架構企業現代化網站架構
企業現代化網站架構
Gelis Wu
 
面向未来的重构
面向未来的重构面向未来的重构
面向未来的重构Kejun Zhang
 
一拍一产品背后的故事(React实战)
一拍一产品背后的故事(React实战)一拍一产品背后的故事(React实战)
一拍一产品背后的故事(React实战)
Kejun Zhang
 
高粒度模块化的前端开发
高粒度模块化的前端开发高粒度模块化的前端开发
高粒度模块化的前端开发
iddcn
 
Ued交流会 《用户体验杂谈》
Ued交流会 《用户体验杂谈》Ued交流会 《用户体验杂谈》
Ued交流会 《用户体验杂谈》
iddcn
 
N-layer design & development
N-layer design & developmentN-layer design & development
N-layer design & development
Xuefeng Zhang
 

Viewers also liked (20)

2016 ModernWeb 分享 - 恰如其分 MySQL 程式設計 (修)
2016 ModernWeb 分享 - 恰如其分 MySQL 程式設計 (修)2016 ModernWeb 分享 - 恰如其分 MySQL 程式設計 (修)
2016 ModernWeb 分享 - 恰如其分 MySQL 程式設計 (修)
 
ASP.NET MVC 5 新功能探索
ASP.NET MVC 5 新功能探索ASP.NET MVC 5 新功能探索
ASP.NET MVC 5 新功能探索
 
Learning django step 1
Learning django step 1Learning django step 1
Learning django step 1
 
保哥線上講堂:LINQ 快速上手
保哥線上講堂:LINQ 快速上手保哥線上講堂:LINQ 快速上手
保哥線上講堂:LINQ 快速上手
 
恰如其分的 MySQL 設計技巧 [Modern Web 2016]
恰如其分的 MySQL 設計技巧 [Modern Web 2016]恰如其分的 MySQL 設計技巧 [Modern Web 2016]
恰如其分的 MySQL 設計技巧 [Modern Web 2016]
 
大型 Web Application 轉移到 微服務的經驗分享
大型 Web Application 轉移到微服務的經驗分享大型 Web Application 轉移到微服務的經驗分享
大型 Web Application 轉移到 微服務的經驗分享
 
MySQL数据库设计、优化
MySQL数据库设计、优化MySQL数据库设计、优化
MySQL数据库设计、优化
 
MySQL技术分享:一步到位实现mysql优化
MySQL技术分享:一步到位实现mysql优化MySQL技术分享:一步到位实现mysql优化
MySQL技术分享:一步到位实现mysql优化
 
2016年逢甲大學資訊系:ASP.NET MVC 4 教育訓練1(20160222)
2016年逢甲大學資訊系:ASP.NET MVC 4 教育訓練1(20160222)2016年逢甲大學資訊系:ASP.NET MVC 4 教育訓練1(20160222)
2016年逢甲大學資訊系:ASP.NET MVC 4 教育訓練1(20160222)
 
無瑕的程式碼 Clean Code 心得分享
無瑕的程式碼 Clean Code 心得分享無瑕的程式碼 Clean Code 心得分享
無瑕的程式碼 Clean Code 心得分享
 
團隊開發永遠的痛 談導入團隊開發的共同規範(Final)
團隊開發永遠的痛   談導入團隊開發的共同規範(Final)團隊開發永遠的痛   談導入團隊開發的共同規範(Final)
團隊開發永遠的痛 談導入團隊開發的共同規範(Final)
 
活用 Application insight
活用 Application insight活用 Application insight
活用 Application insight
 
Css java script 前端網頁設計概論(day2).pics
Css java script 前端網頁設計概論(day2).picsCss java script 前端網頁設計概論(day2).pics
Css java script 前端網頁設計概論(day2).pics
 
企業現代化網站架構
企業現代化網站架構企業現代化網站架構
企業現代化網站架構
 
F2e @ douban
F2e @ doubanF2e @ douban
F2e @ douban
 
面向未来的重构
面向未来的重构面向未来的重构
面向未来的重构
 
一拍一产品背后的故事(React实战)
一拍一产品背后的故事(React实战)一拍一产品背后的故事(React实战)
一拍一产品背后的故事(React实战)
 
高粒度模块化的前端开发
高粒度模块化的前端开发高粒度模块化的前端开发
高粒度模块化的前端开发
 
Ued交流会 《用户体验杂谈》
Ued交流会 《用户体验杂谈》Ued交流会 《用户体验杂谈》
Ued交流会 《用户体验杂谈》
 
N-layer design & development
N-layer design & developmentN-layer design & development
N-layer design & development
 

Similar to 如何將現有 Web form 轉換到mvc

Txjs
TxjsTxjs
What's New In C# 7
What's New In C# 7What's New In C# 7
What's New In C# 7
Paulo Morgado
 
Php radomize
Php radomizePhp radomize
Php radomize
do_aki
 
Thumbtack Expertise Days # 5 - Javaz
Thumbtack Expertise Days # 5 - JavazThumbtack Expertise Days # 5 - Javaz
Thumbtack Expertise Days # 5 - Javaz
Alexey Remnev
 
Native interfaces for R
Native interfaces for RNative interfaces for R
Native interfaces for R
Seth Falcon
 
ekb.py - Python VS ...
ekb.py - Python VS ...ekb.py - Python VS ...
ekb.py - Python VS ...
it-people
 
deepjs - tools for better programming
deepjs - tools for better programmingdeepjs - tools for better programming
deepjs - tools for better programming
nomocas
 
Beyond java8
Beyond java8Beyond java8
Beyond java8
Muhammad Durrah
 
Javascript fundamentals for php developers
Javascript fundamentals for php developersJavascript fundamentals for php developers
Javascript fundamentals for php developers
Chris Ramakers
 
Quebec pdo
Quebec pdoQuebec pdo
Quebec pdo
Valentine Dianov
 
A Sceptical Guide to Functional Programming
A Sceptical Guide to Functional ProgrammingA Sceptical Guide to Functional Programming
A Sceptical Guide to Functional ProgrammingGarth Gilmour
 
Thinking Functionally with JavaScript
Thinking Functionally with JavaScriptThinking Functionally with JavaScript
Thinking Functionally with JavaScript
Luis Atencio
 
Functional programming with php7
Functional programming with php7Functional programming with php7
Functional programming with php7
Sérgio Rafael Siqueira
 
Javaz. Functional design in Java 8.
Javaz. Functional design in Java 8.Javaz. Functional design in Java 8.
Javaz. Functional design in Java 8.
Vadim Dubs
 
The most exciting features of PHP 7.1
The most exciting features of PHP 7.1The most exciting features of PHP 7.1
The most exciting features of PHP 7.1
Zend by Rogue Wave Software
 
JSConf: All You Can Leet
JSConf: All You Can LeetJSConf: All You Can Leet
JSConf: All You Can Leet
johndaviddalton
 
Intro to scala
Intro to scalaIntro to scala
Intro to scalaJoe Zulli
 
05 pig user defined functions (udfs)
05 pig user defined functions (udfs)05 pig user defined functions (udfs)
05 pig user defined functions (udfs)
Subhas Kumar Ghosh
 

Similar to 如何將現有 Web form 轉換到mvc (20)

Txjs
TxjsTxjs
Txjs
 
What's New In C# 7
What's New In C# 7What's New In C# 7
What's New In C# 7
 
Php & my sql
Php & my sqlPhp & my sql
Php & my sql
 
Php radomize
Php radomizePhp radomize
Php radomize
 
Thumbtack Expertise Days # 5 - Javaz
Thumbtack Expertise Days # 5 - JavazThumbtack Expertise Days # 5 - Javaz
Thumbtack Expertise Days # 5 - Javaz
 
Native interfaces for R
Native interfaces for RNative interfaces for R
Native interfaces for R
 
ekb.py - Python VS ...
ekb.py - Python VS ...ekb.py - Python VS ...
ekb.py - Python VS ...
 
deepjs - tools for better programming
deepjs - tools for better programmingdeepjs - tools for better programming
deepjs - tools for better programming
 
Beyond java8
Beyond java8Beyond java8
Beyond java8
 
Javascript fundamentals for php developers
Javascript fundamentals for php developersJavascript fundamentals for php developers
Javascript fundamentals for php developers
 
Quebec pdo
Quebec pdoQuebec pdo
Quebec pdo
 
A Sceptical Guide to Functional Programming
A Sceptical Guide to Functional ProgrammingA Sceptical Guide to Functional Programming
A Sceptical Guide to Functional Programming
 
Thinking Functionally with JavaScript
Thinking Functionally with JavaScriptThinking Functionally with JavaScript
Thinking Functionally with JavaScript
 
Functional programming with php7
Functional programming with php7Functional programming with php7
Functional programming with php7
 
Javaz. Functional design in Java 8.
Javaz. Functional design in Java 8.Javaz. Functional design in Java 8.
Javaz. Functional design in Java 8.
 
The most exciting features of PHP 7.1
The most exciting features of PHP 7.1The most exciting features of PHP 7.1
The most exciting features of PHP 7.1
 
JSConf: All You Can Leet
JSConf: All You Can LeetJSConf: All You Can Leet
JSConf: All You Can Leet
 
Quebec pdo
Quebec pdoQuebec pdo
Quebec pdo
 
Intro to scala
Intro to scalaIntro to scala
Intro to scala
 
05 pig user defined functions (udfs)
05 pig user defined functions (udfs)05 pig user defined functions (udfs)
05 pig user defined functions (udfs)
 

More from Gelis Wu

Blazor in NET 8 的重大改變___________________
Blazor in NET 8 的重大改變___________________Blazor in NET 8 的重大改變___________________
Blazor in NET 8 的重大改變___________________
Gelis Wu
 
.NET 7 升級教戰手冊_V1.0.pdf
.NET 7 升級教戰手冊_V1.0.pdf.NET 7 升級教戰手冊_V1.0.pdf
.NET 7 升級教戰手冊_V1.0.pdf
Gelis Wu
 
顧問養成秘技 - 顧問服務實戰.pptx
顧問養成秘技 - 顧問服務實戰.pptx顧問養成秘技 - 顧問服務實戰.pptx
顧問養成秘技 - 顧問服務實戰.pptx
Gelis Wu
 
Net 6 的 blazor 開發新視界
Net 6 的 blazor 開發新視界Net 6 的 blazor 開發新視界
Net 6 的 blazor 開發新視界
Gelis Wu
 
軟體架構設計的技術養成之路
軟體架構設計的技術養成之路軟體架構設計的技術養成之路
軟體架構設計的技術養成之路
Gelis Wu
 
深入淺出領域驅動設計:以 .NET 5 與線上房貸申請系統為例
深入淺出領域驅動設計:以 .NET 5 與線上房貸申請系統為例深入淺出領域驅動設計:以 .NET 5 與線上房貸申請系統為例
深入淺出領域驅動設計:以 .NET 5 與線上房貸申請系統為例
Gelis Wu
 
Blazor Component 開發實戰
Blazor Component 開發實戰Blazor Component 開發實戰
Blazor Component 開發實戰
Gelis Wu
 
實踐 Clean Architecture(實作高可用性的軟件架構)
實踐 Clean Architecture(實作高可用性的軟件架構)實踐 Clean Architecture(實作高可用性的軟件架構)
實踐 Clean Architecture(實作高可用性的軟件架構)
Gelis Wu
 
該準備從 .NET Framework 4.x 遷移至 .NET Core 3.0 了嗎?
該準備從 .NET Framework 4.x 遷移至 .NET Core 3.0 了嗎?該準備從 .NET Framework 4.x 遷移至 .NET Core 3.0 了嗎?
該準備從 .NET Framework 4.x 遷移至 .NET Core 3.0 了嗎?
Gelis Wu
 
專業顧問的技能成長日記
專業顧問的技能成長日記專業顧問的技能成長日記
專業顧問的技能成長日記
Gelis Wu
 
你的軟體架構夠敏捷嗎?
你的軟體架構夠敏捷嗎?你的軟體架構夠敏捷嗎?
你的軟體架構夠敏捷嗎?
Gelis Wu
 
使用 .NET Standard 開發跨平台應用程式
使用 .NET Standard 開發跨平台應用程式使用 .NET Standard 開發跨平台應用程式
使用 .NET Standard 開發跨平台應用程式
Gelis Wu
 
一個 ASP.NET Core 2.1 開發指南
一個 ASP.NET Core 2.1 開發指南一個 ASP.NET Core 2.1 開發指南
一個 ASP.NET Core 2.1 開發指南
Gelis Wu
 
前端大型系統的基石 TypeScript
前端大型系統的基石 TypeScript前端大型系統的基石 TypeScript
前端大型系統的基石 TypeScript
Gelis Wu
 
Dot netstandard2.0與.net的未來發展
Dot netstandard2.0與.net的未來發展Dot netstandard2.0與.net的未來發展
Dot netstandard2.0與.net的未來發展
Gelis Wu
 
客製化的 Web api 的框架設計
客製化的 Web api 的框架設計客製化的 Web api 的框架設計
客製化的 Web api 的框架設計
Gelis Wu
 
Asp.net identity 2.0
Asp.net identity 2.0Asp.net identity 2.0
Asp.net identity 2.0
Gelis Wu
 
Asp.net mvc 基礎
Asp.net mvc 基礎Asp.net mvc 基礎
Asp.net mvc 基礎
Gelis Wu
 
架構設計好簡單系列 設計符合團隊的範本精靈 (Project template)
架構設計好簡單系列   設計符合團隊的範本精靈 (Project template)架構設計好簡單系列   設計符合團隊的範本精靈 (Project template)
架構設計好簡單系列 設計符合團隊的範本精靈 (Project template)
Gelis Wu
 
Azure PaaS (WebApp & SQL Database) workshop solution
Azure PaaS (WebApp & SQL Database) workshop solutionAzure PaaS (WebApp & SQL Database) workshop solution
Azure PaaS (WebApp & SQL Database) workshop solution
Gelis Wu
 

More from Gelis Wu (20)

Blazor in NET 8 的重大改變___________________
Blazor in NET 8 的重大改變___________________Blazor in NET 8 的重大改變___________________
Blazor in NET 8 的重大改變___________________
 
.NET 7 升級教戰手冊_V1.0.pdf
.NET 7 升級教戰手冊_V1.0.pdf.NET 7 升級教戰手冊_V1.0.pdf
.NET 7 升級教戰手冊_V1.0.pdf
 
顧問養成秘技 - 顧問服務實戰.pptx
顧問養成秘技 - 顧問服務實戰.pptx顧問養成秘技 - 顧問服務實戰.pptx
顧問養成秘技 - 顧問服務實戰.pptx
 
Net 6 的 blazor 開發新視界
Net 6 的 blazor 開發新視界Net 6 的 blazor 開發新視界
Net 6 的 blazor 開發新視界
 
軟體架構設計的技術養成之路
軟體架構設計的技術養成之路軟體架構設計的技術養成之路
軟體架構設計的技術養成之路
 
深入淺出領域驅動設計:以 .NET 5 與線上房貸申請系統為例
深入淺出領域驅動設計:以 .NET 5 與線上房貸申請系統為例深入淺出領域驅動設計:以 .NET 5 與線上房貸申請系統為例
深入淺出領域驅動設計:以 .NET 5 與線上房貸申請系統為例
 
Blazor Component 開發實戰
Blazor Component 開發實戰Blazor Component 開發實戰
Blazor Component 開發實戰
 
實踐 Clean Architecture(實作高可用性的軟件架構)
實踐 Clean Architecture(實作高可用性的軟件架構)實踐 Clean Architecture(實作高可用性的軟件架構)
實踐 Clean Architecture(實作高可用性的軟件架構)
 
該準備從 .NET Framework 4.x 遷移至 .NET Core 3.0 了嗎?
該準備從 .NET Framework 4.x 遷移至 .NET Core 3.0 了嗎?該準備從 .NET Framework 4.x 遷移至 .NET Core 3.0 了嗎?
該準備從 .NET Framework 4.x 遷移至 .NET Core 3.0 了嗎?
 
專業顧問的技能成長日記
專業顧問的技能成長日記專業顧問的技能成長日記
專業顧問的技能成長日記
 
你的軟體架構夠敏捷嗎?
你的軟體架構夠敏捷嗎?你的軟體架構夠敏捷嗎?
你的軟體架構夠敏捷嗎?
 
使用 .NET Standard 開發跨平台應用程式
使用 .NET Standard 開發跨平台應用程式使用 .NET Standard 開發跨平台應用程式
使用 .NET Standard 開發跨平台應用程式
 
一個 ASP.NET Core 2.1 開發指南
一個 ASP.NET Core 2.1 開發指南一個 ASP.NET Core 2.1 開發指南
一個 ASP.NET Core 2.1 開發指南
 
前端大型系統的基石 TypeScript
前端大型系統的基石 TypeScript前端大型系統的基石 TypeScript
前端大型系統的基石 TypeScript
 
Dot netstandard2.0與.net的未來發展
Dot netstandard2.0與.net的未來發展Dot netstandard2.0與.net的未來發展
Dot netstandard2.0與.net的未來發展
 
客製化的 Web api 的框架設計
客製化的 Web api 的框架設計客製化的 Web api 的框架設計
客製化的 Web api 的框架設計
 
Asp.net identity 2.0
Asp.net identity 2.0Asp.net identity 2.0
Asp.net identity 2.0
 
Asp.net mvc 基礎
Asp.net mvc 基礎Asp.net mvc 基礎
Asp.net mvc 基礎
 
架構設計好簡單系列 設計符合團隊的範本精靈 (Project template)
架構設計好簡單系列   設計符合團隊的範本精靈 (Project template)架構設計好簡單系列   設計符合團隊的範本精靈 (Project template)
架構設計好簡單系列 設計符合團隊的範本精靈 (Project template)
 
Azure PaaS (WebApp & SQL Database) workshop solution
Azure PaaS (WebApp & SQL Database) workshop solutionAzure PaaS (WebApp & SQL Database) workshop solution
Azure PaaS (WebApp & SQL Database) workshop solution
 

Recently uploaded

Enterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptxEnterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptx
QuickwayInfoSystems3
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
Google
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
ShamsuddeenMuhammadA
 
Pro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp BookPro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp Book
abdulrafaychaudhry
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
Drona Infotech
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)
abdulrafaychaudhry
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 

Recently uploaded (20)

Enterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptxEnterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptx
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
AI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website CreatorAI Genie Review: World’s First Open AI WordPress Website Creator
AI Genie Review: World’s First Open AI WordPress Website Creator
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
 
Pro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp BookPro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp Book
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
Mobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona InfotechMobile App Development Company In Noida | Drona Infotech
Mobile App Development Company In Noida | Drona Infotech
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 

如何將現有 Web form 轉換到mvc

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9. 現在,在 OO 的程式語言框架下,不管是元件、模組 皆由 Class 所以 定義,所以均會使用到 OO 的好處。 會有的差別在於,元件(語言/平台(x64/x86)/OS)的不同、UI 元件、非 UI元件
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28. private void Page_Load(System.Object sender, System.EventArgs e) { if (!IsPostBack) { RoleFunProperty role = null; if (ViewState["RoleFunProperty"] == null) { RoleFunProperty rfP = new RoleFunProperty(); DataTable dtPermission = sqlDt(Sql); DataRow dr = null; foreach (DataRow dr_loopVariable in dtPermission.Rows) { dr = dr_loopVariable; rfP.RF_FunQuery = (dr["RF_FunQuery"] == DBNull.Value ? false : bool.Parse(dr["RF_FunQuery"].ToString())); rfP.RF_FunAdd = (dr["RF_FunAdd"] == DBNull.Value ? false : bool.Parse(dr["RF_FunAdd"].ToString())); rfP.RF_FunUpdate = (dr["RF_FunUpdate"] == DBNull.Value ? false : bool.Parse(dr["RF_FunUpdate"].ToString())); rfP.RF_FunDel = (dr["RF_FunDel"] == DBNull.Value ? false : bool.Parse(dr["RF_FunDel"].ToString())); rfP.RF_FunPrint = (dr["RF_FunPrint"] == DBNull.Value ? false : bool.Parse(dr["RF_FunPrint"].ToString())); } } else rfP = (RoleFunProperty)ViewState["RoleFunProperty"]; if (!rfP.RF_FunAdd) { btnAdd.Enabled = false; btnAdd.ToolTip = "目前使用者無新增權限"; } } }
  • 29. protected RoleFunProperty GetFuncPermission() { string UR_RMRoleID = Session["UR_RMRoleID"].ToString(); string id = MenuID; string Sql = "select * from RoleFun RF " + "where RF.RF_RMRoleId='" + UR_RMRoleID + "' " + "AND RF.RF_MCId=" + id; if (id == null | string.IsNullOrEmpty(id)) { return null; } RoleFunProperty rfP = new RoleFunProperty(); DataTable dtPermission = sqlDt(Sql); DataRow dr = null; foreach (DataRow dr_loopVariable in dtPermission.Rows) { dr = dr_loopVariable; rfP.RF_FunQuery = (dr["RF_FunQuery"] == DBNull.Value ? false : bool.Parse(dr["RF_FunQuery"].ToString())); rfP.RF_FunAdd = (dr["RF_FunAdd"] == DBNull.Value ? false : bool.Parse(dr["RF_FunAdd"].ToString())); rfP.RF_FunUpdate = (dr["RF_FunUpdate" ] == DBNull.Value ? false : bool.Parse(dr["RF_FunUpdate"].ToString())); rfP.RF_FunDel = (dr["RF_FunDel"] == DBNull.Value ? false : bool.Parse(dr["RF_FunDel"].ToString())); rfP.RF_FunPrint = (dr["RF_FunPrint"] == DBNull.Value ? false : bool.Parse(dr["RF_FunPrint"].ToString())); } return rfP; }
  • 30. protected bool GetAddButtonSecurity() { RoleFunProperty role = null; if (ViewState["RoleFunProperty"] == null) role = GetFuncPermission(); else role = (RoleFunProperty)ViewState["RoleFunProperty"]; return role.RF_FunAdd; }
  • 31. protected RoleFunProperty GetAndKeepFuncPermission() { RoleFunProperty role = null; if (ViewState["RoleFunProperty"] == null) role = GetFuncPermission(); else role = (RoleFunProperty)ViewState["RoleFunProperty"]; return role; }
  • 32. /// <summary> /// 取得新增按鈕權限 /// </summary> /// <returns></returns> protected bool GetAddButtonSecurity() { RoleFunProperty role = GetAndKeepFuncPermission(); return role.RF_FunAdd; } /// <summary> /// 取得修改按鈕權限 /// </summary> /// <returns></returns> protected bool GetUpdateButtonSecurity() { RoleFunProperty role = GetAndKeepFuncPermission(); return role.RF_FunUpdate; } /// <summary> /// 取得刪除按鈕權限 /// </summary> /// <returns></returns> protected bool GetDelButtonSecurity() { RoleFunProperty role = GetAndKeepFuncPermission(); return role.RF_FunDel; } 程式碼不僅較為乾淨 也更具彈性,擴充性、可維護性 也都提高
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 44. • Implementing the Repository and Unit of Work Patterns in an ASP.NET MVC Application (9 of 10) http://www.asp.net/mvc/overview/older-versions/getting-started-with-ef-5-using-mvc- 4/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application http://openhome.cc/Gossip/DesignPattern/ • Learn About ASP.NET MVC http://www.asp.net/mvc • Visual Studio UML 軟體工程 (OOA/OOD 塑模化應用程式設計) http://gelis-dotnet.blogspot.tw/2011/03/visual-studio-2010.html • Gelis 技術隨筆-架構設計系列 http://www.dotblogs.com.tw/gelis/Tags/%e8%bb%9f%e9%ab%94%e6%9e%b6%e6%a7%8b %e8%a8%ad%e8%a8%88/default.aspx

Editor's Notes

  1. 我不斷的強調,概念夠的程式設計者,即便撰寫 Web Form,也會很好維護,所以,課程的重點也在於架構設計,並不在於 WebForm 或是 MVC,因為不管是哪一種,我們都希望是一個妥善的、經過分析、設計、職責分離,彼此偶和度低,容易維護、擴展的網站。也不會把它當成 WinForm 來開發。