vs2008编写的一个web简单问题,新手求解
using System;
/// <summary>
///Account 的摘要说明
/// </summary>
public class Account
{
private string _ID;
private string _Name;
private decimal _Balance;
public Account(string id,string name,decimal balance)
{
this.ID = id;
this.Name = name;
this.Balance = balance;
//
//TODO: 在此处添加构造函数逻辑
//
}
public string ID
{
get
{
return this._ID;
}
set
{
this._ID = value;
}
}
public string Name
{
get
{
return this._Name;
}
set
{
this._Name = value;
}
}
public decimal Balance
{
get
{
return this._Balance;
}
set
{
this._Balance = value;
}
}
///<summary>
///存款方法
///</summary>
public void Deposit(decimal amount)
{
if (amount > 0)
{
this._Balance += amount;
}
else
{
throw new Exception("存款金额不能小于或等于0!");
}
}
///<summary>
///取款方法
///</summary>
public void Acquire(decimal amount)
{