Exemple #1
0
        void itemuc_ChapterClicked(object sender, Academic.ViewModel.IdAndNameEventArgs e)
        {
            try
            {
                var early = Session["EarlierSelectedChapter_" + hidPageKey.Value];
                if (early != null)
                {
                    var earlier = pnlToc.FindControl("chapters_" + early);
                    if (earlier != null)
                    {
                        var ear = earlier as BookItems.TocItemsUc;
                        if (ear != null)
                        {
                            ear.Deselect();
                            //Session["EarlierSelectedChapter_" + hidPageKey.Value] = e.Id;
                        }
                    }
                }

                var clicked = pnlToc.FindControl("chapters_" + e.Id);
                if (clicked != null)
                {
                    var cl = clicked as BookItems.TocItemsUc;
                    if (cl != null)
                    {
                        cl.Select();
                        Session["EarlierSelectedChapter_" + hidPageKey.Value] = e.Id;
                        LoadContent(e.Id, e.Name);
                        //imgPrevTop.CommandArgument= e.
                    }
                }
            }
            catch { }
        }
Exemple #2
0
        void CustomDialog1_ItemClick(object sender, Academic.ViewModel.IdAndNameEventArgs e)
        {
            //var selectedValue = ddlAddStudent.SelectedValue.ToString();
            switch (e.Id)
            {
            case -1:
                //MultiView1.ActiveViewIndex = 0;
                break;

            case 0:
                //create student
                Response.Redirect("~/Views/Student/Batch/Student/StudentCreate.aspx?pbId=" + ProgramBatchId);
                //MultiView1.ActiveViewIndex = 1;
                break;

            case 1:

                //MultiView1.ActiveViewIndex = 2;
                break;

            case 2:
                //import from file
                Response.Redirect("~/Views/Student/Batch/Student/ImportStudentFromFile.aspx?pbId=" + ProgramBatchId);
                //MultiView1.ActiveViewIndex = 3;
                break;
            }
            CustomDialog1.CloseDialog();
        }
Exemple #3
0
 void FileListingUc1_DeleteClicked(object sender, Academic.ViewModel.IdAndNameEventArgs e)
 {
     FileDeleteDialogUc1.FileName = e.Name;
     FileDeleteDialogUc1.FileId   = e.Id;
     //FileDeleteDialogUc1.ParentFolderId
     FileDeleteDialogUc1.SetValues("Delete " + e.RefIdString);
     FileDeleteDialogUc1.OpenDialog();
 }
Exemple #4
0
 void FileListingUc1_RenameClicked(object sender, Academic.ViewModel.IdAndNameEventArgs e)
 {
     FolderAddDialogUc1.FolderId   = e.Id;
     FolderAddDialogUc1.FolderName = e.Name;
     if (e.Check)
     {
         FolderAddDialogUc1.SetValues("Folder rename");
     }
     else
     {
         FolderAddDialogUc1.SetValues("File rename");
     }
     FolderAddDialogUc1.OpenDialog();
 }
Exemple #5
0
        public void uc_RemoveClicked(object sender, Academic.ViewModel.IdAndNameEventArgs e)
        {
            var send = sender as ChoiceOptionsCreate;

            if (send != null)
            {
                var options = ViewState["Options" + hidPageKey.Value] as
                              List <ChoiceViewModel>;
                if (options != null)
                {
                    var opt = options.Find(x => x.Id == send.OptionId);
                    if (opt != null)
                    {
                        var count = Convert.ToInt32(hidCountOfOptions.Value);
                        //pnlOptions.Controls.Remove(send);
                        send.Visible = false;
                        //hidCountOfOptions.Value = (count - 1).ToString();
                        opt.Visible = false;
                    }
                }
            }
        }
Exemple #6
0
 void FileDeleteDialogUc1_OkClick(object sender, Academic.ViewModel.IdAndNameEventArgs e)
 {
     FileDeleteDialogUc1.CloseDialog();
     FileListingUc1.ResetView();
 }
