⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bizobject.cs

📁 asp.net技术内幕的书配源码
💻 CS
字号:
using System;

namespace myComponents {
	public class BizObject {
		public void CheckOrder(string customer, string product, double unitPrice, int quantity, string state) {
			if ( quantity <= 0 || quantity > 100 ) {
				throw new ArgumentException( "Invalid Quantity!" );
			}

			if ( state == "California" && product == "Hair Dryer" ) {
				throw new ArgumentException( "Californians cannot own Hair Dryers!" );
			} 

			if ( state == "Washington" ) {
				unitPrice += unitPrice * .06;
			}
			
			DataObject  myDataObject = new DataObject();
			myDataObject.SaveOrder( customer, product, unitPrice, quantity, state );
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -