using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using TopWinCMS.BLL;
using TopWinCMS.Model;
using TopWinCMS.Common;
public partial class Member_Exchange : TopWinCMS.BLL.PageFactory.Pages.ClientPublicPage
{
    
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Title = Config.SiteName+"→ 会员中心 → 点数转换";
        if (MemberRightsCheck.IsLogined == false)
        {
            MsgBox.Alert("登录超时，请重新登录。", "Login.aspx");
        }
        if (Request["Action"] == "ZhuanHuan")
        {
            Panel1.Visible = true;
            Panel2.Visible = false;
            Label1.Text = MemberConfig.JingBiHuiLv.ToString();
            Label2.Text = Math.Round(1 / MemberConfig.JingBiHuiLv, 10).ToString();
            Label3.Text = MemberConfig.JianYanHuiLv.ToString();
            LB_Path.Text = "点数转换";
            //BT_OK1.Attributes.Add("onclick", "return Check('A')");
        }
        else if (Request["Action"] == "ZhengYu")
        {
            Panel1.Visible = false;
            Panel2.Visible = true;
            LB_Path.Text = "金币转赠";
        }
        else
        {
            MsgBox.Alert("参数错误。", "Default.aspx");
        }
        
    }
    protected void BT_OK1_Click(object sender, EventArgs e)
    {
        if (NumericTextBox1.Text.Length > 0)
        {
            new ExchangeManage().Coin2Point(int.Parse(NumericTextBox1.Text));
        }
        else
        {
            MsgBox.Alert("请输入数字。");
        }
    }

    protected void BT_OK2_Click(object sender, EventArgs e)
    {
        if (NumericTextBox2.Text.Length > 0)
        {
            new ExchangeManage().Point2Coin(int.Parse(NumericTextBox2.Text));
        }
        else
        {
            MsgBox.Alert("请输入数字。");
        }
    }

    protected void BT_OK3_Click(object sender, EventArgs e)
    {
        if (NumericTextBox3.Text.Length > 0)
        {
            new ExchangeManage().Experience2Point(int.Parse(NumericTextBox3.Text));
        }
        else
        {
            MsgBox.Alert("请输入数字。");
        }
    }

    protected void BT_OK4_Click(object sender, EventArgs e)
    {
        string strUserName = TB_MemberName.Text.Trim();
        int Number = int.Parse(NTB_Coin.Text);
        new ExchangeManage().CoinGive(strUserName, Number);
    }
}