Пример #1
0
 void LoadSitemap()
 {
     if (SiteMap.CurrentNode != null)
     {
         var list = new List <IdAndName>()
         {
             new IdAndName()
             {
                 Name    = SiteMap.RootNode.Title
                 , Value = SiteMap.RootNode.Url
                 , Void  = true
             },
             new IdAndName()
             {
                 Name    = SiteMap.CurrentNode.ParentNode.Title
                 , Value = SiteMap.CurrentNode.ParentNode.Url
                 , Void  = true
             },
             new IdAndName()
             {
                 Name = SiteMap.CurrentNode.Title
             }
         };
         SiteMapUc.SetData(list);
     }
 }
Пример #2
0
 void LoadSitemap(Academic.DbEntities.Class.SubjectClass cls)
 {
     if (SiteMap.CurrentNode != null)
     {
         var list = new List <IdAndName>()
         {
             new IdAndName()
             {
                 Name    = SiteMap.RootNode.Title
                 , Value = SiteMap.RootNode.Url
                 , Void  = true
             },
             new IdAndName()
             {
                 Name    = SiteMap.CurrentNode.ParentNode.ParentNode.Title
                 , Value = SiteMap.CurrentNode.ParentNode.ParentNode.Url
                 , Void  = true
             },
             new IdAndName()
             {
                 Name    = cls.GetCourseFullName
                 , Value = SiteMap.CurrentNode.ParentNode.Url + "?cId=" + (cls.GetCourseId)
                 , Void  = true
             }
             ,
             new IdAndName()
             {
                 Name = cls.GetName
             }
         };
         SiteMapUc.SetData(list);
     }
 }
Пример #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (SiteMap.CurrentNode != null)
         {
             var list = new List <IdAndName>()
             {
                 new IdAndName()
                 {
                     Name    = SiteMap.RootNode.Title
                     , Value = SiteMap.RootNode.Url
                     , Void  = true
                 },
                 new IdAndName()
                 {
                     Name    = SiteMap.CurrentNode.ParentNode.Title
                     , Value = SiteMap.CurrentNode.ParentNode.Url
                     , Void  = true
                 },
                 new IdAndName()
                 {
                     Name = SiteMap.CurrentNode.Title
                 }
             };
             SiteMapUc.SetData(list);
         }
     }
 }
Пример #4
0
 void LoadSitemap(Academic.DbEntities.User.Users user)
 {
     if (SiteMap.CurrentNode != null)
     {
         var list = new List <IdAndName>()
         {
             new IdAndName()
             {
                 Name    = SiteMap.RootNode.Title
                 , Value = SiteMap.RootNode.Url
                 , Void  = true
             },
             new IdAndName()
             {
                 Name    = SiteMap.CurrentNode.ParentNode.Title
                 , Value = SiteMap.CurrentNode.ParentNode.Url
                 , Void  = true
             },
             new IdAndName()
             {
                 Name = user.FullName
                        //Name = SiteMap.CurrentNode.Title
             }
         };
         SiteMapUc.SetData(list);
     }
 }
Пример #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         var user = Page.User as CustomPrincipal;
         if (user == null)
         {
             loginDiv.Visible = true;
         }
         else
         {
             lnkEdit.Visible = (Session["editMode"] as string) == "1";
             SiteMapUc.SetData(new List <IdAndName>()
             {
                 new IdAndName()
                 {
                     Name = "About"
                 }
             });
         }
         //using (var helper = new DbHelper.Office())
         //{
         //    var school = helper.GetSchoolOfUser(user==null?0:user.SchoolId);
         //    lblDescription.Text = school.Description;
         //}
     }
 }
Пример #6
0
 void LoadSitemap(Academic.DbEntities.Class.SubjectClass cls)
 {
     if (SiteMap.CurrentNode != null)
     {
         var list = new List <IdAndName>()
         {
             new IdAndName()
             {
                 Name    = SiteMap.RootNode.Title
                 , Value = SiteMap.RootNode.Url
                 , Void  = true
             },
             //new IdAndName(){
             //    Name = SiteMap.CurrentNode.ParentNode.ParentNode.Title
             //    ,Value = SiteMap.CurrentNode.ParentNode.ParentNode.Url
             //    ,Void=true
             //},
             new IdAndName()
             {
                 Name    = cls.GetCourseFullName
                 , Value = "~/Views/Course/Section/?SubId=" + cls.GetCourseId + "&from=detail"
                           //,Value = SiteMap.CurrentNode.ParentNode.Url+"?cId="+(cls.GetCourseId)
                 , Void = true
             }
             ,
             new IdAndName()
             {
                 Name = cls.GetName
             }
         };
         SiteMapUc.SetData(list);
     }
 }
Пример #7
0
 void LoadSiteMap(string dir, string year, string subyear)
 {
     if (SiteMap.CurrentNode != null)
     {
         var list = new List <IdAndName>()
         {
             new IdAndName()
             {
                 Name    = SiteMap.RootNode.Title
                 , Value = SiteMap.RootNode.Url
                 , Void  = true
             },
             new IdAndName()
             {
                 Name    = SiteMap.CurrentNode.ParentNode.ParentNode.Title
                 , Value = SiteMap.CurrentNode.ParentNode.ParentNode.Url
                 , Void  = true
             },
             new IdAndName()
             {
                 Name    = dir
                 , Value = SiteMap.CurrentNode.ParentNode.Url + "?yId=" + year + "&sId=" + subyear
                 , Void  = true
             },
             new IdAndName()
             {
                 Name = "Assign courses"
             }
         };
         SiteMapUc.SetData(list);
     }
 }
Пример #8
0
        void LoadSitemap(Academic.DbEntities.Subjects.Subject sub)
        {
            if (SiteMap.CurrentNode != null)
            {
                var list = new List <IdAndName>()
                {
                    new IdAndName()
                    {
                        Name  = SiteMap.RootNode.Title,
                        Value = SiteMap.RootNode.Url,
                        Void  = true
                    },
                };

                var from = Request.QueryString["from"];
                if (from == "detail")
                {
                    //courses
                    list.Add(new IdAndName()
                    {
                        Name  = SiteMap.CurrentNode.ParentNode.ParentNode.Title,
                        Value = SiteMap.CurrentNode.ParentNode.ParentNode.Url,
                        Void  = true
                    });
                    //courseName -- detail view
                    list.Add(new IdAndName()
                    {
                        Name  = sub.FullName,
                        Value = SiteMap.CurrentNode.ParentNode.Url + "?cId=" + (sub.Id),
                        Void  = true
                    });
                    //View
                    list.Add(new IdAndName()
                    {
                        Name  = "View",//sub.FullName,
                        Value = "~/Views/Course/Section/?SubId=" + sub.Id + "&from=detail",
                        //SiteMap.CurrentNode.ParentNode.Url + "?cId=" + (sub.Id),
                        Void = true
                    });
                }
                else if (from == "view")
                {
                    //courseName
                    list.Add(new IdAndName()
                    {
                        Name  = sub.FullName,
                        Value = "~/Views/Course/Section/?SubId=" + sub.Id,
                        //SiteMap.CurrentNode.ParentNode.Url + "?cId=" + (sub.Id),
                        Void = true
                    });
                }

                list.Add(new IdAndName()
                {
                    Name = "My Classes"//sub.GetName
                });

                SiteMapUc.SetData(list);
            }
        }
Пример #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var user = Page.User as CustomPrincipal;

            if (user != null)
            {
                if (!IsPostBack)
                {
                    if (SiteMap.CurrentNode != null)
                    {
                        var list = new List <IdAndName>()
                        {
                            new IdAndName()
                            {
                                Name    = SiteMap.RootNode.Title
                                , Value = SiteMap.RootNode.Url
                                , Void  = true
                            },
                            new IdAndName()
                            {
                                Name = SiteMap.CurrentNode.Title
                                       //,Value = SiteMap.CurrentNode.ParentNode.Url
                                       //,Void=true
                            }
                        };
                        SiteMapUc.SetData(list);
                    }
                    var edit = Session["editMode"] ?? "0";//Request.QueryString["edit"];
                    if (user.IsInRole("manager") || user.IsInRole("grader") || user.IsInRole("course-editor"))
                    {
                        if (edit == "1")
                        {
                            Edit          = true;
                            hidTask.Value = DbHelper.StaticValues.Encode("grade");
                            //lnkEdit.NavigateUrl = "~/Views/Grade/GradeListing.aspx?edit=0";
                            //lblEdit.Text = "Exit edit";
                            lnkAddGrade.Visible = true;
                        }
                        else
                        {
                            //lnkEdit.NavigateUrl = "~/Views/Grade/GradeListing.aspx?edit=1";
                            //lblEdit.Text = "Edit";
                            Edit = false;
                            lnkAddGrade.Visible = false;
                        }
                    }

                    using (var helper = new DbHelper.Grade())
                    {
                        DataList1.DataSource = helper.ListGrades(user.SchoolId);
                        DataList1.DataBind();
                    }
                }
            }
            else
            {
                Response.Redirect("~/");
            }
        }
Пример #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var user = User as CustomPrincipal;

            if (!IsPostBack)
            {
                var edit = Session["editMode"] as string;//Request.QueryString["edit"];
                if (edit != null)
                {
                    Edit = edit;
                }
            }

            if (user != null)
            {
                if (SiteMap.CurrentNode != null)
                {
                    var list = new List <IdAndName>()
                    {
                        new IdAndName()
                        {
                            Name    = SiteMap.RootNode.Title
                            , Value = SiteMap.RootNode.Url
                            , Void  = true
                        },
                        new IdAndName()
                        {
                            Name = SiteMap.CurrentNode.Title
                                   //,Value = SiteMap.CurrentNode.Url
                                   //,Void=true
                        }
                    };
                    SiteMapUc.SetData(list);
                }
                if (!user.IsInRole("manager"))
                {
                    Edit = "0";
                    //lnkEdit.Visible = false;
                    lnkAdd.Visible = false;

                    LoadCompressMode(user.SchoolId);
                    //LoadListMode(user.SchoolId);
                }
                else if (Edit == "1")
                {
                    //lnkEdit.Visible = true;
                    lnkAdd.Visible     = true;
                    lnkAdd.NavigateUrl = "~/Views/Structure/StructureCreate.aspx?pId=" + user.SchoolId + "&strTyp=pro";
                    lblAddText.Text    = "Add Program";

                    LoadCompressMode(user.SchoolId);
                }
                else
                {
                    LoadCompressMode(user.SchoolId);
                    //LoadListMode(user.SchoolId);
                }
            }
        }
Пример #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var user = Page.User as CustomPrincipal;

            if (user != null)
            {
                if (!IsPostBack)
                {
                    if (SiteMap.CurrentNode != null)
                    {
                        var list = new List <IdAndName>()
                        {
                            new IdAndName()
                            {
                                Name    = SiteMap.RootNode.Title
                                , Value = SiteMap.RootNode.Url
                                , Void  = true
                            },
                            new IdAndName()
                            {
                                Name = SiteMap.CurrentNode.Title
                                       //,Value = SiteMap.CurrentNode.ParentNode.Url
                                       //,Void=true
                            }
                        };
                        SiteMapUc.SetData(list);
                    }

                    //search process
                    var searchText = Request.QueryString["input"];
                    //var full = "";
                    var words    = searchText.Split(new char[] { ' ' });
                    var newWords = words.Where(x => !(string.IsNullOrEmpty(x))).ToArray();
                    if (!newWords.Any())
                    {
                        return;
                    }
                    lblHeading.Text = searchText;
                    using (var helper = new DbHelper.Search())
                    {
                        var searchedList = helper.SearchCourse(newWords, user.SchoolId);
                        foreach (var item in searchedList)
                        {
                            var uc =
                                (All_Resusable_Codes.ListDisplay.ItemUc)
                                Page.LoadControl("~/Views/All_Resusable_Codes/ListDisplay/ItemUc.ascx");
                            uc.SetValues(item.IdInString, item.Name, item.Value);
                            pnlSearchResult.Controls.Add(uc);
                        }
                        if (searchedList.Any())
                        {
                            lblEmptyData.Visible = false;
                        }
                    }
                }
            }
        }
Пример #12
0
 private void LoadSiteMap()
 {
     SiteMapUc.SetData(new List <IdAndName>()
     {
         new IdAndName()
         {
             Name = "Delete"
         }
     });
 }
Пример #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var loadType = Request.QueryString["type"];
                var curNode  = new IdAndName()
                {
                    Name = "Current courses"
                };
                LstUc1.LoadType = loadType;

                if (loadType == "earlier")
                {
                    lblHeading.Text     = "Earlier courses";
                    lblTitle.Text       = "Earlier courses";
                    curNode.Name        = "Earlier courses";
                    lnkGoto.Text        = "Go to current courses";
                    lnkGoto.NavigateUrl = "~/Views/Courses/?type=current";
                }
                else
                {
                    lblHeading.Text     = "Current courses";
                    lblTitle.Text       = "Current courses";
                    lnkGoto.Text        = "Go to earlier courses";
                    lnkGoto.NavigateUrl = "~/Views/Courses/?type=earlier";
                }
                var user = Page.User as CustomPrincipal;
                if (user != null)
                {
                    if (SiteMap.CurrentNode != null)
                    {
                        var list = new List <IdAndName>()
                        {
                            new IdAndName()
                            {
                                Name    = SiteMap.RootNode.Title
                                , Value = SiteMap.RootNode.Url
                                , Void  = true
                            },
                            curNode
                        };
                        SiteMapUc.SetData(list);
                    }
                    //LstUc1.SchoolId = user.SchoolId;//Values.Session.GetSchool(Session);
                    LstUc1.UserId         = user.Id;             //Values.Session.GetUser(Session);
                    LstUc1.AcademicYearId = user.AcademicYearId; //Values.Session.GetAcademicYear(Session);
                    LstUc1.SessionId      = user.SessionId;      //Values.Session.GetSession(Session);
                    LstUc1.UserType       = "student";
                }
                else
                {
                    //logout the user
                }
            }
        }
Пример #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var user = User as CustomPrincipal;

            if (user != null)
            {
                if (!IsPostBack)
                {
                    if (SiteMap.CurrentNode != null)
                    {
                        var list = new List <IdAndName>()
                        {
                            new IdAndName()
                            {
                                Name    = SiteMap.RootNode.Title
                                , Value = SiteMap.RootNode.Url
                                , Void  = true
                            },
                            new IdAndName()
                            {
                                Name = SiteMap.CurrentNode.Title
                                       //,Value = SiteMap.CurrentNode.ParentNode.Url
                                       //,Void=true
                            }
                        };
                        SiteMapUc.SetData(list);
                    }
                    if (user.IsInRole("manager") || user.IsInRole("course-editor"))
                    {
                        var edit = ((Session["editMode"] as string) ?? "0") == "1";
                        lnkCoursCreate.Visible = edit;
                        lnkCatCreate.Visible   = edit;
                        Manager = edit;
                    }
                    else
                    {
                        lnkCoursCreate.Visible = false;
                        lnkCatCreate.Visible   = false;
                        Manager = false;
                    }
                    SchoolId = user.SchoolId;
                    //categoryCreate.SchoolId = user.SchoolId;

                    var catId = Request.QueryString["catId"];
                    if (catId != null)
                    {
                        SelectedCategory = Convert.ToInt32(catId);
                    }
                }
                //LoadCategoriesAndSubCategories(user.SchoolId);
                LoadCategories(user.SchoolId);
            }
        }
