using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
using System.Web.Configuration;
using System.Xml;
using System.Data;
using System.Data.SqlClient;
using SysCore;

public partial class Root_Account_List : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        new RootControl().CheckRootLogin();
        if (!Page.IsPostBack)
        {
            InitTable();
        }
    }
    protected void Page_PreRender(object sender, EventArgs e)
    {
        
    }

    void InitTable()
    {
        try
        {
            SqlUtil su = new SqlUtil();
            su.SetDatabaseName("master");
            string sql = @"SELECT name as db_name,crdate,version,[filename]
                            FROM master.dbo.sysdatabases
                            WHERE name like 'xplat%'
                            ORDER BY name ";
            //Response.Write(sql);
            DataTable dt = su.GetDataTable(sql, null);
            list_view.DataSource = dt;
            list_view.DataBind();
        }
        catch
        {
            list_view.Items.Clear();
            //Response.Write(err.Message);
        }
    }
    protected void dll_db_SelectedIndexChanged(object sender, EventArgs e)
    {
        InitTable();
    }
    protected void Refresh_Click(object sender, EventArgs e)
    {
        InitTable();
    }
    protected void CreateDB_Click(object sender, EventArgs e)
    {
        Response.Redirect("Account_Create.aspx");
    }
}