using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using xabaraCOM;

public partial class webXabara_user_xml : System.Web.UI.Page
{
    admin a = new admin();
    sqlServer sql = new sqlServer();

    protected void Page_Load(object sender, EventArgs e)
    {
        a.check("xabaraCOM");

        if (!IsPostBack)
        {
            classListName.Text = string.Empty;

            string[] userType = xml.read("xabara.config", "userType", 180).Split(new char[] { '|' });
            string[] useMoney = xml.read("xabara.config", "useMoney", 180).Split(new char[] { '|' });
            string[] payMoney = xml.read("xabara.config", "payMoney", 180).Split(new char[] { '|' });

            for (int i = 0; i < userType.Length; i++)
            {
                classListName.Text += "<li style=\"height:26px;line-height:26px;\"><input name=\"userType\" type=\"text\" id=\"userType\" class=\"inputText\" value=\"" + userType[i] + "\" style=\"width:100px; text-align:center;\" /><input name=\"useMoney\" type=\"text\" id=\"useMoney\" class=\"inputText\" value=\"" + useMoney[i] + "\" style=\"width:100px; text-align:center;\" /><input name=\"payMoney\" type=\"text\" id=\"payMoney\" class=\"inputText\" value=\"" + payMoney[i] + "\" style=\"width:100px; text-align:center;\" /></li>";
            }
        }
    }

    protected void sysSet_Click(object sender, EventArgs e)
    {
        cache.clear();

        string userType = Request["userType"].Replace(",", "|");
        string useMoney = Request["useMoney"].Replace(",", "|");
        string payMoney = Request["payMoney"].Replace(",", "|");

        xml.save("userType", userType);
        xml.save("useMoney", useMoney);
        xml.save("payMoney", payMoney);

        sql.log(a.uid, "admin", "会员级别");

        Response.Redirect("xml.aspx", true);
    }
}