Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Response.Expires = -1;

        Ajax.Utility.RegisterTypeForAjax(typeof(Frame));
        pageCaption.Text = "Work Order Entry V1.0.0";
        if (Request.QueryString["UserName"] != null)
        {
            Session["UserName"] = Request.QueryString["UserName"].ToString();
            Session["UserID"]   = Request.QueryString["UserID"].ToString();
            if (Request.QueryString["WOOrderNo"] != null)
            {
                Session["WOOrderNo"] = Request.QueryString["WOOrderNo"].ToString();
            }
            else
            {
                Session["WOOrderNo"] = null;
            }
            common.LoadSessionVariables(Request.QueryString["UserID"].ToString());

            // Security Code ( SOE(W) or ENTRY(W))
            Session["SecurityCode"] = security.GetSecurityCode(Session["UserName"].ToString(), "WOWorkSheet");
            if (Session["SecurityCode"].ToString() == "")
            {
                Response.Redirect("common/errorpage/unauthorizedpage.aspx", true);
            }
        }
        else
        {
            Response.Write("No Session");
        }
    }
Ejemplo n.º 2
0
    private void GetSecurity()
    {
        hidSecurity.Value = SecurityUtil.GetSecurityCode(Session["UserName"].ToString(), "WOWorkSheet");
        if (hidSecurity.Value.ToString() == "")
        {
            hidSecurity.Value = "None";
        }
        else
        {
            hidSecurity.Value = "Full";
        }

        //Response.Write(Session["UserName"].ToString());
        //Response.Write("<br>");
        //Response.Write(hidSecurity.Value.ToString());

        if (hidSecurity.Value.ToString() == "None")
        {
            Response.Redirect("~/Common/ErrorPage/unauthorizedpage.aspx", true);
        }
    }
Ejemplo n.º 3
0
    //
    //Determine user security for this page
    //For WOWorkSheet: MRP (W); WOS (W)
    //
    private void GetSecurity()
    {
        hidSecurity.Value = SecurityUtil.GetSecurityCode(Session["UserName"].ToString(), "WOWorkSheet");
        if (hidSecurity.Value.ToString() == "")
        {
            hidSecurity.Value = "Query";
        }
        else
        {
            hidSecurity.Value = "Full";
        }

        //
        //If the page does not allow 'Query' only, change to 'None'
        //
        if (hidSecurity.Value.ToString() == "Query")
        {
            hidSecurity.Value = "None";
        }


        //Hard code the security value(s) until specific security is implemented
        //Toggle between Query, Full and None
        //hidSecurity.Value = "Query";
        //hidSecurity.Value = "Full";
        //hidSecurity.Value = "None";


        switch (hidSecurity.Value.ToString())
        {
        case "None":
            Response.Redirect("~/Common/ErrorPage/unauthorizedpage.aspx", true);
            break;

        case "Full":
            break;
        }
    }