예제 #1
0
        //Set Panel Visibility to manage Blogs
        protected void ManageBlogPanelVisibility(object sender, CommandEventArgs e)
        {
            string blogQ;
            string cmdName = e.CommandName.ToString();

            switch (cmdName)
            {
            case "pnlViewBlogs":
                pnlViewBlogs.Visible = true;
                pnlAddBlog.Visible   = false;
                if (User.IsInRole("Admin"))
                {
                    blogQ = string.Format(@"SELECT * FROM Blog b");
                    BD.DataBindToDataList(dlBlogsGallery, blogQ);
                }
                else
                {
                }
                break;

            case "pnlCreateBlog":
                pnlViewBlogs.Visible = false;
                pnlAddBlog.Visible   = true;
                break;

            case "ReturnToMyBlog":
                Response.Redirect("myblog");
                break;

            default:
                break;
            }
        }
예제 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         string qCentres = string.Format(@"SELECT * FROM EduSphere.Organizations WHERE OrganizationID>104");
         BD.DataBindToDataList(dlCentres, qCentres);
     }
 }
예제 #3
0
        //Set Panel Visibility to manage Blogs
        protected void ManageBlogPanelVisibility(object sender, CommandEventArgs e)
        {
            string cmdName = e.CommandName.ToString();

            switch (cmdName)
            {
            case "pnlViewBlogs":
                pnlViewBlogs.Visible = true;
                pnlAddBlog.Visible   = false;
                string blogQ = string.Format(@"SELECT * FROM Blog b 
                                    JOIN EduSphere.Neurotherapists n ON b.SubmittedByID=n.Email 
                                    WHERE Email='{0}'", User.Identity.Name.ToString());
                BD.DataBindToDataList(dlBlogsGallery, blogQ);
                break;

            case "pnlCreateBlog":
                pnlViewBlogs.Visible = false;
                pnlAddBlog.Visible   = true;
                break;

            case "ReturnToMyBlog":
                Response.Redirect("myblog");
                break;

            default:
                break;
            }
        }
예제 #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         string queryPrograms = string.Format(@"SELECT * FROM EduSphere.Programs p
                                                             JOIN EduSphere.ProgramGroups g ON p.ProgramGroupID=g.ProgramGroupID
                                                             WHERE ProgramID>=100");
         BD.DataBindToDataList(dlPrograms, queryPrograms);
     }
 }