コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            session = (SessionObject)Session["SessionObject"];
            userid = session.LoggedInUser.UserId;
  
               
                if (Request.QueryString["StandardID"] != null && Request.QueryString["StudentID"] != null && Request.QueryString["WorksheetID"] != null)
                {
                    StandardId = Convert.ToInt32(Request.QueryString["StandardID"]);
                    StudentId = Convert.ToInt32(Request.QueryString["StudentID"]);
                    WorksheetId = Convert.ToInt32(Request.QueryString["WorksheetID"]);
                }
                if (!IsPostBack)
                {
                    radGridHistory.Visible = true;
                    radGridComments.Visible = true;
                    RadScriptManager scriptManager = (RadScriptManager)ScriptManager.GetCurrent(this.Page);

                    DataSet ds = CompetencyWorkSheet.GetCompetencyWorksheetSingleStudentStandard(StandardId, StudentId, WorksheetId);
                    if (ds != null && ds.Tables[0].Rows.Count > 0)
                    {
                        lblStudentName.Text = ds.Tables[0].Rows[0]["StudentName"].ToString();
                        lblStandardDesc.Text = ds.Tables[0].Rows[0]["StandardDesc"].ToString();
                        StandardName = ds.Tables[0].Rows[0]["StandardName"].ToString();
                        lnkStandard.Text = StandardName;
                        HyperLink link = new HyperLink();
                        ID_Encrypted = Encryption.EncryptInt(StandardId);
                        link.NavigateUrl = "~/Record/StandardsPage.aspx?xID=" + ID_Encrypted;
                        lnkStandard.Attributes.Add("onclick", "window.open('" + link.ResolveClientUrl(link.NavigateUrl) + "');");
                        lnkStandard.Attributes.Add("style", "cursor:pointer; text-decoration: underline; color: #034AF3");
                        BindPerformanceGrid();
                        BindCommentGrid();
                    }
                }
        }
コード例 #2
0
 protected void StandardsFilterRadTree_NodeDataBound(object sender, RadTreeNodeEventArgs e)
 {
     var node = e.Node;
     
     if(node.ParentNode == null)
     {
         node.CssClass = "RadTreeView_Thinkgate_TreeView_ParentNode";
         var link = (ImageButton)node.FindControl("editLink");
         if (link != null)
         {
             var dataRowView = (DataRowView)node.DataItem;
             HyperLink tempLink = new HyperLink();
             tempLink.NavigateUrl = "~/Controls/Standards/StandardsFilterEdit.aspx?filterName=";
             string linkURL = tempLink.ResolveClientUrl(tempLink.NavigateUrl) + dataRowView["Name"];
             link.OnClientClick = "customDialog({url: '" + linkURL + "', title: 'Edit Standard Filter',maximize: true}); return false;";
             link.Visible = true;
             link.Attributes["style"] = "cursor:pointer;";
         }
     }
 }
コード例 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Tile == null) return;
            //return; //Preventing this code from running because it is incomplete

            DataSet standardsFilterDataSet = Base.Classes.Standards.GetStandardsFilters(SessionObject.LoggedInUser.Page);
            //DataTable standardsFilterTable = Standpoint.Core.Classes.Encryption.EncryptDataTableColumn(standardsFilterDataSet.Tables[0], "FilterID", "FilterID_Encrypted");
            DataTable standardsFilterTable = standardsFilterDataSet.Tables[0];

            standardsFilterDataSet.Tables.Remove(standardsFilterDataSet.Tables[0]);
            standardsFilterDataSet.Tables.Add(standardsFilterTable);

            if (standardsFilterDataSet.Tables[0].Rows.Count > 0)
            {
                standardsFilterDefaultTextSpan.Visible = false;


                standardsFilterRadTree.DataTextField = "Name";
                standardsFilterRadTree.DataFieldID = "ID";
                standardsFilterRadTree.DataFieldParentID = "ParentID";

                standardsFilterRadTree.DataSource = standardsFilterDataSet;
                standardsFilterRadTree.DataBind();

                BtnAdd.Attributes["onclick"] = "return false;";
                BtnAdd.Attributes["style"] = "cursor:default; margin-top: -1px;";
                BtnAddSpan.Attributes["style"] = "opacity:.5; filter:progid:DXImageTransform.Alpha(opacity=50); filter:alpha(opacity=50);"; //BJC 8/2/2012: opacity fix for IE8.
                BtnAddDiv.Attributes["style"] = "padding: 0; opacity:.5; filter:progid:DXImageTransform.Alpha(opacity=50); filter:alpha(opacity=50);"; //BJC 8/2/2012: opacity fix for IE8.
            }
            else
            {
                standardsFilterDefaultTextSpan.Visible = true;
                standardsFilterRadTree.Visible = false;

                HyperLink link = new HyperLink();
                link.NavigateUrl = "~/Controls/Standards/StandardsFilterEdit.aspx?filterName=";

                BtnAdd.Attributes["onclick"] = "customDialog({url: '" + link.ResolveClientUrl(link.NavigateUrl) + "', title: 'Edit Standard Filter',maximize: true}); return false;";
            }

        }
