private void updateButton_Click(object sender, EventArgs e)
{
//custID.Text = customers[id].ID.ToString();
customers[id].Name = custName.Text.ToString();
customers[id].Suburb = custSuburb.Text.ToString();
customers[id].Balance = custBal.Text;
customers[id].Year_used = custYear.Text;
}
}
public class Customer
{
protected string id;
protected string name;
protected string suburb;
protected double balance;
protected double year_used;
public string ID
{
get { return id; }
}
public string Name
{
get { return name; }
set { value = name; }
}
public string Suburb
{
get { return suburb; }
set { value = suburb; }
}
public double Balance
{
get { return balance; }
set { value = balance; }
}
public double Year_used
{
get { return year_used; }
set { value = year_used; }
}
public Customer(string id, string name, string suburb, double balance, double year_used)
{
this.id = id;
this.name = name;
this.suburb = suburb;
this.balance = balance;
this.year_used = year_used;
}
}
コードを実行しようとすると、このエラーが発生するようです?? 問題のように思われるのは、intを2倍にするすべてを変更したことです。
と同様:
customers[id].Balance = custBal.Text;
customers[id].Year_used = custYear.Text;
custBalの適切なコードは何でしょうか。とcustYear。フォームに表示するには?何か案は?