private void btnSubstrac_Click(object sender, EventArgs e) { int point; if (int.TryParse(txtSubstracPoint.Text, out point)) { if (point <= Convert.ToInt32(lblMC_Point.Text)) { try { ConsumeClient client = new ConsumeClient("BasicHttpBinding_IConsume", WCFServiceUrl.ConsumeServiceUrl); client.SubstracPoint(txtMemCardIDorMobile.Text, User.U_ID, point, txtRemark.Text); MessageBox.Show("恭喜,减积分成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); lblMC_Point.Text = (Convert.ToInt32(lblMC_Point.Text) - point).ToString(); txtSubstracPoint.Clear(); txtRemark.Clear(); } catch { MessageBox.Show("系统异常,减积分失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("当前会员积分不足[" + point + "]!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); } } else { MessageBox.Show("您输入的积分有误!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void btnConsume_Click(object sender, EventArgs e) { float money; if (float.TryParse(txtCO_TotalMoney.Text, out money) && Member != null) { try { ConsumeClient client = new ConsumeClient("BasicHttpBinding_IConsume", WCFServiceUrl.ConsumeServiceUrl); client.FastConsume(txtMemCardIDorMobile.Text, User.U_ID, money); MessageBox.Show("恭喜,快速消费成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); lblMC_Point.Text = (Convert.ToInt32(lblMC_Point.Text) + (int)(money / Member.CL_Point)).ToString(); lblMC_TotalMoney.Text = (Convert.ToDouble(lblMC_TotalMoney.Text) + (Math.Round((double)(Member.CL_Percent * money), 2))).ToString(); txtCO_TotalMoney.Clear(); } catch { MessageBox.Show("系统异常,快速消费失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("您输入的金额有误!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } }