Ejemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //check permissions
     Classes.Admins a = new Classes.Admins();
     if (!a.permissions(Convert.ToInt32(Session["UserId"]), "Events"))
     {
         Response.Redirect("~/Error/404");
     }
 }
Ejemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //check permissions
     Classes.Admins a = new Classes.Admins();
     if (!a.permissions(Convert.ToInt32(Session["UserId"]), "Statistics"))
     {
         Response.Redirect("~/Error/404");
     }
 }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //check permissions
            Classes.Admins a = new Classes.Admins();
            if (!a.permissions(Convert.ToInt32(Session["UserId"]), "Settings"))
            {
                Response.Redirect("~/Error/404");
            }

            DataTable      dt      = new DataTable();
            DataSet        ds      = new DataSet();
            SqlConnection  sqlConn = new SqlConnection(ConfigurationManager.ConnectionStrings["AppConnectionString"].ConnectionString);
            SqlDataAdapter sda     = new SqlDataAdapter("sp_adminSettings", sqlConn);

            sda.SelectCommand.CommandType = CommandType.StoredProcedure;

            //try
            //{
            sda.Fill(ds);
            dt = ds.Tables[0];
            //}
            //catch (Exception ex)
            //{

            //}
            //finally
            //{
            sqlConn.Close();
            sda.Dispose();
            sqlConn.Dispose();
            //}

            if (dt.Rows.Count == 0)// Profile doesn't exist
            {
                Response.Redirect("~/Error/AdminSettingsNotFound");
            }
            else
            {
                DropDownListLogin.SelectedValue      = dt.Rows[0]["LoginAllow"].ToString();
                DropDownListRegister.SelectedValue   = dt.Rows[0]["RegisterAllow"].ToString();
                DropDownListActivities.SelectedValue = dt.Rows[0]["ActivitiesAllow"].ToString();
                DropDownListStatus.SelectedValue     = dt.Rows[0]["Status"].ToString();
            }
        }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //check permissions
            Classes.Admins a = new Classes.Admins();
            if (!a.permissions(Convert.ToInt32(Session["UserId"]), "Settings"))
            {
                Response.Redirect("~/Error/404");
            }

            DataTable dt = new DataTable();
            DataSet ds = new DataSet();
            SqlConnection sqlConn = new SqlConnection(ConfigurationManager.ConnectionStrings["AppConnectionString"].ConnectionString);
            SqlDataAdapter sda = new SqlDataAdapter("sp_adminSettings", sqlConn);
            sda.SelectCommand.CommandType = CommandType.StoredProcedure;

            //try
            //{
                sda.Fill(ds);
                dt = ds.Tables[0];
            //}
            //catch (Exception ex)
            //{

            //}
            //finally
            //{
                sqlConn.Close();
                sda.Dispose();
                sqlConn.Dispose();
            //}

            if (dt.Rows.Count == 0)// Profile doesn't exist
            {
                Response.Redirect("~/Error/AdminSettingsNotFound");
            }
            else
            {
                DropDownListLogin.SelectedValue = dt.Rows[0]["LoginAllow"].ToString();
                DropDownListRegister.SelectedValue = dt.Rows[0]["RegisterAllow"].ToString();
                DropDownListActivities.SelectedValue = dt.Rows[0]["ActivitiesAllow"].ToString();
                DropDownListStatus.SelectedValue = dt.Rows[0]["Status"].ToString();
            }
        }