コード例 #4
0
        protected void radGridResults_ItemDataBound(object sender, GridItemEventArgs e)
        {

            if (e.Item.ItemType == GridItemType.Header)
            {
                System.Web.UI.HtmlControls.HtmlInputCheckBox chk = (System.Web.UI.HtmlControls.HtmlInputCheckBox)e.Item.FindControl("chkAll");
                chk.Attributes["onclick"] = "selectAll(this,'" + radGridResults.ClientID + "'," + ProofedTestCount + ");";

                if (hiddenChkAll.Text == "1" && string.IsNullOrEmpty(hiddenDeSelected.Text))
                    chk.Checked = true;
            }

            var item = e.Item as GridDataItem;
            if (item != null)
            {
                GridItem gridItem = e.Item;
                DataRowView row = (DataRowView)(gridItem).DataItem;
                GridDataItem gridDataItem = item;

                bool isSecureAssessment = Convert.ToBoolean(row["Secure"].ToString());

                bool hasPermission = SessionObject.LoggedInUser.HasPermission(Permission.Access_SecureTesting);
                Dictionary<string, bool> dictionaryItem;
                dictionaryItem = Base.Classes.TestTypes.TypeWithSecureFlag(row["TestCategory"].ToString());
                bool isSecuredFlag = dictionaryItem != null && dictionaryItem.Where(x => Boolean.Parse(x.Value.ToString())).Select(y => y.Key).ToList().Distinct().Any();
                if (hasPermission && isSecuredFlag && isSecureAssessment)
                {
                        var img = item.FindControl("imgIconSecure");
                        img.Visible = true;
                }

                System.Web.UI.HtmlControls.HtmlInputCheckBox chkBox = (System.Web.UI.HtmlControls.HtmlInputCheckBox)item.FindControl("chkRowInput");
                if (row["STATUS"].ToString() == "Unproofed")
                    chkBox.Disabled = true;

                    IEnumerable<DataRow> tmpRow_distict = (from DataRow row1 in dtPrintDateAllTest_district.Rows
                                      where row1["TestID"].ToString() == row["TestID"].ToString()
                                      select row1);

                    IEnumerable<DataRow> tmpRow_school = (from DataRow row1 in dtPrintDateAllTest_school.Rows
                                     where row1["TestID"].ToString() == row["TestID"].ToString()
                                     select row1);
                // 6158:  Hide assessment in Teacher and School Portal if assessment security is inactive and does not have a date range
                // if TestEvents_DisplayInactiveDisctrictAssessments parm is turned on then no need to worry about
                // hiding assessments of inactive security status
                // if parm is turned off then check the security status and date range of the assessment

                if (DistrictParms.LoadDistrictParms().TestEvents_DisplayInactiveDistrictAssessments.Trim().ToLower() == "no")
                {
                    DataTable dtPrintEndDate = new DataTable();
                    // 7044: Hide assessment for teacher portal only
                    if (_level == EntityTypes.Teacher || (_level == EntityTypes.Class && (SessionObject.CurrentPortal == EntityTypes.Teacher)))
                    {
                        // scheduler level is school for teacher and school scheduler
                        if (tmpRow_school.ToList().Any())
                        dtPrintEndDate = tmpRow_school.CopyToDataTable<DataRow>();

                        // At this point, user has not set the security at the school level, now check the security status at assessment level
                        if (dtPrintEndDate.Rows.Count == 0 && tmpRow_distict.ToList().Any() )
                        {
                            dtPrintEndDate = tmpRow_distict.CopyToDataTable<DataRow>();
                        }
                        //}
                        //else
                        //{
                        //    // scheduler level is Assessment for district role
                        //    dtPrintEndDate = Thinkgate.Base.Classes.Assessment.GetSecurityStatus("Assessment", "District", Convert.ToInt32(row["TestID"].ToString()));
                        //}

                        if (dtPrintEndDate.Rows.Count > 0)
                        {
                            foreach (DataRow dr in dtPrintEndDate.Rows)
                            {
                                // If admin security is inactive and no date range
                                if (dr["admin_lock"].ToString() == "True" && (dr["admin_begin"].ToString() == string.Empty) && (dr["admin_end"].ToString() == string.Empty))
                                {
                                    gridDataItem.Display = false;
                                    return;
                                }

                            }
                        }
                    }
                }

                // 6362: the print icon for District Assessments( and State Assessments - NCCTE Only) 
                // should be controlled by the print window security settings.
                bool bPrintFlag = true;

                DataTable dtPrintDate = new DataTable();
                // print window is derived from district level for school and teacher portal
                if (tmpRow_distict.Any())
                {
                    dtPrintDate = tmpRow_distict.CopyToDataTable<DataRow>();
                }
                if (dtPrintDate.Rows.Count > 0 && !UserHasPermission(Permission.Icon_PrintIcon_SecurityOverride))
                {
                    foreach (DataRow dr in dtPrintDate.Rows)
                    {
                        // If print security status is inactive then print icon should be disbaled
                        if (dr["print_lock"].ToString() == "True")
                            bPrintFlag = false;
                        else if (dr["print_end"].ToString() != string.Empty || dr["print_begin"].ToString() != string.Empty)
                        {
                            DateTime printEndDate = Convert.ToDateTime(dr["print_end"].ToString()).Date;
                            DateTime printBeginDate = Convert.ToDateTime(dr["print_begin"].ToString()).Date;
                            // If the print end date is in past then gray out print icon
                            if (printEndDate < DateTime.Today.Date)
                                bPrintFlag = false;

                            if (printBeginDate > DateTime.Today.Date)
                                bPrintFlag = false;
                        }
                    }
                }

                #region Link Creation for Opening Assessment

                String testLinkUrl = "~/Record/AssessmentObjects.aspx?xID=" + (String)row["EncryptedID"];
                HyperLink lnk;
                bool isSloTeacherAndNonSloAssessment = false;
                var sloTeacher = SessionObject.LoggedInUser.Roles.Find(x => x.RoleName == "SLOTeach");
                if (sloTeacher != null && (row["ItemClassId"].ToString() != "2") && (Category.ToUpper() == "DISTRICT"))
                {
                    isSloTeacherAndNonSloAssessment = true;
                }
                /***********************************************************
                 * if user has permission then display link to assessment.  
                 * Otherwise only display label of assessment name.
                 * ********************************************************/
                if (permAssessNameHyperLinksActive && !isSloTeacherAndNonSloAssessment && (!Convert.ToBoolean(row["Targetted"]) || row["Author"].ToString().ToLower().Trim() == SessionObject.LoggedInUser.UserFullName.ToLower().Trim() || SessionObject.LoggedInUser.Roles.Find(r => r.RoleName.ToString().ToLower().Trim() == "school administrator") != null || SessionObject.LoggedInUser.Roles.Find(r => r.RoleName.ToString().ToLower().Trim() == "district administrator") != null))
                {
                    if ((lnk = (HyperLink)gridItem.FindControl("lnkListTestName")) != null)
                    {
                        lnk.Visible = true;
                        lnk.NavigateUrl = testLinkUrl;
                    }
                }
                else
                {
                    Label assessmentNameLabel;
                    if ((assessmentNameLabel = (Label)gridItem.FindControl("lblListTestName")) != null)
                    {
                        assessmentNameLabel.Visible = true;
                    }
                }

                System.Web.UI.HtmlControls.HtmlInputCheckBox chk = (System.Web.UI.HtmlControls.HtmlInputCheckBox)item.FindControl("chkRowInput");
                chk.Attributes["onclick"] = "selectThisRow(this,'" + radGridResults.ClientID + "'," + item.ItemIndex + "," + ProofedTestCount + "," + row["TestID"] + ");";
                chk.Attributes.Add("rowIndex", item.ItemIndex.ToString());

                string[] arrUnChecked = hiddenDeSelected.Text.Split(',').ToArray();
                var foundUnChecked = arrUnChecked.FirstOrDefault(x => x.ToString() == row["TestID"].ToString());
                if (hiddenChkAll.Text == "1" && string.IsNullOrEmpty(foundUnChecked) && !(chk.Disabled))
                {
                    gridItem.Selected = true;
                    chk.Checked = true;
                }

                string[] arrChecked = hiddenSelected.Text.Split(',').ToArray();
                var foundChecked = arrChecked.FirstOrDefault(x => x.ToString() == row["TestID"].ToString());
                if (!string.IsNullOrEmpty(foundChecked) && !(chk.Disabled))
                {
                    gridItem.Selected = true;
                    chk.Checked = true;
                }

                #endregion

                string assessmentTitle = "Term " + row["Term"] + " " + row["TestType"] + " - " + row["Grade"] + " Grade " + row["Subject"] + (row["Course"].ToString() == row["Subject"].ToString() ? string.Empty : " " + row["Course"]);
                //ShowAndHideIcons
                #region Show Administration Button
                Base.Enums.Permission administPerm = (Base.Enums.Permission)Enum.Parse(typeof(Base.Enums.Permission), "Icon_Administration" + row["TestCategory"].ToString(), true);
                Boolean showAdministBtn = UserHasPermission(administPerm) && string.Compare(row["STATUS"].ToString(), "Proofed", true) == 0;
                System.Web.UI.HtmlControls.HtmlImage imgAdminBtn;
                if ((imgAdminBtn = (System.Web.UI.HtmlControls.HtmlImage)item.FindControl("imgGraphicAdmin")) != null)
                {
                    string onClientClickAdmin = "searchAsssessment_adminClick(" + "'" + row["EncryptedID"].ToString() + "'"
                                                                                                         + "," + "'" + assessmentTitle + "','" + Category + "','" + isSecureAssessment + "'" + ")";

                    imgAdminBtn.Visible = showAdministBtn;
                    if (showAdministBtn && row["DisplayDashboard"].ToString() == "No" && !UserHasPermission(Permission.Icon_AdministrationIcon_SecurityOverride))
                    {
                        imgAdminBtn.Attributes["onclick"] = "return false;";
                        imgAdminBtn.Attributes["style"] = "cursor:default; opacity:.3; filter:alpha(opacity=30);";
                    }
                    else
                    {
                        imgAdminBtn.Attributes["onclick"] = onClientClickAdmin;
                    }
                }
                #endregion

                #region Show Print Button
                Base.Enums.Permission assessmentPerm = (Base.Enums.Permission)Enum.Parse(typeof(Base.Enums.Permission), "Print_Assessment" + row["TestCategory"].ToString(), true);
                Base.Enums.Permission answerKeyPerm = (Base.Enums.Permission)Enum.Parse(typeof(Base.Enums.Permission), "Print_AnswerKey" + row["TestCategory"].ToString(), true);
                String printonclick = @"searchAsssessment_printClick(" + "'" + Standpoint.Core.Classes.Encryption.EncryptInt(DataIntegrity.ConvertToInt(row["TestID"])) + "'"
                                                                                                         + "," + "'" + row["TestName"].ToString() + "'" + ")";
                Boolean showPrint = (UserHasPermission(assessmentPerm) || UserHasPermission(answerKeyPerm)) && (row["ContentType"].ToString() != "No Items/Content");

                System.Web.UI.HtmlControls.HtmlImage imgBtn;
                //TFS: 6362
                imgBtn = (System.Web.UI.HtmlControls.HtmlImage)item.FindControl("imgGraphicPrint");
                //if ((imgBtn = (System.Web.UI.HtmlControls.HtmlImage)e.Item.FindControl("imgGraphicPrint")) != null)
                if (imgBtn != null)
                {
                    if (bPrintFlag)
                    {
                        imgBtn.Attributes["onclick"] = printonclick;
                        imgBtn.Visible = showPrint;
                    }
                    else
                    {
                        imgBtn.Attributes["onclick"] = "return false;";
                        imgBtn.Attributes["style"] = "cursor:default; opacity:.3; filter:alpha(opacity=30);";
                    }
                }
                #endregion

                #region Show Edit Button
                Boolean editAssessment = UserHasPermission((Base.Enums.Permission)Enum.Parse(typeof(Base.Enums.Permission), "Edit_Assessment" + row["TestCategory"].ToString(), true)) && string.Compare(row["STATUS"].ToString(), "Proofed", true) != 0;
                HyperLink imgOnclickLink = new HyperLink();
                string imgOnclickLinkString;
                imgOnclickLink.NavigateUrl = "~/" + clientFolder + "Record/AssessmentPage.aspx?xID=" + (string)row["EncryptedID"];
                imgOnclickLinkString = imgOnclickLink.ResolveClientUrl(imgOnclickLink.NavigateUrl);

                string onClientClick = @"searchAsssessment_editClick('" + row["EncryptedID"].ToString() + "','" + assessmentTitle + "', '" + imgOnclickLinkString + "'); ";

                System.Web.UI.HtmlControls.HtmlImage editBtn;
                if ((editBtn = (System.Web.UI.HtmlControls.HtmlImage)item.FindControl("btnGraphicEdit1")) != null)
                {
                    editBtn.Visible = editAssessment;
                    editBtn.Attributes["onclick"] = onClientClick;
                }
                #endregion

            }
        }
コード例 #5
0
        protected void lbxList_ItemDataBound(Object sender, Telerik.Web.UI.RadListBoxItemEventArgs e)
        {
            RadListBoxItem listBoxItem = e.Item;
            DataRowView row = (DataRowView)(listBoxItem).DataItem;

            Boolean showPrint = IsPrintVisible(DataIntegrity.ConvertToBool(row["HasRubrics"]), row["ContentType"].ToString() != "No Items/Content");

            // Handle print icons.
            SetControlVisibility(listBoxItem.FindControl("imgListPrint1"), showPrint);
            SetControlVisibility(listBoxItem.FindControl("imgListPrint2"), showPrint);
            SetControlVisibility(listBoxItem.FindControl("imgGraphicPrint1"), showPrint);
            SetControlVisibility(listBoxItem.FindControl("imgGraphicPrint2"), showPrint);

            String printonclick = @"viewAsssessment_printClick(" + "'" + Encryption.EncryptString(row["TestID"].ToString()) + "','" + row["TestName"].ToString() + "')";

            var link1 = (HyperLink)listBoxItem.FindControl("imgListPrint1");
            var link2 = (HyperLink)listBoxItem.FindControl("imgListPrint2");
            var graphicLink1 = (HyperLink)listBoxItem.FindControl("imgGraphicPrint1");
            var graphicLink2 = (HyperLink)listBoxItem.FindControl("imgGraphicPrint2");

            if (link1 != null) link1.NavigateUrl = "javascript:" + printonclick;
            if (link2 != null) link2.NavigateUrl = "javascript:" + printonclick;
            if (graphicLink1 != null) graphicLink1.NavigateUrl = "javascript:" + printonclick;
            if (graphicLink2 != null) graphicLink2.NavigateUrl = "javascript:" + printonclick;

            // Edit mode controls how the row is displayed. If null, it shows 'More Results...'.
            Boolean? editItemMode = null;
            if (row["Proofed"] is String) editItemMode = !DataIntegrity.ConvertToBool(row["Proofed"]);

            SetControlVisibility(listBoxItem.FindControl("graphicMore"), !editItemMode.HasValue);
            SetControlVisibility(listBoxItem.FindControl("listMore"), !editItemMode.HasValue);
            SetControlVisibility(listBoxItem.FindControl("listLine2Summary"), editItemMode.HasValue && !editItemMode.Value);
            SetControlVisibility(listBoxItem.FindControl("graphicLine2Summary"), editItemMode.HasValue && !editItemMode.Value);
            SetControlVisibility(listBoxItem.FindControl("graphicLine3Summary"), editItemMode.HasValue && !editItemMode.Value);
            SetControlVisibility(listBoxItem.FindControl("imgAddToCalendar"), _calendarIconVisible);
            SetControlVisibility(listBoxItem.FindControl("testImg"), editItemMode.HasValue);
            SetControlVisibility(listBoxItem.FindControl("imgSummary"), IsSummaryVisible());

            String moreUrl = @"'../Controls/Assessment/AssessmentSearchExpanded.aspx?category=" + _category + "'";

            if (!editItemMode.HasValue) SetOnClick((System.Web.UI.HtmlControls.HtmlAnchor)listBoxItem.FindControl("lnkListMore"), @"doOpenExpandEditRadWindow(" + moreUrl + "); return false;");
            if (!editItemMode.HasValue) SetOnClick((System.Web.UI.HtmlControls.HtmlAnchor)listBoxItem.FindControl("lnkGraphicMore"), @"doOpenExpandEditRadWindow(" + moreUrl + "); return false;");

            if (editItemMode.HasValue)
            {
                // District test links are not active on teacher page.
                Boolean isDistrictOrSchool = (_level == Base.Enums.EntityTypes.District || _level == Base.Enums.EntityTypes.School);
                bool IsDistrictPortal = _category.ToLower().Trim() == "district"; 
                Boolean testNameLinkActive = isDistrictOrSchool || String.Compare(_category, "District", true) != 0;
                Object scoredObj = row["Scored"];
                Boolean testScoredLinkActive = (scoredObj is Int32 && ((Int32)scoredObj) > 0 && !isDistrictOrSchool);                
                Boolean hasPermissionActiveTestNameLnk = false;

                switch (_category.ToLower())
                {
                    case "classroom":
                        hasPermissionActiveTestNameLnk = UserHasPermission(Permission.Hyperlink_AssessmentNameClassroom);
                        break;

                    case "district":
                        hasPermissionActiveTestNameLnk = UserHasPermission(Permission.Hyperlink_AssessmentNameDistrict);
                        break;

                    case "state":
                        hasPermissionActiveTestNameLnk = UserHasPermission(Permission.Hyperlink_AssessmentNameState);
                        break;
                } 

                if (!hasPermissionActiveTestNameLnk)
                { testNameLinkActive = false; }

                if (Convert.ToBoolean(row["Targetted"]) && !isDistrictOrSchool && Convert.ToInt32(row["createdBy"].ToString()) != SessionObject.LoggedInUser.Page)
                {
                    testNameLinkActive = false;
                    hasPermissionActiveTestNameLnk = false;
                }

                // For now we have been asked to make the scored hyperlinks disabled.
                testScoredLinkActive = false;

                SetControlVisibility(listBoxItem.FindControl("lblListTestName"), !(testNameLinkActive || hasPermissionActiveTestNameLnk));
                SetControlVisibility(listBoxItem.FindControl("lnkListTestName"), testNameLinkActive || hasPermissionActiveTestNameLnk);
                SetControlVisibility(listBoxItem.FindControl("lblListTestScored"), !testScoredLinkActive && !isDistrictOrSchool);
                SetControlVisibility(listBoxItem.FindControl("lblListTestScoredPct"), !testScoredLinkActive && isDistrictOrSchool);
                SetControlVisibility(listBoxItem.FindControl("lnkListTestScored"), testScoredLinkActive && !isDistrictOrSchool);
                SetControlVisibility(listBoxItem.FindControl("lnkListTestScoredPct"), testScoredLinkActive && isDistrictOrSchool);
                SetControlVisibility(listBoxItem.FindControl("lblGraphicTestName"), !(testNameLinkActive || hasPermissionActiveTestNameLnk));
                SetControlVisibility(listBoxItem.FindControl("lnkGraphicTestName"), testNameLinkActive || hasPermissionActiveTestNameLnk);
                SetControlVisibility(listBoxItem.FindControl("lblGraphicTestScored"), !testScoredLinkActive && !isDistrictOrSchool);
                SetControlVisibility(listBoxItem.FindControl("lblGraphicTestScoredPct"), !testScoredLinkActive && isDistrictOrSchool);
                SetControlVisibility(listBoxItem.FindControl("lnkGraphicTestScored"), testScoredLinkActive && !isDistrictOrSchool);
                SetControlVisibility(listBoxItem.FindControl("lnkGraphicTestScoredPct"), testScoredLinkActive && isDistrictOrSchool);
                SetControlVisibility(listBoxItem.FindControl("btnGraphicUpdate"), editItemMode.Value);
                SetControlVisibility(listBoxItem.FindControl("btnListUpdate"), editItemMode.Value);
                SetControlVisibility(listBoxItem.FindControl("listLine2Edit"), editItemMode.Value);
                SetControlVisibility(listBoxItem.FindControl("graphicLine2Edit"), editItemMode.Value);
                SetControlVisibility(listBoxItem.FindControl("graphicLine3Edit"), editItemMode.Value);

                String testLinkUrl = "~/Record/AssessmentObjects.aspx?xID=" + (String)row["TestID_Encrypted"];
                SetNavigateURL((HyperLink)listBoxItem.FindControl("lnkListTestName"), testLinkUrl);
                SetNavigateURL((HyperLink)listBoxItem.FindControl("lnkGraphicTestName"), testLinkUrl);

                HyperLink imgOnclickLink = new HyperLink();
                imgOnclickLink.NavigateUrl = "~/Record/AssessmentPage.aspx?xID=" + (string)row["TestID_Encrypted"];

                string imgOnclickLinkString = imgOnclickLink.ResolveClientUrl(imgOnclickLink.NavigateUrl);
                string assessmentTitle = "Term " + row["Term"] + " " + row["TestType"] + " - " + row["Grade"] + " Grade " + row["Subject"] + (row["Course"].ToString() == row["Subject"].ToString() ? string.Empty : " " + row["Course"]);
                string onClientClick = "var _this=this; this.disabled=true; setTimeout(function(){ _this.disabled=false; }, 500); viewAssessments_editLink_onClick('" + imgOnclickLinkString + "', '" + assessmentTitle + "');";

                var btnListEdit = (HyperLink)listBoxItem.FindControl("btnListEdit");
                
                var btnGraphicEdit = (HyperLink)listBoxItem.FindControl("btnGraphicEdit");
                var btnGraphicUpdate = (HyperLink)listBoxItem.FindControl("btnGraphicUpdate");
                var btnListUpdate = (HyperLink)listBoxItem.FindControl("btnListUpdate");

                if (btnListEdit != null)
                {
                    btnListEdit.NavigateUrl = "javascript:" + onClientClick;
                    //WR 2932: Edit Button only visible for District Assessments when user/role has "Icon_Edit_District_Assessment" permission and item is not proofed
                    btnListEdit.Visible = editItemMode.Value && (!IsDistrictPortal || (UserHasPermission(Permission.Icon_Edit_District_Assessment)));
                }

                if (btnGraphicEdit != null)
                {
                    btnGraphicEdit.NavigateUrl = "javascript:" + onClientClick;
                    //WR 2932: Edit Button only visible for District Assessments when user/role has "Icon_Edit_District_Assessment" permission and item is not proofed
                    btnGraphicEdit.Visible = editItemMode.Value && (!IsDistrictPortal || (UserHasPermission(Permission.Icon_Edit_District_Assessment)));
                }
                if (btnGraphicUpdate != null) btnGraphicUpdate.NavigateUrl = "javascript:" + onClientClick;
                if (btnListUpdate != null) btnListUpdate.NavigateUrl = "javascript:" + onClientClick;

                System.Web.UI.WebControls.Image proofedImg = (System.Web.UI.WebControls.Image)listBoxItem.FindControl("testImg");
                if (proofedImg != null) proofedImg.ImageUrl = (editItemMode.Value) ? "~/Images/editable.png" : "~/Images/proofed.png";

                // String for onclick for showing Assessment Administration popup. We pass parameters that we have.
                String classid = (_level == Base.Enums.EntityTypes.Class) ? _levelID.ToString() : String.Empty;
                string isSecureText = "false";
                String imgonclick = @"viewAsssessment_adminClick(" + row["TestID"].ToString() + "," + (String.IsNullOrEmpty(classid) ? "null" : classid) + ",'" + assessmentTitle + " - " + row["Description"].ToString().Replace("'", "") + "','" + isSecureText + "')";

                var imgListAdmin = (HyperLink)listBoxItem.FindControl("imgListAdmin");
                var imgGraphicAdmin = (HyperLink)listBoxItem.FindControl("imgGraphicAdmin");

                if (imgListAdmin != null)
                {
                    if (row["DisplayDashboard"].ToString() == "No" && !UserHasPermission(Permission.Icon_AdministrationIcon_SecurityOverride)) 
                    {
                        imgListAdmin.Attributes["style"] = "opacity:.3; filter:alpha(opacity=30); cursor:default;";
                        imgListAdmin.Attributes["onclick"] = "return false;";
                    }
                    else
                    {
                        imgListAdmin.NavigateUrl = "javascript:" + imgonclick;
                    }
                }
                if (imgGraphicAdmin != null)
                {
                    if (row["DisplayDashboard"].ToString() == "No" && !UserHasPermission(Permission.Icon_AdministrationIcon_SecurityOverride))
                    {
                        imgGraphicAdmin.Attributes["style"] = "opacity:.3; filter:alpha(opacity=30); cursor:default;";
                        imgGraphicAdmin.Attributes["onclick"] = "return false;";
                    }
                    else
                    {
                        imgGraphicAdmin.NavigateUrl = "javascript:" + imgonclick;
                    }
                }
            }
        }
コード例 #6
0
        protected void LoadStandardDistributionTable_AssessmentObjectScreen()
        {
            DataTable standardDistributionTable = _ds.Tables["StandardQuestionCounts"];

            if (standardDistributionTable.Rows.Count > 0)
            {
                string cell1Width;
                string cell2Width;
                if (standardDistributionTable.Rows.Count > 4 && !isPDFView)
                {
                    cell1Width = "width:41%;";
                    cell2Width = "width:48%;";
                }
                else
                {
                    cell1Width = "width:110px;";
                    cell2Width = "width:128px;";
                    if(isPDFView) standardDistScrollContainerDiv.Attributes["style"] = "height: 85px;";
                }

                foreach (DataRow dr in standardDistributionTable.Rows)
                {
                    TableRow row = new TableRow();
                    TableCell cell1 = new TableCell();
                    TableCell cell2 = new TableCell();
                    TableCell cell3 = new TableCell();

                    HyperLink link = new HyperLink();
                    link.NavigateUrl = "~/Record/StandardsPage.aspx?xID=" + Encryption.EncryptInt(DataIntegrity.ConvertToInt(dr["StandardID"]));

                    cell1.Text = string.IsNullOrEmpty(dr["StandardName"].ToString()) ? "&nbsp;" : "<a href=\"javascript:void();\" onclick=\"window.open('" + link.ResolveClientUrl(link.NavigateUrl) + "'); return false;\">" + dr["StandardName"].ToString() + "</a>";
                    cell1.Attributes["class"] = "contentLabel";
                    cell1.Attributes["style"] = cell1Width + (standardDistributionTable.Rows.Count < 4 ? "border-bottom:solid 1px #000;" : "");

                    cell2.Text = Math.Round(100.0 * DataIntegrity.ConvertToInt(dr["StandardQuestionCount"]) / DataIntegrity.ConvertToInt(dr["TotalItemCount"])).ToString() + "%";
                    cell2.Attributes["class"] = "standardContentElement";
                    cell2.Attributes["style"] = cell2Width + (standardDistributionTable.Rows.Count < 4 ? "border-bottom:solid 1px #000;" : "");
                    cell2.Attributes["style"] = cell2.Attributes["style"] + "font-weight: bold;text-align: center;padding: 3px;";

                    cell3.Text = string.IsNullOrEmpty(dr["StandardQuestionCount"].ToString()) ? "&nbsp;" : dr["StandardQuestionCount"].ToString();
                    cell3.Attributes["class"] = "standardContentElement";
                    if (standardDistributionTable.Rows.Count < 4)
                    {
                        cell3.Attributes["style"] = "border-bottom:solid 1px #000;";
                    }
                    cell3.Attributes["style"] = cell3.Attributes["style"] + "font-weight: bold;text-align: center;padding: 3px;";

                    row.Cells.Add(cell1);
                    row.Cells.Add(cell2);
                    row.Cells.Add(cell3);

                    standardTable.Rows.Add(row);
                }

                standardTable.DataBind();
            }
        }
コード例 #7
0
        private void LoadTeachers()
        {
            if(_selectedClass.Teachers.Count == 0) _selectedClass.LoadTeachers();

            HtmlImage summaryImage = new HtmlImage();
            summaryImage.Src = "~/Images/summary.png";
            string summaryImageSrc = summaryImage.ResolveClientUrl(summaryImage.Src);

            HyperLink teacherOnclickLink = new HyperLink();
            string teacherOnclickLinkString;
            teacherOnclickLink.NavigateUrl = "~/Record/Teacher.aspx?childPage=yes&xID=";
            teacherOnclickLinkString = teacherOnclickLink.ResolveClientUrl(teacherOnclickLink.NavigateUrl);

            foreach (Thinkgate.Base.Classes.Teacher teacher in _selectedClass.Teachers)
            {
                HtmlTableRow newRow = new HtmlTableRow();
                HtmlTableCell cell1 = new HtmlTableCell();
                string xID = Encryption.EncryptInt(teacher.PersonID);

                if (UserHasPermission(Permission.Hyperlink_Teacher_ClassSummaryExpanded))
                {
                    /* User has permission so display Teacher Name as hyperlink. */
                    cell1.InnerHtml = "<img src=\"" + summaryImageSrc + "\" class=\"summaryImgButton\" style=\"display:none; cursor:pointer; margin-right:5px;\"/><a href=\"javascript:void();\" onclick=\"window.open('" +
                        teacherOnclickLinkString + xID + "'); return false;\">" + teacher.FirstName + " " + teacher.LastName + "</a> " + (teacher.IsPrimary ? "(Primary)" : "");
                }
                else
                {
                    /* User does not have permission so display Teacher Name as label. */
                    cell1.InnerHtml = "<img src=\"" + summaryImageSrc + "\" class=\"summaryImgButton\" style=\"display:none; cursor:pointer; margin-right:5px;\"/><label>" + 
                                      teacher.FirstName + " " + teacher.LastName + "</label> " + (teacher.IsPrimary ? "(Primary)" : "");
                }

                newRow.Cells.Add(cell1);
                teachersTable.Rows.Add(newRow);
            }

            teachersTable.DataBind();
        }
