Example #1
0
        /// <summary>
        /// 点击立即兑换
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_DH_Press(object sender, EventArgs e)
        {
            Chong chong = new Chong()
            {
                userID = 1,
                ypId   = Convert.ToInt32(txt_Id.Text)
            };
            string DH     = HttpClient.Post("/Integral/ShopRecharge", JsonConvert.SerializeObject(chong));
            Data   model  = JsonConvert.DeserializeObject <Data>(DH);
            string result = JsonConvert.SerializeObject(model.Result);

            if (result == "1")
            {
                MessageBox.Show("兑换成功", "警告框", MessageBoxButtons.OKCancel, (obj, args) =>
                {
                    if (args.Result == ShowResult.No)
                    {
                    }
                });
            }
            else
            {
                MessageBox.Show("兑换失败", "警告框", MessageBoxButtons.OKCancel, (obj, args) =>
                {
                    if (args.Result == ShowResult.No)
                    {
                    }
                });
            }
        }
Example #2
0
        /// <summary>
        /// 充值金额
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_ChongZhi_Press(object sender, EventArgs e)
        {
            Chong chong = new Chong()
            {
                money  = Convert.ToDecimal(jine.Text),
                userID = 1
            };
            //返回POST
            string s       = httpClient.Post("/Integral/WalletRecarge", JsonConvert.SerializeObject(chong));
            Data   model   = JsonConvert.DeserializeObject <Data>(s);
            int    intJson = Convert.ToInt32(JsonConvert.SerializeObject(model.Result));

            if (intJson > 0)
            {
                MessageBox.Show("充值成功");
                GetUserModel();
            }
            else
            {
                MessageBox.Show("充值失败");
            }
            //SmobilerMyForm my = new SmobilerMyForm();
            //Show(my);
        }