Attribute在.NET编程中的应用(五)
来源:互联网 发布:mac 安卓开发环境搭建 编辑:程序博客网 时间:2024/04/29 16:09
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
<script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
Attribute在.NET编程中的应用(五)
Attribute在拦截机制上的应用
从这一节开始我们讨论Attribute的高级应用,为此我准备了一个实际的例子:我们有一个订单处理系统,当一份订单提交的时候,系统检查库存,如果库存存量满足订单的数量,系统记录订单处理记录,然后更新库存,如果库存存量低于订单的数量,系统做相应的记录,同时向库存管理员发送邮件。为了方便演示,我们对例子进行了简化:
//Inventory.csusing System;using System.Collections;namespace NiwalkerDemo{ public class Inventory { private Hashtable inventory=new Hashtable(); public Inventory() { inventory["Item1"]=100; inventory["Item2"]=200; } public bool Checkout(string product, int quantity) { int qty=GetQuantity(product); <script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 728x15, 创建于 08-4-23MSDN */google_ad_slot = "3624277373";google_ad_width = 728;google_ad_height = 15;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script><script type="text/javascript"><!--google_ad_client = "pub-2947489232296736";/* 160x600, 创建于 08-4-23MSDN */google_ad_slot = "4367022601";google_ad_width = 160;google_ad_height = 600;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
- Attribute在.NET编程中的应用(五)
- Attribute在.NET编程中的应用(五)
- Attribute在.NET编程中的应用(五)
- Attribute在.NET编程中的应用(五)
- Attribute在.net编程中的应用(五)
- Attribute在.NET编程中的应用(五)
- Attribute在.NET编程中的应用(五)
- Attribute在.NET编程中的应用(五)
- Attribute在.NET编程中的应用整理(五)
- Attribute在.net编程中的应用(五)
- Attribute在.NET编程中的应用(五)
- Attribute在.net编程中的应用(五)
- Attribute在.net编程中的应用(五)
- Attribute在.NET编程中的应用(五)
- Attribute在.NET编程中的应用(五)
- Attribute在.net编程中的应用(五)
- Attribute在.NET编程中的应用(五)
- Attribute在.NET编程中的应用(五)
- 用vb.net与acess结合实现简单的电话号码本程序(一)
- jsp页面返回代码
- 人人都是“环卫监督员”.
- dotnet学习笔记五 - 无用资源回收之二
- 关于无法创建aps.web项目的解决办法
- Attribute在.NET编程中的应用(五)
- php之web快速开发
- Attribute 在.NET编程中的应用(二)
- 分清全角和半角的区别
- 实战揭秘:开发.Net平台应用系统框架
- 定时器quartz的应用
- web service 基础
- 越俎代庖,做的两个页面。
- My E-business Fairy.NET文档发布--产品设计思想