コード例 #8
0
        protected void rlbSecureList_ItemDataBound(Object sender, Telerik.Web.UI.RadListBoxItemEventArgs e)
        {
            RadListBoxItem listBoxItem = e.Item;
            DataRowView row = (DataRowView)(listBoxItem).DataItem;

            // 6158:  Hide assessment in Teacher and School Portal if assessment security is inactive and does not have a date range
            // if TestEvents_DisplayInactiveDisctrictAssessments parm is turned on then no need to worry about
            // hiding assessments of inactive security status
            // if parm is turned off then check the security status and date range of the assessment
            IEnumerable<DataRow> tmpRow_distict = (from DataRow row1 in dtPrintDateAllTest_district.Rows
                                                   where row1["TestID"].ToString() == row["TestID"].ToString()
                                                   select row1);

            IEnumerable<DataRow> tmpRow_school = (from DataRow row1 in dtPrintDateAllTest_school.Rows
                                                  where row1["TestID"].ToString() == row["TestID"].ToString()
                                                  select row1);
            if (DistrictParms.LoadDistrictParms().TestEvents_DisplayInactiveDistrictAssessments.Trim().ToLower() == "no")
            {
                DataTable dtPrintEndDate = new DataTable();
                // For school and teacher portal
                if (_level == EntityTypes.Teacher || _level == EntityTypes.School || (_level == EntityTypes.Class && (SessionObject.CurrentPortal == EntityTypes.Teacher || SessionObject.CurrentPortal == EntityTypes.School)))
                {
                    // scheduler level is school for teacher and school scheduler
                    if (tmpRow_school.Any())
                    {
                        dtPrintEndDate = tmpRow_school.CopyToDataTable<DataRow>();
                    }
                    // At this point, user has not set the security at the school level, now check the security status at assessment level
                    if (tmpRow_distict.Any())
                    {
                        if (dtPrintEndDate.Rows.Count == 0)
                        {
                            dtPrintEndDate = tmpRow_distict.CopyToDataTable<DataRow>();
                        }
                    }
                    //}
                    //else
                    //{
                    //    // scheduler level is Assessment for district role
                    //    dtPrintEndDate = Thinkgate.Base.Classes.Assessment.GetSecurityStatus("Assessment", "District", Convert.ToInt32(row["TestID"].ToString()));
                    //}

                    if (dtPrintEndDate.Rows.Count > 0)
                    {
                        foreach (DataRow dr in dtPrintEndDate.Rows)
                        {
                            // If admin security is inactive and no date range
                            if (dr["admin_lock"].ToString() == "True" && (dr["admin_begin"].ToString() == string.Empty) && (dr["admin_end"].ToString() == string.Empty))
                                rlbSecure.Items.Remove(listBoxItem);
                        }
                    }

                }
            }
            // For users with the 'SLOTeach' role, only show Unproofed Districts that were created by the user.
            var sloTeacher = SessionObject.LoggedInUser.Roles.Find(x => x.RoleName == "SLOTeach");
            if ((_category.ToUpper() == "DISTRICT") && (sloTeacher != null) && row["Proofed"].ToString() == "No")
            {
                if (Convert.ToInt32(row["CreatedBy"].ToString()) != SessionObject.LoggedInUser.Page)
                {
                    rlbSecure.Items.Remove(listBoxItem);
                }
            }

            // 6362: the print icon for District Assessments( and State Assessments - NCCTE Only) 
            // should be controlled by the print window security settings.
            bool bPrintFlag = true;

            DataTable dtPrintDate = new DataTable();
            // print window is derived for school and teacher portal from district level 
            if (tmpRow_distict.Any())
            {
                dtPrintDate = tmpRow_distict.CopyToDataTable<DataRow>();
            }
            DateTime todayDate = DateTime.Today.Date;

            if (dtPrintDate.Rows.Count > 0 && !UserHasPermission(Permission.Icon_PrintIcon_SecurityOverride))
            {
                foreach (DataRow dr in dtPrintDate.Rows)
                {
                    // If print security status is inactive then print icon should be disbaled
                    if (dr["print_lock"].ToString() == "True")
                        bPrintFlag = false;
                    else
                    {
                        if (dr["print_begin"].ToString() != string.Empty)
                        {
                            /// date range 3/21/14   thru  3/25/14
                            /// today = 3/24/14
                            /// today >= 3/21/14 and today <= 3/25/14
                            DateTime printBeginDate = Convert.ToDateTime(dr["print_begin"].ToString()).Date;
                            // If the today's is before the begin date then gray out print icon
                            if (todayDate < printBeginDate) bPrintFlag = false;
                        }
                        if (dr["print_end"].ToString() != string.Empty)
                        {
                            DateTime printEndDate = Convert.ToDateTime(dr["print_end"].ToString()).Date;
                            // If the print end date is in past today's date then gray out print icon
                            if (todayDate > printEndDate) bPrintFlag = false;
                        }
                    }
                }
            }

            HyperLink hlkTestname = (HyperLink)listBoxItem.FindControl("lnkTestName");
            hlkTestname.Text = row["TestName"].ToString();

            Label lblDesc = (Label)listBoxItem.FindControl("lblDesc");
            lblDesc.Text = row["Description"].ToString();

            HtmlGenericControl spnNumItems = (HtmlGenericControl)listBoxItem.FindControl("spnNumItemsSecure");
            spnNumItems.InnerText = row["NumItems"].ToString() + " Items";

            Panel pnlLastEdit = (Panel)listBoxItem.FindControl("graphicLine3EditSecure");
            Image imgProofed = (Image)listBoxItem.FindControl("testImg");

            HyperLink hlkEdit = (HyperLink)listBoxItem.FindControl("hlkEditSecure");
            // TFS: 6703
            //HyperLink hlkAdmin = (HyperLink)listBoxItem.FindControl("hlkAdmin");

            System.Web.UI.HtmlControls.HtmlImage hlkAdmin;

            hlkAdmin = (System.Web.UI.HtmlControls.HtmlImage)e.Item.FindControl("hlkAdminSecure");

            HyperLink hlkPrint = (HyperLink)listBoxItem.FindControl("hlkPrintSecure");
            //TFS: 6362
            if (bPrintFlag)
            {
                hlkPrint.Visible = IsPrintVisible(DataIntegrity.ConvertToBool(row["HasRubrics"]), row["ContentType"].ToString() != "No Items/Content");
                hlkPrint.NavigateUrl = "javascript:" + @"viewAsssessment_printClick(" + "'" + Encryption.EncryptString(row["TestID"].ToString()) + "','" + row["TestName"].ToString() + "')";
            }
            else
            {
                hlkPrint.ImageUrl = "~/Images/Printer_Disabled.png";
                hlkPrint.Attributes["style"] = "cursor:default;";
                hlkPrint.Attributes["onclick"] = "return false;";
            }
            HtmlGenericControl spnLastEdit = (HtmlGenericControl)listBoxItem.FindControl("spnLastEditSecure");
            spnLastEdit.InnerText = "Last Edited: " + ((DateTime)row["DateUpdated"]).ToShortDateString();

            Boolean? editItemMode = null;
            if (row["Proofed"] is String) editItemMode = !DataIntegrity.ConvertToBool(row["Proofed"]);

            if (editItemMode.HasValue)
            {
                // District test links are not active on teacher page.
                bool IsDistrictOrSchool = (_level == Base.Enums.EntityTypes.District || _level == Base.Enums.EntityTypes.School);
                bool IsDistrictPortal = _category.ToLower().Trim() == "district";
                bool IsTargetted = Convert.ToBoolean(row["Targetted"]);
                int CreatedByPage = string.IsNullOrEmpty(row["createdBy"].ToString()) ? 0 : Convert.ToInt32(row["createdBy"].ToString());

                bool HasHyperlinkPermission = false;
                bool HasAdminIconPermission = false;

                switch (_category.ToLower())
                {
                    case "classroom":
                        HasHyperlinkPermission = UserHasPermission(Permission.Hyperlink_AssessmentNameClassroom);
                        HasAdminIconPermission = true;
                        break;

                    case "district":
                        HasHyperlinkPermission = UserHasPermission(Permission.Hyperlink_AssessmentNameDistrict);
                        HasAdminIconPermission = true;
                        break;

                    case "state":
                        HasHyperlinkPermission = UserHasPermission(Permission.Hyperlink_AssessmentNameState);
                        HasAdminIconPermission = UserHasPermission(Permission.Icon_AdministrationState);
                        break;
                }


                bool IsTestNameLinkActive = (IsDistrictOrSchool || IsDistrictPortal) && HasHyperlinkPermission;
                bool isSloTeacherAndNonSloAssessment = sloTeacher != null && (row["ItemClassId"].ToString() != "2") && (_category.ToUpper() == "DISTRICT");

                //determine if this is an SLOTeach user if the assessment is for an SLO CurrCourse

                if (IsTargetted && !IsDistrictOrSchool && CreatedByPage != SessionObject.LoggedInUser.Page)
                {
                    IsTestNameLinkActive = false;
                    HasHyperlinkPermission = false;
                }

                imgProofed.ImageUrl = (editItemMode.Value) ? "~/Images/editable.png" : "~/Images/proofed.png";
                hlkTestname.Enabled = ((IsTestNameLinkActive || HasHyperlinkPermission) && !isSloTeacherAndNonSloAssessment);
                hlkTestname.NavigateUrl = "~/Record/AssessmentObjects.aspx?xID=" + (String)row["TestID_Encrypted"];


                spnNumItems.Visible = editItemMode.Value;

                //WR 2932: Edit Button only visible for District Assessments when user/role has "Icon_Edit_District_Assessment" permission and item is not proofed
                hlkEdit.Visible = editItemMode.Value && (!IsDistrictPortal || (UserHasPermission(Permission.Icon_Edit_District_Assessment)));


                //MF 4022: Admin icon visible only when user/role has "Icon_AdministrationState" permission and item is proofed.
                hlkAdmin.Visible = !editItemMode.Value && HasAdminIconPermission;
                pnlLastEdit.Visible = editItemMode.Value;

                HyperLink imgOnclickLink = new HyperLink();
                imgOnclickLink.NavigateUrl = "~/Record/AssessmentPage.aspx?xID=" + (string)row["TestID_Encrypted"];

                string imgOnclickLinkString = imgOnclickLink.ResolveClientUrl(imgOnclickLink.NavigateUrl);
                string SecureText = "Term ";
                string isSecure = "false";
                if (SecureFormativetabStrip.SelectedIndex == 1)
                {
                    //SecureText = "[SECURE] Term ";
                    isSecure = "true";
                }
                string assessmentTitle = SecureText + row["Term"] + " " + row["TestType"] + " - " + row["Grade"] + " Grade " + row["Subject"] + (row["Course"].ToString() == row["Subject"].ToString() ? string.Empty : " " + row["Course"]);

                string onClientClick = "var _this=this; this.disabled=true; setTimeout(function(){ _this.disabled=false; }, 500); viewAssessments_editLink_onClick('" + imgOnclickLinkString + "', '" + assessmentTitle + "');";

                if (hlkEdit != null) hlkEdit.NavigateUrl = "javascript:" + onClientClick;

                // String for onclick for showing Assessment Administration popup. We pass parameters that we have.
                String classid = (_level == Base.Enums.EntityTypes.Class) ? _levelID.ToString() : String.Empty;
                String imgonclick = @"viewAsssessment_adminClick(" + row["TestID"].ToString() + "," + (String.IsNullOrEmpty(classid) ? "null" : classid) + ",'" + assessmentTitle + " - " + row["Description"].ToString().Replace("'", "") + "','" + _category.ToString() + "','" + _level.ToString() + "','" + false + "','" + isSecure + "')";

                if (hlkAdmin != null)
                {
                    if (row["DisplayDashboard"].ToString() == "No" && !UserHasPermission(Permission.Icon_AdministrationIcon_SecurityOverride))
                    {
                        hlkAdmin.Attributes["style"] = "opacity:.3; filter:alpha(opacity=30); cursor:default;";
                        hlkAdmin.Attributes["onclick"] = "return false;";
                    }
                    else
                    {
                        // TFS: 6703
                        //hlkAdmin.NavigateUrl = "javascript:" + imgonclick;
                        hlkAdmin.Attributes["onclick"] = "javascript:" + imgonclick;
                    }
                }
            }
        }
コード例 #9
0
        public void LoadStandardsSearchTable_Click(object sender, EventArgs e)
        {
            LoadStandardsSearchDataTable();
            standardsSearchTable.Rows.Clear();

            if(_standardsSearchDataTable.Rows.Count > 0)
            {
                standardsSearchTable.Visible = true;
                standardsSearchHeader.Visible = true;
            }
            else
            {
                standardsSearchTable.Visible = false;
                standardsSearchHeader.Visible = false;
            }

            List<int> filterList = new List<int>();
            if (SessionObject.LoggedInUser.StandardFilters.ContainsKey(_filterName) &&
                SessionObject.LoggedInUser.StandardFilters[_filterName].Length > 0)
            {
                foreach (var strID in SessionObject.LoggedInUser.StandardFilters[_filterName].Split(new Char[] { ',' }, StringSplitOptions.RemoveEmptyEntries))
                {
                    Int32 id;
                    if (Int32.TryParse(strID.Trim(), out id)) filterList.Add(id);
                }
            }

            foreach (DataRow row in _standardsSearchDataTable.Rows)
            {
                if (!filterList.Contains(Convert.ToInt32(row["ID"])))
                {
                    TableRow newRow = new TableRow();
                    TableCell cell1 = new TableCell();
                    TableCell cell2 = new TableCell();
                    TableCell cell3 = new TableCell();
                    TableCell cell4 = new TableCell();
                    TableCell cell5 = new TableCell();
                    TableCell cell6 = new TableCell();
                    TableCell cell7 = new TableCell();

                    newRow.Attributes["standardID"] = row["ID"].ToString();

                    HtmlInputCheckBox cell1Data = new HtmlInputCheckBox();
                    cell1Data.ID = "standardsSearchCheckbox_" + row["ID"].ToString();
                    cell1Data.ClientIDMode = System.Web.UI.ClientIDMode.Static;
                    cell1Data.Attributes["onclick"] = "addToFilter(this); return false;";
                    cell1Data.Attributes["standardID"] = row["ID"].ToString();
                    cell1.CssClass = "alignCellCenter";
                    cell1.Width = 50;
                    cell1.Controls.Add(cell1Data);

                    HyperLink cell2Data = new HyperLink();
                    cell2Data.NavigateUrl = "~/Record/StandardsPage.aspx?xID="
                                            + Standpoint.Core.Classes.Encryption.EncryptString(
                                                row["ID"].ToString());
                    cell2Data.Attributes["onclick"] = "window.open('"
                                                      + cell2Data.ResolveClientUrl(
                                                          cell2Data.NavigateUrl)
                                                      + "'); return false;";
                    cell2Data.Text = row["StandardName"].ToString();
                    cell2.ToolTip = row["StandardName"].ToString();
                    cell2.Style.Add("overflow", "hidden");
                    cell2.Width = 100;
                    cell2.Controls.Add(cell2Data);

                    HtmlGenericControl cell3Data = new HtmlGenericControl("DIV");
                    ImageButton closeButton = new ImageButton();
                    closeButton.ImageUrl = "~/Images/X.png";
                    string closeButtonImgURL = closeButton.ResolveClientUrl(closeButton.ImageUrl);

                    cell3Data.InnerHtml =
                        "<div class=\"divOverflowHidden\"><a href=\"javascript:void(0);\" onclick=\"displayFullDescription(this); return false;\" class=\"standardTextLink\" >"
                        + row["Description"].ToString()
                        + "</a></div><div class='fullText'><img src='" + closeButtonImgURL
                        + "' onclick='this.parentNode.style.display=&quot;none&quot;;' style='position:relative; float:right; cursor:pointer;' />"
                        + row["Description"].ToString() + "</div>";
                    cell3.Controls.Add(cell3Data);
                    cell3.Width = 250;

                    cell4.Text = row["Grade"].ToString();
                    cell4.Width = 50;

                    cell5.Text = row["Subject"].ToString();
                    cell5.Width = 100;

                    cell6.Text = row["Course"].ToString();
                    cell6.Width = 100;

                    cell7.Text = row["Level"].ToString();
                    if (_standardsSearchDataTable.Rows.Count > 13)
                        cell7.Width = 91;
                    else
                        cell7.Width = 100;

                    newRow.Cells.Add(cell1);
                    newRow.Cells.Add(cell2);
                    newRow.Cells.Add(cell3);
                    newRow.Cells.Add(cell4);
                    newRow.Cells.Add(cell5);
                    newRow.Cells.Add(cell6);
                    newRow.Cells.Add(cell7);

                    standardsSearchTable.Rows.Add(newRow);
                }
            }
            standardsSearchTable.DataBind();
        }
