protected void Page_Load(object sender, EventArgs e) { if (Application["SharedFishTank"] == null) { Application["SharedFishTank"] = new Fishtank(); } thetank = (Fishtank)Application["SharedFishTank"]; UpdateFishListView(); }
protected void ButtonAddFish_Click(object sender, EventArgs e) { Fish f = new Fish( TextBoxFishType.Text, int.Parse(TextBoxFishLength.Text), int.Parse(TextBoxFishWeight.Text)); Application.Lock(); thetank = (Fishtank)Application["SharedFishTank"]; thetank.AddFish(f); Application["SharedFishTank"] = thetank; Application.UnLock(); UpdateFishListView(); }
protected void ButtonUpdateTank_Click(object sender, EventArgs e) { thetank = (Fishtank)Application["SharedFishTank"]; UpdateFishListView(); }