Exemple #7
0
        void Choose_RestrictionChoosenNew(object sender, Academic.ViewModel.IdAndNameEventArgs e)
        {
            var restrictionId = Session["CurrentRestrictionId"];
            var restriction   = Session["ControlList"] as RestrictionIdName;

            //if (list == null) list = new List<RestrictionIdName>();
            if (restrictionId != null)
            {
                var split = restrictionId.ToString().Split(new char[] { '_' });

                var parent = GetParentRestriction(restriction, split, RestrictionFifth1);


                if (parent != null && _foundMain != null) //new
                {
                    var list = parent.Children;           //[restrictionId.ToString()];

                    var noOfChildRestrictions = parent.Children.Count;
                    var thisId = (noOfChildRestrictions + 1);
                    RestrictionIdName resClass = null;
                    switch (e.Id)
                    {
                    case 0:
                        resClass = GetRestriction(restrictionId.ToString(), "activity"
                                                  , thisId.ToString(), restrictionId + "_" + thisId
                                                  , "", new List <RestrictionIdName>());

                        var activityCompleteRestriction = (ActivityCompleteRestrictionUC)
                                                          Page.LoadControl("~/Views/RestrictionAccess/ActivityCompleteRestrictionUC.ascx");
                        activityCompleteRestriction.SetIds(resClass.ParentId, resClass.AbsoluteId,
                                                           resClass.RelativeId, resClass.Name);

                        _foundMain.AddControl(activityCompleteRestriction);
                        break;

                    case 1:
                        resClass = GetRestriction(restrictionId.ToString(), "date"
                                                  , thisId.ToString(), restrictionId + "_" + thisId
                                                  , "", new List <RestrictionIdName>());
                        var dateRestriction = (DateRestrictionUC)
                                              Page.LoadControl("~/Views/RestrictionAccess/DateRestrictionUC.ascx");
                        dateRestriction.SetIds(resClass.ParentId, resClass.AbsoluteId,
                                               resClass.RelativeId, resClass.Name);
                        _foundMain.AddControl(dateRestriction);
                        break;

                    case 2:
                        resClass = GetRestriction(restrictionId.ToString(), "grade"
                                                  , thisId.ToString(), restrictionId + "_" + thisId
                                                  , "", new List <RestrictionIdName>());
                        var gradeRestriction = (GradeRestrictionUC)
                                               Page.LoadControl("~/Views/RestrictionAccess/GradeRestrictionUC.ascx");
                        gradeRestriction.SetIds(resClass.ParentId, resClass.AbsoluteId,
                                                resClass.RelativeId, resClass.Name, 0);
                        _foundMain.AddControl(gradeRestriction);
                        break;

                    case 3:
                        resClass = GetRestriction(restrictionId.ToString(), "group"
                                                  , thisId.ToString(), restrictionId + "_" + thisId
                                                  , "", new List <RestrictionIdName>());
                        var groupRestriction = (GroupRestrictionUC)
                                               Page.LoadControl("~/Views/RestrictionAccess/GroupRestrictionUC.ascx");
                        groupRestriction.SetIds(resClass.ParentId, resClass.AbsoluteId,
                                                resClass.RelativeId, resClass.Name, 0);
                        _foundMain.AddControl(groupRestriction);
                        break;

                    case 4:
                        resClass = GetRestriction(restrictionId.ToString(), "userprofile"
                                                  , thisId.ToString(), restrictionId + "_" + thisId
                                                  , "", new List <RestrictionIdName>());
                        var userProfileRestriction = (UserProfileRestriction)
                                                     Page.LoadControl("~/Views/RestrictionAccess/UserProfileRestriction.ascx");
                        userProfileRestriction.SetIds(resClass.ParentId, resClass.AbsoluteId,
                                                      resClass.RelativeId, resClass.Name);
                        _foundMain.AddControl(userProfileRestriction);
                        break;

                    case 5:
                        resClass = GetRestriction(restrictionId.ToString(), "main"
                                                  , thisId.ToString(), restrictionId + "_" + thisId
                                                  , "", new List <RestrictionIdName>());

                        var restrictionSetUc = (RestrictionFifth)
                                               Page.LoadControl("~/Views/RestrictionAccess/Main/RestrictionFifth.ascx");
                        restrictionSetUc.SetIds(resClass.ParentId, resClass.AbsoluteId,
                                                resClass.RelativeId, resClass.Name);
                        _foundMain.AddControl(restrictionSetUc);

                        break;
                    }
                    if (resClass != null)
                    {
                        list.Add(resClass);
                        PutJavaScript();
                        CallJavaScript();
                        //ScriptManager.RegisterStartupScript(this, typeof(Page), "UpdateMsg", "$(document).ready(function(){" +
                        //                                                                     ";alert('Overrides successfully Updated.');" +
                        //                                                                     "});", true);
                        ////ScriptManager.RegisterStartupScript(this, typeof(Page), "UpdateMsg", "$(document).ready(function(){EnableControls();alert('Overrides successfully Updated.');DisableControls();});", true);
                        //lblJavaScript.Text = "<script type='text/javascript'>showDialogue();</script>";
                    }


                    //LoadFromType();
                }
            }
        }
