Ejemplo n.º 1
0
        private void ButtonAnswer(object sender, EventArgs e)
        {
            Button btn = (Button)sender;

            int medicineID = Int32.Parse(btn.ClassId);

            if (btn.BackgroundColor == Color.LimeGreen)
            {
                controller.DeleteUserMedicine(medicineID);
                btn.BackgroundColor = Color.Default;
            }
            else
            {
                controller.AddUserMedicine(medicineID);
                btn.BackgroundColor = Color.LimeGreen;
            }
        }