protected void Page_Load(object sender, EventArgs e) { //check premissions Classes.AdminPremissions ap = new Classes.AdminPremissions(); if (!ap.getAdminPremissions(Convert.ToInt32(Session["UserId"]), "Ads")) { Response.Redirect("~/Error/404"); } }
protected void Page_Load(object sender, EventArgs e) { //check premissions Classes.AdminPremissions ap = new Classes.AdminPremissions(); if (!ap.getAdminPremissions(Convert.ToInt32(Session["UserId"]), "Profiles")) { Response.Redirect("~/Error/404"); } string HostUrl = ConfigurationManager.AppSettings["HostUrl"].ToString(); //Mouseover ImageButtonProfile.Attributes.Add("onmouseover", "this.src='" + HostUrl + "/Images/Buttons/go-on.png'"); ImageButtonProfile.Attributes.Add("onmouseout", "this.src='" + HostUrl + "/Images/Buttons/go-off.png'"); }
protected void Page_Load(object sender, EventArgs e) { //check premissions Classes.AdminPremissions ap = new Classes.AdminPremissions(); if (!ap.getAdminPremissions(Convert.ToInt32(Session["UserId"]), "Reports")) { Response.Redirect("~/Error/404"); } DataTable dt = new DataTable(); DataSet ds = new DataSet(); SqlConnection sqlConn = new SqlConnection(ConfigurationManager.ConnectionStrings["ProfilesConnectionString"].ConnectionString); SqlCommand sqlCmd = new SqlCommand("sp_reportsPendingCount", sqlConn); int reportsUnreadCount = 0; try { sqlCmd.CommandType = CommandType.StoredProcedure; sqlConn.Open(); reportsUnreadCount = (int)sqlCmd.ExecuteScalar(); sqlCmd.Dispose(); sqlConn.Dispose(); } catch (Exception ex) { } finally { sqlConn.Close(); sqlCmd.Dispose(); sqlConn.Dispose(); } if (reportsUnreadCount == 0) { LabelReportsNewCount.Visible = false; } else { LabelReportsNewCount.Visible = true; LabelReportsNewCount.Text = "(" + reportsUnreadCount + " گزارش بررسی نشده)"; } }