Exemple #8
0
        void Choose_RestrictionChoosenNew(object sender, Academic.ViewModel.IdAndNameEventArgs e)
        {
            var restrictionId = Session["CurrentRestrictionId"];
            var restriction   = Session["ControlList"] as RestrictionIdName;

            //if (list == null) list = new List<RestrictionIdName>();
            if (restrictionId != null)
            {
                var split = restrictionId.ToString().Split(new char[] { '_' });

                var parent = GetParentRestriction(restriction, split, RestrictionFifth1);


                if (parent != null && _foundMain != null) //new
                {
                    var list = parent.Children;           //[restrictionId.ToString()];

                    var noOfChildRestrictions = parent.Children.Count;
                    var thisId = (noOfChildRestrictions + 1);
                    RestrictionIdName resClass = null;
                    switch (e.Id)
                    {
                    case 0:
                        resClass = GetRestriction(restrictionId.ToString(), "activity"
                                                  , thisId.ToString(), restrictionId + "_" + thisId
                                                  , "", new List <RestrictionIdName>());

                        var activityCompleteRestriction = (ActivityCompleteRestrictionUC)
                                                          Page.LoadControl("~/Views/RestrictionAccess/ActivityCompleteRestrictionUC.ascx");
                        activityCompleteRestriction.SetIds(resClass.ParentId, resClass.AbsoluteId,
                                                           resClass.RelativeId, resClass.Name);

                        _foundMain.AddControl(activityCompleteRestriction);
                        break;

                    case 1:
                        resClass = GetRestriction(restrictionId.ToString(), "date"
                                                  , thisId.ToString(), restrictionId + "_" + thisId
                                                  , "", new List <RestrictionIdName>());
                        var dateRestriction = (DateRestrictionUC)
                                              Page.LoadControl("~/Views/RestrictionAccess/DateRestrictionUC.ascx");
                        dateRestriction.SetIds(resClass.ParentId, resClass.AbsoluteId,
                                               resClass.RelativeId, resClass.Name);
                        _foundMain.AddControl(dateRestriction);
                        break;

                    case 2:
                        resClass = GetRestriction(restrictionId.ToString(), "grade"
                                                  , thisId.ToString(), restrictionId + "_" + thisId
                                                  , "", new List <RestrictionIdName>());
                        var gradeRestriction = (GradeRestrictionUC)
                                               Page.LoadControl("~/Views/RestrictionAccess/GradeRestrictionUC.ascx");
                        gradeRestriction.SetIds(resClass.ParentId, resClass.AbsoluteId,
                                                resClass.RelativeId, resClass.Name, 0);
                        _foundMain.AddControl(gradeRestriction);
                        break;

                    case 3:
                        resClass = GetRestriction(restrictionId.ToString(), "group"
                                                  , thisId.ToString(), restrictionId + "_" + thisId
                                                  , "", new List <RestrictionIdName>());
                        var groupRestriction = (GroupRestrictionUC)
                                               Page.LoadControl("~/Views/RestrictionAccess/GroupRestrictionUC.ascx");
                        groupRestriction.SetIds(resClass.ParentId, resClass.AbsoluteId,
                                                resClass.RelativeId, resClass.Name, 0);
                        _foundMain.AddControl(groupRestriction);
                        break;

                    case 4:
                        resClass = GetRestriction(restrictionId.ToString(), "userprofile"
                                                  , thisId.ToString(), restrictionId + "_" + thisId
                                                  , "", new List <RestrictionIdName>());
                        var userProfileRestriction = (UserProfileRestriction)
                                                     Page.LoadControl("~/Views/RestrictionAccess/UserProfileRestriction.ascx");
                        userProfileRestriction.SetIds(resClass.ParentId, resClass.AbsoluteId,
                                                      resClass.RelativeId, resClass.Name);
                        _foundMain.AddControl(userProfileRestriction);
                        break;

                    case 5:
                        resClass = GetRestriction(restrictionId.ToString(), "main"
                                                  , thisId.ToString(), restrictionId + "_" + thisId
                                                  , "", new List <RestrictionIdName>());

                        var restrictionSetUc = (RestrictionFifth)
                                               Page.LoadControl("~/Views/RestrictionAccess/Main/RestrictionFifth.ascx");
                        restrictionSetUc.SetIds(resClass.ParentId, resClass.AbsoluteId,
                                                resClass.RelativeId, resClass.Name);
                        _foundMain.AddControl(restrictionSetUc);

                        break;
                    }
                    if (resClass != null)
                    {
                        list.Add(resClass);
                    }

                    //LoadFromType();
                }
            }
        }