Пример #15
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //lblAcademicYearError.Visible = false;
     txtName.Focus();
     lblError.Visible = false;
     if (!IsPostBack)
     {
         var user = User as CustomPrincipal;
         if (user != null)
         {
             try
             {
                 if (SiteMap.CurrentNode != null)
                 {
                     var list = new List <IdAndName>()
                     {
                         new IdAndName()
                         {
                             Name    = SiteMap.RootNode.Title
                             , Value = SiteMap.RootNode.Url
                             , Void  = true
                         },
                         new IdAndName()
                         {
                             Name    = SiteMap.CurrentNode.ParentNode.Title
                             , Value = SiteMap.CurrentNode.ParentNode.Url + "?edit=1"
                             , Void  = true
                         }
                         , new IdAndName()
                         {
                             Name = SiteMap.CurrentNode.Title
                         }
                     };
                     SiteMapUc.SetData(list);
                 }
                 var id = Request.QueryString["bId"];
                 if (id != null)
                 {
                     SetDatasForEdit(Convert.ToInt32(id.ToString()));
                 }
                 LoadStructure(user.SchoolId);
             }
             catch
             {
                 //batchlist redirect
             }
         }
     }
 }
Пример #16
0
        private void SetSitemap()
        {
            var list = new List <IdAndName>();

            list.Add(new IdAndName()
            {
                Name  = "Home",
                Value = "~/",
                Void  = true,
            });
            list.Add(new IdAndName()
            {
                Name = "Due Classes"
            });
            SiteMapUc.SetData(list);
        }
Пример #17
0
 private void PopulateCourseData(int courseId)
 {
     using (var helper = new DbHelper.Subject())
     {
         var course = helper.GetCourse(courseId);
         if (course != null)
         {
             if (SiteMap.CurrentNode != null)
             {
                 var list = new List <IdAndName>()
                 {
                     new IdAndName()
                     {
                         Name    = SiteMap.RootNode.Title
                         , Value = SiteMap.RootNode.Url
                         , Void  = true
                     },
                     new IdAndName()
                     {
                         Name    = SiteMap.CurrentNode.ParentNode.Title
                         , Value = SiteMap.CurrentNode.ParentNode.Url
                         , Void  = true
                     }
                     ,
                     new IdAndName()
                     {
                         Name    = course.FullName
                         , Value = "~/Views/Course/CourseDetail.aspx?cId=" + course.Id
                         , Void  = true
                     }
                     , new IdAndName()
                     {
                         Name = "Edit"
                     }
                 };
                 SiteMapUc.SetData(list);
             }
             txtName.Text      = course.FullName;
             txtShortName.Text = course.ShortName;
             txtCode.Text      = course.Code;
             txtCredit.Text    = course.Credit.ToString();
             CKEditor1.Text    = course.Summary;
             CategoryId        = CategoryId;
         }
     }
 }
Пример #18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var user = User as CustomPrincipal;
                if (user != null)
                {
                    if (SiteMap.CurrentNode != null)
                    {
                        var list = new List <IdAndName>()
                        {
                            new IdAndName()
                            {
                                Name    = SiteMap.RootNode.Title
                                , Value = SiteMap.RootNode.Url
                                , Void  = true
                            },
                            new IdAndName()
                            {
                                Name = SiteMap.CurrentNode.Title
                                       //,Value = SiteMap.CurrentNode.ParentNode.Url
                                       //,Void=true
                            }
                        };
                        SiteMapUc.SetData(list);
                    }
                    var edit = (Session["editMode"] as string) ?? "0";
                    if (user.IsInRole("manager"))
                    {
                        var editable = edit == "1";
                        lnkAddNewUser.Visible = editable;
                        lnkAssignRole.Visible = editable;
                    }
                    else
                    {
                        lnkAddNewUser.Visible = false;
                        lnkAssignRole.Visible = false;
                    }



                    hidSchoolId.Value = user.SchoolId.ToString();
                }
            }
        }
