Sei sulla pagina 1di 32

Framework of AP Infrastructure

Presented by Albert Chiu

May 29 , 2009

October 28, 2008 Page News English


Schedule-1

► Development Requirement
► Conception
► Server side
► Client side
► jQuery

► Utility NameSpace
► BasePage
► CommonDB

October 28, 2008 Page News English


Schedule-2

► EY.SysApInfra
► Define system name(description, get a system id)
► Define a system menu
► Define system roles
► Define system user belong one or more roles
► Define a system menu note vs. role vs. rights
► Define system user agent
► Arguments
► Web.config setting
► EY.SysXXX.Business_Code.SysArgument
► Appendix

October 28, 2008 Page News English


Development Requirement

► Visual studio 2008 SP1 Necessary

► jQueryjs jquery-1.3.1.js
► VsDoc for jQuery jquery-1.3.1-vsdoc.js Optional
► KB958502-JScript Editor support for “-vsdoc.js”
IntelliSense documentation files VS90SP1-KB958502-x86.exe
► jsUtility

October 28, 2008 Page News English


Conception-Server Side

EY.SysXXX
New system development

e.g.Ey.Telerik
EY.SysApInfra

EY.3Party
Setting of every system permission(User-Role-Right)

e.g.Ey.Telerik
EY.3Party
OR
EY.MpWeb
Guiinitial or other control for namespace of sys.web.controls

EY.CommonDB
Access commonDB information

EY.Utility
Utility function library

October 28, 2008 Page News English


Conception-Client Side

XXX.Aspx
javaScript

jQuery jsUtility
jquery-1.3.1.js
*.js

October 28, 2008 Page News English


Conception-Client Side2

► jQuery
► A JavaScript library.
► Write less, do more.
► Work through css standard, Dom of html.
► Less limited with browsers.(IE 6+, Firefox 2.0+, Chrome 1+…)

► jsUtility(Multi JavaScript library files)


► Easy using on some special case.
► CClientInf.js, CEyConfirm.js, CEyCookie.js, CEyMsGridview.js,
CEyString.js, EY_Utility.js, CEyMsGridview.js, CEyString.js,
EY_Utility.js

October 28, 2008 Page News English


Utility Function Library

► EyAd EyEncrypt
► EyAdInf CEyMd5.cs
CyDes.cs
► EyConvert(Data type convert) EyIo
► EyDataRowCell CEyDirectoryInfo.cs
► EyDateTime CEyFileInfo.cs
► EyDecimal EyStringCalculate
► EyDouble CEyStringFile.cs
► … CEyStringPart.cs
CEystringSql.cs
► EyData(Data acceess) EyException
► EyAccess2007 …
► EySql
► EyEmail
► CEyEmail.cs

October 28, 2008 Page News English


BasePage Spirt

► EyPage inherit from System.Web.UI.Page


► EyPage belong to namespace of EY.MpWeb
► Provide methods to deal with cookie, log, exception, javascript
► BasePage inherit from EyPage
► BasePagebelong to namespace of EY.SysXXX.Business_Code
► Customer methods for individual system(project)
► Initialize data connection
► Get the information of logon AD account
► Identify permission of logon user
► Usually use it via call this method, InitObj.

October 28, 2008 Page News English


BasePage example

October 28, 2008 Page News English


BasePage Demo - 1

► Browse code of
► EY.MpWeb.EyPage BasePage architecture
► EY.SysApInfra.Business_Code. BasePage

► EY.SysApInfra.Logon.aspx Normal page application

► EY.SysApInfra. MasterPage.Master
► EY.SysApInfra. MaintainEySystem.aspx Master Page page application

October 28, 2008 Page News English


CommonDB

► AP Infrastructure Data Base:


► Common information(For recognition)
► Non-function information(For authorization)

► Graphic User Interface:


► Function menu(TreeView)
► Permission setting(User-Role-Right vs. Menu-Note)

► AP Interface Method:
► e.g. Ey.ApInfra.GetPerrmission (string p_strSystemName)

October 28, 2008 Page News English


CommonDB Work for user permission operation

APInfrDB
System XXA

Get permission
information System XXB

Initial function
treeview System XXC

.
Ey.CommonDB .
(Method) .

October 28, 2008 Page News English


SysApInfra
Define system name(description) and get a system id

October 28, 2008 Page News English


SysApInfra
Define a system menu

October 28, 2008 Page News English


SysApInfra
Define system roles

October 28, 2008 Page News English


SysApInfra
Define system user belong one or more roles - 1

October 28, 2008 Page News English


SysApInfra
Define system user belong one or more roles - 2

October 28, 2008 Page News English


SysApInfra
Define system user agent

October 28, 2008 Page News English


SysApInfra
Define a system menu note vs. role vs. rights

October 28, 2008 Page News English


SysApInfra
Demo permission effection-1

October 28, 2008 Page News English


SysApInfra
Demo permission effection-2

October 28, 2008 Page News English


SysApInfra
Demo permission effection-3

October 28, 2008 Page News English


SysApInfra
Demo permission effection-4

October 28, 2008 Page News English


Argument-web.config

► Exception
► EXCEPTION_TITLE
► EXCEPTION_CONTENT
► LOG_FILE

► Time format of system operation


► UTILITY_DATE_TIME_FORMAT
► DATE_FORMAT

► DES byteKey, byteIV


► DES_KEY
► DES_IV

► mail setting
► MAIL_FROM_SYS
► MAIL_FROM_SYS_NAME
► MAIL_HOST
► MAIL_ID
► MAIL_PWD

► connectionStrings

31 March 2008 Page About PowerPoint


Argument-EY.SysXXX.Business_Code.SysArgument

► Only use for this system(project)


► Not necessary, just by yourself
► Provide some examples for you to refer
► SYS_ID Advice: this is integer, you have to know this sysID value for your project

► AD_INF
► USER_PERMISSION
► CONNECTION_NAME
► MAIN_OPERATE_PAGE

31 March 2008 Page About PowerPoint


Appendix-C# Comment

► Use region
► Enums, Struct
► Fields
► Properties
► Construct
► Methods…for a serial relation group
► Use XML comment format.
► summary
► param
► example
► code
► return

October 28, 2008 Page News English


Appendix-C# comment example

October 28, 2008 Page News English


Appendix-javaScript Intellisense

► Work with XML comment format.


► ///<summary>Method description.</summary>
► ///<param name=“Argument name" type="string“>Argument
description</param>
► Helps programmers write cleaner code, which makes the
processes of testing, debugging and performing quality
assurance progress faster.

October 28, 2008 Page News English


Appendix-javaScript Intellisense example

October 28, 2008 Page News English


Q&A

31 March 2008 Page About PowerPoint


Thank you

31 March 2008 Page About PowerPoint

Potrebbero piacerti anche