private void button1_Click(object sender, EventArgs e) { if (hasCard) { if (result != "r" || result == "all") { Util.userPurchaseAmount = 0; purchase2 purchase = new purchase2("冰红茶"); purchase.Show(); } else { SpeechSynthesizer player1 = new SpeechSynthesizer(); player1.SpeakAsync("您对此零食敏感,无法购买。"); MessageBox.Show("您对此零食敏感,无法购买", "温馨提示"); } } else { SpeechSynthesizer player1 = new SpeechSynthesizer(); player1.SpeakAsync("请刷卡"); MessageBox.Show("请刷卡片", "温馨提示"); } /* * Util.userPurchaseAmount = 0; * purchase2 purchase = new purchase2("冰红茶"); * purchase.Show(); */ }
private void label2_Click(object sender, EventArgs e) { if (hasCard) { if (result != "y" || result == "all") { purchase2 purchase = new purchase2("冰糖雪梨"); purchase.Show(); } else { SpeechSynthesizer player1 = new SpeechSynthesizer(); player1.SpeakAsync("您对此零食敏感,无法购买。"); MessageBox.Show("您对此零食敏感,无法购买", "温馨提示"); } } else { SpeechSynthesizer player1 = new SpeechSynthesizer(); player1.SpeakAsync("请刷卡"); MessageBox.Show("请刷卡片", "温馨提示"); } }