Пример #19
0
        private void LoadSitemap(Academic.DbEntities.AcacemicPlacements.RunningClass rc)
        {
            #region SiteMap

            var ses = rc.Session;
            if (SiteMap.CurrentNode != null)
            {
                var list = new List <IdAndName>()
                {
                    new IdAndName()
                    {
                        Name    = SiteMap.RootNode.Title
                        , Value = SiteMap.RootNode.Url
                        , Void  = true
                    },
                    new IdAndName()
                    {
                        Name    = SiteMap.CurrentNode.ParentNode.ParentNode.ParentNode.Title
                        , Value = SiteMap.CurrentNode.ParentNode.ParentNode.ParentNode.Url
                        , Void  = true
                    },
                    new IdAndName()
                    {
                        Name    = ses.AcademicYear.Name
                        , Value = SiteMap.CurrentNode.ParentNode.ParentNode.Url + "?aId=" + ses.AcademicYear.Id
                        , Void  = true
                    },
                    new IdAndName()
                    {
                        Name  = ses.Name,
                        Value = SiteMap.CurrentNode.ParentNode.Url + "?aId=" + ses.AcademicYearId + "&sId=" + ses.Id,
                        Void  = true,
                        //Name = (task == "activate")?"Activate":"Mark Complete"
                    },
                    new IdAndName()
                    {
                        Name = rc.ProgramBatch.NameFromBatch
                    }
                };
                SiteMapUc.SetData(list);
            }

            #endregion
        }
Пример #20
0
 void LoadSiteMap(bool edit, Academic.DbEntities.Batches.Batch batch)
 {
     if (SiteMap.CurrentNode != null)
     {
         var list = new List <IdAndName>()
         {
             new IdAndName()
             {
                 Name = SiteMap.RootNode.Title
                 ,
                 Value = SiteMap.RootNode.Url
                 ,
                 Void = true
             },
             //new IdAndName()
             //{
             //    Name = SiteMap.CurrentNode.ParentNode.Title
             //    ,
             //    Value = SiteMap.CurrentNode.ParentNode.ParentNode.ParentNode.Url
             //    ,
             //    Void = true
             //},
             new IdAndName()
             {
                 Name = SiteMap.CurrentNode.ParentNode.ParentNode.Title
                 ,
                 Value = SiteMap.CurrentNode.ParentNode.ParentNode.Url
                 ,
                 Void = true
             },
             new IdAndName()
             {
                 Name  = batch.AcademicYear.Name,
                 Value = SiteMap.CurrentNode.ParentNode.Url + "?aId=" + batch.AcademicYear.Id,
                 Void  = true
             },
             new IdAndName()
             {
                 Name = batch.Name,
             }
         };
         SiteMapUc.SetData(list);
     }
 }
Пример #21
0
        void LoadSitemap(Academic.DbEntities.Class.SubjectClass cls)
        {
            var from = Request.QueryString["from"];

            from = from ?? "";
            if (SiteMap.CurrentNode != null)
            {
                var list = new List <IdAndName>()
                {
                    new IdAndName()
                    {
                        Name    = SiteMap.RootNode.Title
                        , Value = SiteMap.RootNode.Url
                        , Void  = true
                    },
                    new IdAndName()
                    {
                        Name    = SiteMap.CurrentNode.ParentNode.ParentNode.ParentNode.Title
                        , Value = SiteMap.CurrentNode.ParentNode.ParentNode.Url
                        , Void  = true
                    },
                    new IdAndName()
                    {
                        Name    = cls.GetCourseFullName
                        , Value = SiteMap.CurrentNode.ParentNode.ParentNode.Url + "?cId=" + (cls.GetCourseId)
                        , Void  = true
                    }
                    ,
                    new IdAndName()
                    {
                        Name    = cls.GetName
                        , Value = "~/Views/Class/CourseClassDetail.aspx?ccId=" + cls.Id +
                                  "&from=" + from,
                        Void = true
                    }
                    , new IdAndName()
                    {
                        Name = "Report"
                    }
                };
                SiteMapUc.SetData(list);
            }
        }
Пример #22
0
 protected void Page_Load(object sender, EventArgs e)
 {
     //Create1.SaveClicked += CreateUC_SaveClicked;
     //Create1.CancelClicked += CreateUC_SaveClicked;
     if (!IsPostBack)
     {
         var user = Page.User as CustomPrincipal;
         if (user != null)
         {
             if (SiteMap.CurrentNode != null)
             {
                 var list = new List <IdAndName>()
                 {
                     new IdAndName()
                     {
                         Name    = SiteMap.RootNode.Title
                         , Value = SiteMap.RootNode.Url
                         , Void  = true
                     },
                     new IdAndName()
                     {
                         Name    = SiteMap.CurrentNode.ParentNode.Title
                         , Value = SiteMap.CurrentNode.ParentNode.Url
                         , Void  = true
                     },
                     new IdAndName()
                     {
                         Name = "Course Category edit"
                     }
                 };
                 SiteMapUc.SetData(list);
             }
             Create1.SchoolId = user.SchoolId;
             var catId = Request.QueryString["catId"];
             if (catId != null)
             {
                 Create1.ParentCategoryId = Convert.ToInt32(catId);
             }
         }
     }
 }
