Example #1
0
        private void OnPanelClick(object sender, EventArgs e)
        {
            string[] name = ((Button)sender).Name.Split('-');
            if (int.Parse(name[1]) != lastbutton)
            {
                MusicCD musicCD = MusicCD.CreateFromID(int.Parse(name[1]));

                item.Product   = musicCD;
                item.Quantity  = 1;
                lblName.Text   = musicCD.Name;
                lblIssue.Text  = musicCD.Issue;
                lblSinger.Text = musicCD.Singer;
                lblType.Text   = musicCD.Type;
                lblQty.Text    = item.Quantity.ToString();
                lblPrice.Text  = "€" + (item.Quantity * item.Product.Price).ToString("0.00");
            }
            lastbutton = int.Parse(name[1]);
        }