Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["ReservationId"] == null)
        {
            Response.Redirect("~/UnableAccess.aspx");
        }
        string   key;
        DataView dvb = (DataView)UserIdSelect.Select(DataSourceSelectArguments.Empty);

        try
        {
            uid = (string)dvb.Table.Rows[0][0];
        }
        catch (Exception)
        {
            Response.Redirect("~/UnableAccess.aspx");
        }
        MembershipUser ma = Membership.GetUser();

        key = ma.ProviderUserKey.ToString();
        if (uid == key)
        {
        }
        else
        {
            Response.Redirect("~/UnableAccess.aspx");
        }

        DataView dv  = (DataView)ClientIdSelect.Select(DataSourceSelectArguments.Empty);
        int      cid = (int)dv.Table.Rows[0][0];

        ClientID.Text = cid.ToString();
        tagg          = (int)dv.Table.Rows[0][1];
        if (tagg == 1)
        {
            Button1.Visible      = false;
            rc1.Visible          = false;
            rs1.Visible          = false;
            Billing2hide.Visible = false;
            balanceHide.Visible  = false;
        }
        else if (tagg == 2)
        {
            rc2.Visible          = false;
            rs2.Visible          = false;
            Billing2hide.Visible = false;
            balanceHide.Visible  = false;
        }
        else if (tagg == 3)
        {
            Button1.Text         = "View Billing Statement";
            Button5.Visible      = false;
            rc2.Visible          = false;
            rs2.Visible          = false;
            Billing2hide.Visible = false;
            balanceHide.Visible  = false;
        }
        else if (tagg == 4)
        {
            Button1.Text         = "View Billing Statement";
            Button5.Visible      = false;
            rc2.Visible          = false;
            rs2.Visible          = false;
            rc1.Visible          = false;
            rs1.Visible          = false;
            Billing2hide.Visible = false;
            balanceHide.Visible  = true;
        }
        else if (tagg == 5)
        {
            tag5Hide.Visible     = false;
            Billing2hide.Visible = false;
        }
        else if (tagg == 6)
        {
            balanceHide.Visible  = true;
            tag5Hide.Visible     = false;
            Billing2hide.Visible = true;
        }

        LinkButton1.Attributes.Add("onclick", "window.open('../2ndBill.aspx?ReservationId=" + Request.QueryString["ReservationId"] + "', 'newwindow','menubar=1,resizable=1,width=700,height=900');return false;");
    }
Ejemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["ReservationId"] == null)
        {
            Response.Redirect("~/UnableAccess.aspx");
        }
        string   key;
        DataView dvb = (DataView)UserIdSelect.Select(DataSourceSelectArguments.Empty);

        try
        {
            uid = (string)dvb.Table.Rows[0][0];
        }
        catch (Exception)
        {
            Response.Redirect("~/UnableAccess.aspx");
        }
        MembershipUser ma = Membership.GetUser();

        key = ma.ProviderUserKey.ToString();
        if (uid == key)
        {
        }
        else
        {
            Response.Redirect("~/UnableAccess.aspx");
        }

        DataView dv  = (DataView)ClientIdSelect.Select(DataSourceSelectArguments.Empty);
        int      cid = (int)dv.Table.Rows[0][0];

        ClientID.Text = cid.ToString();
        tagg          = (int)dv.Table.Rows[0][1];
        if (tagg == 1)
        {
            Button1.Visible = false;
            rc1.Visible     = false;
        }
        else if (tagg == 2)
        {
            rc2.Visible = false;;
        }
        else if (tagg == 3)
        {
            Button1.Text    = "View Billing Statement";
            Button5.Visible = false;
            rc2.Visible     = false;
        }
        else if (tagg == 4)
        {
            Button1.Text        = "View Billing Statement";
            Button5.Visible     = false;
            rc2.Visible         = false;
            rc1.Visible         = false;
            balanceHide.Visible = true;
        }
        else if (tagg == 5)
        {
            tag5Hide.Visible = false;
        }
        else if (tagg == 6)
        {
            balanceHide.Visible = true;
            tag5Hide.Visible    = false;
        }
    }