Пример #23
0
 private void SetSitemap(bool isServerFile)
 {
     if (SiteMap.CurrentNode != null)
     {
         var list = new List <IdAndName>()
         {
             new IdAndName()
             {
                 Name    = SiteMap.RootNode.Title
                 , Value = SiteMap.RootNode.Url
                 , Void  = true
             },
             new IdAndName()
             {
                 Name = isServerFile?"Server Files" : "Private Files"         //SiteMap.CurrentNode.Title
                        //,Value = SiteMap.CurrentNode.ParentNode.Url
                        //,Void=true
             }
         };
         SiteMapUc.SetData(list);
     }
 }
Пример #24
0
 protected void Page_Load(object sender, EventArgs e)
 {
     lblError.Visible = false;
     SetToDefaults();
     txtName.Focus();
     try
     {
         if (!IsPostBack)
         {
             if (SiteMap.CurrentNode != null)
             {
                 var list = new List <IdAndName>()
                 {
                     new IdAndName()
                     {
                         Name    = SiteMap.RootNode.Title
                         , Value = SiteMap.RootNode.Url
                         , Void  = true
                     },
                     new IdAndName()
                     {
                         Name    = SiteMap.CurrentNode.ParentNode.Title
                         , Value = SiteMap.CurrentNode.ParentNode.Url + "?edit=1"
                         , Void  = true
                     },
                     new IdAndName()
                     {
                         Name = SiteMap.CurrentNode.Title
                     }
                 };
                 SiteMapUc.SetData(list);
             }
             LoadData();
         }
     }
     catch { }
 }
Пример #25
0
 private void DisplaySchoolInfo(int userId)
 {
     using (var helper = new DbHelper.Office())
     {
         var school = helper.GetSchoolOfUser(userId);
         if (school != null)
         {
             if (SiteMap.CurrentNode != null)
             {
                 var list = new List <IdAndName>()
                 {
                     new IdAndName()
                     {
                         Name    = SiteMap.RootNode.Title
                         , Value = SiteMap.RootNode.Url
                         , Void  = true
                     },
                     new IdAndName()
                     {
                         Name = school.Name
                                //,Value = SiteMap.CurrentNode.ParentNode.Url
                                //,Void=true
                     }
                 };
                 SiteMapUc.SetData(list);
             }
             lblName.Text = school.Name;
             //lblSchoolName.Text = school.Name;
             //lblSchoolType.Text = school.SchoolType == null ? "" : school.SchoolType.Name;
             //lblCity.Text = string.IsNullOrEmpty(school.City)?"N/A":school.City;
             lblCountry.Text = string.IsNullOrEmpty(school.Address)?"N/A":school.Address;
             lblEmail.Text   = string.IsNullOrEmpty(school.EmailGeneral)?"N/A":school.EmailGeneral;
             lblWebsite.Text = string.IsNullOrEmpty(school.Website)?"N/A":school.Website;
             lblPhoneNo.Text = string.IsNullOrEmpty(school.PhoneMain)?"N/A":school.PhoneMain;
         }
     }
 }
Пример #26
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var user = Page.User as CustomPrincipal;
                if (user == null)
                {
                    loginDiv.Visible = true;
                }
                else
                {
                    SiteMapUc.SetData(new List <IdAndName>()
                    {
                        new IdAndName()
                        {
                            Name = "Contact"
                        }
                    });
                }
                using (var helper = new DbHelper.Office())
                {
                    var school = helper.GetSchoolOfUser(user == null ? 0 : user.SchoolId);
                    lblAddress.Text             = school.Address;
                    lblPhoneAfterHours.Text     = school.PhoneAfterHours;
                    lblPhoneMain.Text           = school.PhoneMain;
                    lnkEmailGeneral.Text        = school.EmailGeneral;
                    lnkEmailGeneral.NavigateUrl = "mailto:" + school.EmailGeneral;

                    lnkEmailMarketing.Text        = school.EmailMarketing;
                    lnkEmailMarketing.NavigateUrl = "mailto:" + school.EmailMarketing;

                    lnkEmailSupport.Text        = school.EmailSupport;
                    lnkEmailSupport.NavigateUrl = "mailto:" + school.EmailSupport;
                }
            }
        }