コード例 #10
0
        private void LoadStandardsFilterTable()
        {
            standardsFilterTable.Rows.Clear();

            if (_standardsFilterDataTable != null && _standardsFilterDataTable.Rows.Count > 0)
            {
                tableContainerDiv.Attributes["style"] = "display:block;";
                updateButton.Enabled = true;
                defaultMessageDiv.Attributes["style"] = "display:none;";
            }
            else
            {
                tableContainerDiv.Attributes["style"] = "display:none;";
                defaultMessageDiv.Attributes["style"] = "display:block;";
                if(IsPostBack && filterIDs.Value.Length > 0) updateButton.Enabled = false;
            }

            foreach(DataRow row in _standardsFilterDataTable.Rows)
            {
                TableRow newRow = new TableRow();
                TableCell cell1 = new TableCell();
                TableCell cell2 = new TableCell();
                TableCell cell3 = new TableCell();
                TableCell cell4 = new TableCell();
                TableCell cell5 = new TableCell();
                TableCell cell6 = new TableCell();
                TableCell cell7 = new TableCell();

                HtmlInputCheckBox cell1Data = new HtmlInputCheckBox();
                cell1Data.ID = "standardsFilterCheckbox_" + row["StandardID"].ToString();
                cell1Data.ClientIDMode = System.Web.UI.ClientIDMode.Static;
                cell1Data.Attributes["onclick"] = "removeFromFilter(this, this.checked);";
                cell1Data.Attributes["standardID"] = row["StandardID"].ToString();
                cell1.CssClass = "alignCellCenter";
                cell1.Width = 50;
                cell1.Controls.Add(cell1Data);

                HyperLink cell2Data = new HyperLink();
                cell2Data.NavigateUrl = "~/Record/StandardsPage.aspx?xID=" + Standpoint.Core.Classes.Encryption.EncryptString(row["StandardID"].ToString());
                cell2Data.Attributes["onclick"] = "window.open('" + cell2Data.ResolveClientUrl(cell2Data.NavigateUrl) + "'); return false;";
                cell2Data.Text = row["StandardName"].ToString();
                cell2.ToolTip = row["StandardName"].ToString();
                cell2.Style.Add("overflow", "hidden");
                cell2.Width = 100;
                cell2.Controls.Add(cell2Data);

                HtmlGenericControl cell3Data = new HtmlGenericControl("DIV");
                ImageButton closeButton = new ImageButton();
                closeButton.ImageUrl = "~/Images/X.png";
                string closeButtonImgURL = closeButton.ResolveClientUrl(closeButton.ImageUrl);

                cell3Data.InnerHtml = "<div class=\"divOverflowHidden\"><a href=\"javascript:void(0);\" onclick=\"displayFullDescription(this); return false;\" class=\"standardTextLink\" >"
                    + row["Desc"].ToString() + "</a></div><div class='fullText'><img src='" + closeButtonImgURL
                    + "' onclick='this.parentNode.style.display=&quot;none&quot;;' style='position:relative; float:right; cursor:pointer;' />" + row["Desc"].ToString() + "</div>";
                cell3.Controls.Add(cell3Data);
                cell3.Width = 250;

                cell4.Text = row["Grade"].ToString();
                cell4.Width = 50;

                cell5.Text = row["Subject"].ToString();
                cell5.Width = 100;

                cell6.Text = row["Course"].ToString();
                cell6.Width = 100;

                cell7.Text = row["Level"].ToString();
                if (_standardsFilterDataTable.Rows.Count > 13) cell7.Width = 91;
                else cell7.Width = 100;

                newRow.Cells.Add(cell1);
                newRow.Cells.Add(cell2);
                newRow.Cells.Add(cell3);
                newRow.Cells.Add(cell4);
                newRow.Cells.Add(cell5);
                newRow.Cells.Add(cell6);
                newRow.Cells.Add(cell7);

                standardsFilterTable.Rows.Add(newRow);
            }

            standardsFilterTable.DataBind();
        }