当前位置: 首页 > 图文教程 > 网络编程 > ASP.NET > Microsoft User Interface Process Application Block 研究(3)

ASP.NET
如何用Response.Redirect方法传递汉字
在ASP.NET中调用存储过程方法新解
决定何时使用 DataGrid、DataList 或 Repeater(ASP.NET 技术文章)
AlternatingItemTemplate类似于 ItemTemplate 元素
c#中过滤html的正则表达式
ASP.NET:ADO.NET的DataAdapter对象
repeater分页 内容显示
内容添加asp.net
VS2003 SP1发布
DataReader深入解析:持续更新
C#.Net 学习笔记(一)
从ASP过渡到ASP.net遗留的二十大积习
如何改变asp.net项目名称
asp,asp.net学习教程下载
基于.net开发的遵循web标准的个人站点程序包下载
FileUpload1 上传文件类型验证正则表达式
ASP.NET与数据库相关技巧
读取TXT文件内容的方法
简单的启动窗体
c#中实现文件拖放打开的方法

ASP.NET 中的 Microsoft User Interface Process Application Block 研究(3)


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 181 ::
收藏到网摘: n/a



这篇文章研究的是如何在一个用户登录后获得用户的任务。在Web界面中,用户如果通过验证就会转到welocme.aspx页面中,在这个页面中首先创建一个CartTask对象:

Dim task As New CartTask(Page.User.Identity.Name)

这个对象的New(userlogon As String)方法中调用了静态方法StoreControllerBase.GetUserTaskId来获得任务的标示,这个任务标示是一个Guid类。在GetUserTaskID方法的如下代码中返回:

Dim cartBO As New CartTaskBusinessObject()

taskId = cartBO.GetTask(userName)

在CartTaskBusinessObject.GetTask方法中定义了三个类:

Dim McustomerDS As New CustomerDS

Dim McustomerDALC As New CustomerDALC


Dim McartTaskDALC As New CartTaskDALC

其中CustomerDS是保存用户信息的类,它是从DataSet类继承过来的。CustomerDALC是从BaseDALC(这个类还没有研究??)继承过来的。这两个类是针对用户信息操作的。CartTaskDALC是从BaseDALC继承过来的,是针对当前用户的任务进行操作的。CartTaskBusinessObject.GetTask方法最终返回的是用户所对应的任务Guid(这个Guid是保存在数据库CartTasks表中的)。 然后在welcome.aspx的Page_Load中判断当前用户是否有Task Guid,如果有的话就在startButton中显示“Continue the existing buy process”,否则就显示“Start to a new buy process”。 以后需要分析一下CustomerDS类以及BaseDALC类,CustomerDS为什么从DataSet类继承,BaseDALC类是做什么用的。