Пример #27
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //show notice in between
            var user = Page.User as CustomPrincipal;

            if (user != null)
            {
                if (SiteMap.CurrentNode != null)
                {
                    var list = new List <IdAndName>()
                    {
                        new IdAndName()
                        {
                            Name = SiteMap.RootNode.Title
                                   // ,Value =  SiteMap.RootNode.Url
                        },
                    };
                    SiteMapUc.SetData(list);
                }

                //NoticeBoardUc.UserId = user.Id;
                //NoticeBoardUc.SchoolId = user.SchoolId;

                OpenClassesUc.UserId   = user.Id;
                OpenClassesUc.SchoolId = user.SchoolId;


                LstUc.HeadingText    = "Course Notifications";
                LstUc.UserId         = user.Id;             //Values.Session.GetUser(Session);
                LstUc.AcademicYearId = user.AcademicYearId; //Values.Session.GetAcademicYear(Session);
                LstUc.SessionId      = user.SessionId;      //Values.Session.GetSession(Session);
                LstUc.UserType       = "student";
                LstUc.FromDashboard  = true;
                //var eventsUc = (ModulesUc.EventsUc)
                //    Page.LoadControl("~/ViewsSite/User/ModulesUc/EventsUc.ascx");
                //eventsUc.UserId = user.Id;
                //eventsUc.SchoolId = school.Id;
                //pnlRight.Controls.Add(eventsUc);

                var noticeBoardUc = (ViewsSite.User.ModulesUc.NoticeBoardUc)
                                    Page.LoadControl("~/ViewsSite/User/ModulesUc/NoticeBoardUc.ascx");
                noticeBoardUc.UserId   = user.Id;
                noticeBoardUc.SchoolId = user.SchoolId;
                pnlRight.Controls.Add(noticeBoardUc);

                pnlRight.Controls.Add(new Literal()
                {
                    Text = "<br/>"
                });

                var onlineUsersUc = (ViewsSite.User.ModulesUc.OnlineUsersUc)
                                    Page.LoadControl("~/ViewsSite/User/ModulesUc/OnlineUsersUc.ascx");
                onlineUsersUc.UserId   = user.Id;
                onlineUsersUc.SchoolId = user.SchoolId;
                pnlRight.Controls.Add(onlineUsersUc);

                //var noticeBoardUc = (ViewsSite.User.ModulesUc.NoticeBoardUc)
                //                          Page.LoadControl("~/ViewsSite/User/ModulesUc/NoticeBoardUc.ascx");
                //noticeBoardUc.UserId = user.Id;
                //noticeBoardUc.SchoolId = user.SchoolId;
                //pnlBody.Controls.Add(noticeBoardUc);
            }



            //earlier code
            //if (!User.Identity.IsAuthenticated)
            //{
            //    Response.Redirect("~/ViewsSite/Account/Login.aspx");
            //}
            //if (!IsPostBack)
            //{
            //    var loadType = Request.QueryString["type"];

            //    LstUc1.LoadType = loadType;

            //    var user = Page.User as CustomPrincipal;
            //    if (user != null)
            //    {
            //        if (SiteMap.CurrentNode != null)
            //        {
            //            var list = new List<IdAndName>()
            //            {
            //               new IdAndName(){
            //                            Name=SiteMap.RootNode.Title
            //                           // ,Value =  SiteMap.RootNode.Url
            //                        },
            //            };
            //            SiteMapUc.SetData(list);
            //        }
            //        //LstUc1.SchoolId = user.SchoolId;//Values.Session.GetSchool(Session);
            //        LstUc1.UserId = user.Id;//Values.Session.GetUser(Session);
            //        LstUc1.AcademicYearId = user.AcademicYearId;//Values.Session.GetAcademicYear(Session);
            //        LstUc1.SessionId = user.SessionId;//Values.Session.GetSession(Session);
            //        LstUc1.UserType = "student";
            //    }
            //    else
            //    {
            //        //logout the user

            //    }


            //}
        }
Пример #28
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var user = Page.User as CustomPrincipal;
                if (user != null)
                {
                    if (SiteMap.CurrentNode != null)
                    {
                        var list = new List <IdAndName>()
                        {
                            new IdAndName()
                            {
                                Name    = SiteMap.RootNode.Title
                                , Value = SiteMap.RootNode.Url
                                , Void  = true
                            },
                            new IdAndName()
                            {
                                Name = SiteMap.CurrentNode.Title
                                       //,Value = SiteMap.CurrentNode.Url
                            }
                        };
                        SiteMapUc.SetData(list);
                    }
                    listUc.SchoolId = user.SchoolId;          //Values.Session.GetSchool(Session);
                    var edit = Session["editMode"] as string; //Request.QueryString["edit"];

                    //earlier
                    //if ((user.IsInRole("manager") || user.IsInRole("admitter")))
                    //{
                    //    if (edit != null)
                    //    {
                    //        listUc.Edit = edit;
                    //        if (edit == "1")
                    //        {
                    //            //lnkEdit.NavigateUrl = "~/Views/Student/?edit=0";
                    //            //lblEdit.Text = "Exit edit";
                    //            lnkAdd.Visible = true;
                    //        }
                    //        else
                    //        {
                    //            //lnkEdit.NavigateUrl = "~/Views/Student/?edit=1";
                    //            //lblEdit.Text = "Edit";
                    //            lnkAdd.Visible = false;
                    //        }
                    //    }
                    //    else
                    //    {
                    //        //lnkEdit.NavigateUrl = "~/Views/Student/?edit=1";
                    //        //lblEdit.Text = "Edit";
                    //        lnkAdd.Visible = false;
                    //    }
                    //}
                    //else
                    //{
                    //    //lnkEdit.Visible = false;
                    //    lnkAdd.Visible = false;
                    //}
                }
            }
        }
