Exemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Application["SharedFishTank"] == null)
            {
                Application["SharedFishTank"] = new Fishtank();
            }

            thetank = (Fishtank)Application["SharedFishTank"];
            UpdateFishListView();
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
 protected void ButtonUpdateTank_Click(object sender, EventArgs e)
 {
     thetank = (Fishtank)Application["SharedFishTank"];
     UpdateFishListView();
 }