private void button1_Click(object sender, EventArgs e) { VoiceHelper.SpeakAsync(textBox1.Text.Trim()); }
//PublicClass PublicClass = new PublicClass(); //总价 private void FangFei_Load(object sender, EventArgs e) { txtFangFei.Text = PublicClass.Money.ToString(); txtYaJin.Text = PublicClass.YaJin; txtTian.Text = PublicClass.Tian.ToString(); string sql = $@" select memberuser.memberuser_shenfen,member.member_level,member.member_zhekou,userscore.userscore_jifen,phone.phone_id,memberuser.memberuser_name,phone.phone_tai from memberuser inner join member on(memberuser.memberuser_dengji = member.member_id) inner join userscore on(memberuser.memberuser_shenfen = userscore.userscore_shenfenid) inner join phone on(memberuser.memberuser_shenfen = phone_shenfen) where memberuser.memberuser_shenfen = '{PublicClass.ShenF}' and phone.phone_tai ='{"可用"}' "; SqlDataReader reader = DBHelper.ExecutReader(sql); if (reader.Read()) { txtHuiYuan.Text = reader[1].ToString(); txtZhekou.Text = reader[2].ToString(); double fang = Convert.ToDouble(txtFangFei.Text); double tianshu = Convert.ToDouble(txtTian.Text); double zhe = Convert.ToDouble(txtZhekou.Text); double ya = Convert.ToDouble(txtYaJin.Text); PublicClass.SUM = (fang * tianshu) * zhe + ya; txtSum.Text = PublicClass.SUM.ToString(); VoiceHelper.SpeakAsync(txtSum1.Text + txtSum.Text + txtSum3.Text); } else { double fang = 0.0; double tianshu = 0.0; double ya = 0.0; string sql2 = $@" select memberuser.memberuser_shenfen,member.member_level,member.member_zhekou,userscore.userscore_jifen,phone.phone_id,memberuser.memberuser_name,phone.phone_tai from memberuser inner join member on(memberuser.memberuser_dengji = member.member_id) inner join userscore on(memberuser.memberuser_shenfen = userscore.userscore_shenfenid) inner join phone on(memberuser.memberuser_shenfen = phone_shenfen) where memberuser.memberuser_shenfen = '{ PublicClass.ShenF}' and phone.phone_tai ='{"禁用"}' "; SqlDataReader reader2 = DBHelper.ExecutReader(sql2); if (reader2.Read()) { txtHuiYuan.Text = reader2[6].ToString(); fang = Convert.ToDouble(txtFangFei.Text); tianshu = Convert.ToDouble(txtTian.Text); ya = Convert.ToDouble(txtYaJin.Text); PublicClass.SUM = (fang * tianshu) + ya; txtSum.Text = PublicClass.SUM.ToString(); VoiceHelper.SpeakAsync(txtSum1.Text + txtSum.Text + txtSum3.Text); reader2.Close(); return; } fang = Convert.ToDouble(txtFangFei.Text); tianshu = Convert.ToDouble(txtTian.Text); ya = Convert.ToDouble(txtYaJin.Text); PublicClass.SUM = (fang * tianshu) + ya; txtSum.Text = PublicClass.SUM.ToString(); VoiceHelper.SpeakAsync(txtSum1.Text + txtSum.Text + txtSum3.Text); } reader.Close(); }