using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using SysCore;
using SysCore.Model;
using SysCore.DAL;
using SysCore.Control;

public partial class System_GrfPrinter_PrintTemplate : System.Web.UI.Page
{
    public AuthUI auth = new AuthUI();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
            init_page();
    }
    public string html = "";
    void init_page()
    {
        string module = Request.QueryString["module"];
        string where = " and module='" + module + "'";
        DataTable dt = new PrintTemplateDAL().GetList(where);
        string sql_print_main_session_id = Request.QueryString["sql_print_main_session_id"];

        if (Session[Request.QueryString["sql_print_detail_session_id"] + "_export_field"] != null)
        {
            html += "<li id=''><a href=\"javascript:export_to_excel()\"><img src='../../Images/Common/excel.png' style='height:67px'/><div>导出Excel</div></a></li>\n";
        }
        
        foreach (DataRow dr in dt.Rows)
        {
            string del = "<a style='display:none' name='btn_delete' title='删除' href=\"javascript:do_delete('" + dr["prt_id"].ToString() + "')\"><img src='../../Images/Common/delete_pic.png'/></a>";
            string edit = "<a style='display:none' name='btn_edit' title='修改' href=\"javascript:do_edit('" + dr["prt_id"].ToString() + "')\"><img src='../../Images/Common/edit_pic.png'/></a>&nbsp;&nbsp;&nbsp;&nbsp;";
            html += "<li id='li_" + dr["prt_id"].ToString() + "'><a href=\"javascript:print_view('" + dr["prt_id"].ToString() + "','" + dr["template_name"].ToString() + "','" + dr["grf_file"].ToString() + "')\"><img src='../../Images/Common/print.png'/><div>" + dr["template_name"].ToString() + "</div></a>" + edit + del + "</li>\n";
        }
    }
}