protected void UserAccessValidation()
    {
        int    CurrentUserID = GetSessionUserID();
        string PageURL       = UDFLib.GetPageURL(Request.Path.ToUpper());

        Session["PageURL"] = UDFLib.GetPageURL(Request.Path.ToUpper());
        BLL_Infra_UserCredentials objUser = new BLL_Infra_UserCredentials();

        objUA             = objUser.Get_UserAccessForPage(CurrentUserID, PageURL);
        Session["Edit"]   = objUA.Edit;
        Session["Delete"] = objUA.Delete;
        Session["Add"]    = objUA.Add;
        if (objUA.View == 0)
        {
            Response.Redirect("~/default.aspx?msgid=1");
        }

        if (objUA.Add == 1)
        {
            uaAddFlag = true;
        }
        //    btnsave.Visible = false;
        if (objUA.Edit == 1)
        {
            uaEditFlag = true;
        }
        else
        {
            //btnAlert.Visible = false;
            //btnPortCost.Visible = false;
            //btnPort.Visible = false;
            //PortCallNotification.Visible = false;
        }
        if (objUA.Delete == 1)
        {
            uaDeleteFlage = true;
        }

        DataTable dt = objPortCall.Get_PortCallAlertList(Convert.ToInt32(Session["USERID"].ToString()), "0");

        if (dt.Rows.Count > 0)
        {
            int iCount = 0;
            foreach (DataRow dr in dt.Rows)
            {
                if (Convert.ToInt32(dr["READ_ID"]) == 0)
                {
                    iCount++;
                }
            }

            if (iCount > 0)
            {
                btnAlerts.Visible = true;
            }
        }
    }
Esempio n. 2
0
    protected void BindPortCallAlert(int UserId)
    {
        DataTable dt = objPortCall.Get_PortCallAlertList(UserId, "0");

        if (dt.Rows.Count > 0)
        {
            gvPortAlert.DataSource = dt;
            gvPortAlert.DataBind();
            gvPortAlert.Visible = true;
        }
        else
        {
            gvPortAlert.DataSource = dt;
            gvPortAlert.DataBind();
        }
    }