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 NetResLedgDetail : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string action = Request["action"];
                if (action == "readonly")
                {
                    fvNetResLedgDetail.ChangeMode(FormViewMode.ReadOnly);
                }
                else if (action == "edit")
                {
                    if (Session["id"] != null)
                    {
                        if (Session["role"].ToString() != "manager")
                        {
                            Response.Redirect("Default.aspx");
                            return;
                        }
                    }
                    else
                    {
                        Response.Redirect("Default.aspx");
                        return;
                    }
                    fvNetResLedgDetail.ChangeMode(FormViewMode.Edit);
                }
                else
                {
                    Response.Write("<script>alert('页面发生错误!');location.href('Default.aspx');</script>");
                }
            }
        }
    }
}