📄 bizobject.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 + -