Пример #29
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //StudentCreateUc1.CloseClicked += StudentCreateUc1_CloseClicked;
            //StudentCreateUc1.SaveClicked += StudentCreateUc1_CloseClicked;
            lblSaveError.Text    = "Couldn't save";
            lblSaveError.Visible = false;
            if (!IsPostBack)
            {
                try
                {
                    var pbId = Request.QueryString["pbId"];
                    //var bId = Request.QueryString["bId"];
                    if (pbId != null)
                    {
                        var pbatchId = Convert.ToInt32(pbId);
                        //BatchId = Convert.ToInt32(bId);
                        ProgramBatchId = pbatchId;
                        //StudentCreateUc1.ProgramBatchId = pbatchId;

                        #region Get program batch name from database and populate sitemap

                        using (var helper = new DbHelper.Batch())
                        {
                            var editQuery = Request.QueryString["edit"];
                            var edit      = (editQuery ?? "0").ToString();
                            var pbatch    = helper.GetProgramBatch(pbatchId);
                            if (pbatch != null)
                            {
                                if (SiteMap.CurrentNode != null)
                                {
                                    var list = new List <IdAndName>()
                                    {
                                        new IdAndName()
                                        {
                                            Name    = SiteMap.RootNode.Title
                                            , Value = SiteMap.RootNode.Url
                                            , Void  = true
                                        },
                                        new IdAndName()
                                        {
                                            Name    = SiteMap.CurrentNode.ParentNode.ParentNode.ParentNode.ParentNode.Title
                                            , Value = SiteMap.CurrentNode.ParentNode.ParentNode.ParentNode.ParentNode.Url
                                            , Void  = true
                                        },
                                        new IdAndName()
                                        {
                                            Name    = pbatch.Batch.AcademicYear.Name
                                            , Value = SiteMap.CurrentNode.ParentNode.ParentNode.ParentNode.Url + "?aId=" + pbatch.Batch.AcademicYear.Id + "&edit=" + edit
                                            , Void  = true
                                        }
                                        , new IdAndName()
                                        {
                                            Name    = pbatch.Batch.Name
                                            , Value = SiteMap.CurrentNode.ParentNode.ParentNode.Url + "?Id=" + pbatch.BatchId + "&edit=" + edit
                                            , Void  = true
                                        }
                                        , new IdAndName()
                                        {
                                            Name    = pbatch.Program.Name
                                            , Value = SiteMap.CurrentNode.ParentNode.Url + "?pbId=" + pbatch.Id + "&edit=" + edit
                                            , Void  = true
                                        }
                                        , new IdAndName()
                                        {
                                            Name = "Student edit"
                                        }
                                    };
                                    SiteMapUc.SetData(list);
                                }
                            }
                        }

                        #endregion
                    }
                    else
                    {
                        Response.Redirect("~/Views/Student/");
                    }
                }
                catch
                {
                    Response.Redirect("~/Views/Student/");
                }
            }
        }
Пример #30
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lblErrorMsg.Visible = false;
            if (!IsPostBack)
            {
                var user = Page.User as CustomPrincipal;
                if (user != null)
                {
                    IdAndName noticeName = null;
                    var       nId        = Request.QueryString["nId"];
                    if (nId != null)
                    {
                        NoticeId = Convert.ToInt32(nId);
                        using (var helper = new DbHelper.Notice())
                        {
                            var notice = helper.GetNotice(NoticeId);
                            if (notice != null)
                            {
                                noticeName = new IdAndName()
                                {
                                    Name = notice.Title, Value = "~/Views/NoticeBoard/NoticeDetail.aspx?nId=" + notice.Id, Void = true
                                };
                                txtHeading.Text            = notice.Title;
                                CKEditor1.Text             = notice.Content;
                                chkPublish.Checked         = notice.PublishNoticeToNoticeBoard;
                                ddlPublishTo.SelectedIndex = (notice.NoticePublishTo ?? false) ? 0 : 1;

                                ddlPublishTo.Visible = notice.PublishNoticeToNoticeBoard;

                                lblPageitle.Text = "Notice Edit";

                                //var updaetd = helper.AddOrUpdateNoticeNotification(Convert.ToInt32(nId), user.Id);
                            }
                        }
                    }

                    if (SiteMap.CurrentNode != null)
                    {
                        var list = new List <IdAndName>()
                        {
                            new IdAndName()
                            {
                                Name    = SiteMap.RootNode.Title
                                , Value = SiteMap.RootNode.Url
                                , Void  = true
                            },
                            new IdAndName()
                            {
                                Name    = SiteMap.CurrentNode.ParentNode.Title
                                , Value = SiteMap.CurrentNode.ParentNode.Url
                                , Void  = true
                            }
                            ,
                        };
                        if (noticeName != null)
                        {
                            list.Add(noticeName);
                            //list.Add(new IdAndName(){});
                            list.Add(new IdAndName()
                            {
                                Name = "Edit"
                                       //,Value = SiteMap.CurrentNode.Url
                                       //,Void=true
                            });
                        }
                        else
                        {
                            list.Add(new IdAndName()
                            {
                                Name = SiteMap.CurrentNode.Title
                                       //,Value = SiteMap.CurrentNode.Url
                                       //,Void=true
                            });
                        }

                        SiteMapUc.SetData(list);
                    }
                }
            }
        }