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

namespace ResMangSys
{
    public partial class NetResLedgManager : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //session["role"]判断
                if (Session["id"] != null)
                {
                    if (Session["role"].ToString() != "manager")
                    {
                        Response.Redirect("Login.aspx");
                        return;
                    }
                }
                else
                {
                    Response.Redirect("Login.aspx");
                    return;
                }
                LVRepNetResLedg.DataSourceID = "ODSNetResLedg";
                LVRepNetResLedg.DataBind();
            }
            else
            {
                if (Session["id"] == null)
                {
                    Response.Redirect("Default.aspx");
                    return;
                }
                if (Session["role"].ToString() != "manager")
                {
                    Response.Redirect("Default.aspx");
                    return;
                }
                if (baStaNametxt.Text != "")
                {
                    LVRepNetResLedg.DataSourceID = "ODSNetResLedgByName";
                    LVRepNetResLedg.DataBind();
                }
                else
                {
                    LVRepNetResLedg.DataSourceID = "ODSNetResLedg";
                    LVRepNetResLedg.DataBind();
                }
            }
        }
    }
}