Example #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (!IsPostBack)
            {
                fsVerify.Visible = false;
                FDRPage fp = new FDRPage();
                if (fp.IsUserInRole("CBC Administrator"))
                // if (User.CanPerformFunction("CBC_ApproveDataReady"))
                {
                    if (Request["refno"] != null && Request["year"] != null)
                    {
                        var isApproved = DatabaseReader.CheckIfCBCApproved(Request["refno"].ToString(), int.Parse(Request["year"].ToString()));
                        switch (isApproved)
                        {
                        case -1:
                            fsVerify.Visible = true;
                            break;

                        case 0:
                        case 1:
                            fsVerify.Visible = false;
                            break;
                        }
                    }
                }
                if (!Page.IsPostBack)
                {
                    ViewState["prevPage"] = Request.UrlReferrer;
                }
            }
        }
        catch (Exception x)
        {
            throw new Exception(x.Message);
        }
    }