コード例 #1
0
        protected void RadComboShipmentKey_ItemDataBound(object sender, RadComboBoxItemEventArgs e)
        {
            RadComboBoxItem item = e.Item;

            if (item.Index > -1 && item.DataItem is ReturnWeeklySummaryViewBO)
            {
                ReturnWeeklySummaryViewBO objWeeklySummaryView = (ReturnWeeklySummaryViewBO)item.DataItem;

                Literal litShipTo = (Literal)item.FindControl("litShipTo");
                litShipTo.Text = objWeeklySummaryView.CompanyName;

                Literal litWeek = (Literal)item.FindControl("litWeek");
                litWeek.Text = WeekNo;

                Literal litETD = (Literal)item.FindControl("litETD");
                litETD.Text = WeekEndDate.ToString("dd MMMM yyyy");

                Literal litMode = (Literal)item.FindControl("litMode");
                litMode.Text = objWeeklySummaryView.ShipmentMode;

                Literal litQty = (Literal)item.FindControl("litQty");
                litQty.Text = objWeeklySummaryView.Qty.ToString();

                item.Value = objWeeklySummaryView.DistributorClientAddress.ToString() + "," + objWeeklySummaryView.ShipmentModeID.ToString();
            }
        }
コード例 #2
0
        private void LoadSchoolDropdown()
        {
            schoolDropdown.Items.Clear();
            
            //Build school ListBox
            foreach (var school in _schools)
            {
                var schoolListItem = new RadComboBoxItem
                    {
                        Text = school.Name,
                        Value = school.ID.ToString(CultureInfo.InvariantCulture)
                    };

                schoolDropdown.Items.Add(schoolListItem);

                var itemLabel = (Label)schoolListItem.FindControl("schoolLabel");

                if (itemLabel != null)
                {
                    itemLabel.Text = school.Name;
                }
            }

            var findButton = new RadComboBoxItem();
            schoolDropdown.Items.Add(findButton);

            var findButtonCheckbox = (CheckBox)findButton.FindControl("schoolCheckbox");
            if (findButtonCheckbox != null)
            {
                findButtonCheckbox.InputAttributes["style"] = "display:none;";
            }
        }
コード例 #3
0
        protected void RadComboWeek_ItemDataBound(object sender, RadComboBoxItemEventArgs e)
        {
            RadComboBoxItem item = e.Item;

            if (item.Index > -1 && item.DataItem is WeeklyProductionCapacityBO)
            {
                WeeklyProductionCapacityBO objWeeklyProductionCapacity = (WeeklyProductionCapacityBO)item.DataItem;

                Literal litWeekNo = (Literal)item.FindControl("litWeekNo");
                litWeekNo.Text = objWeeklyProductionCapacity.WeekNo + "/" + objWeeklyProductionCapacity.WeekendDate.Year;

                Literal litETD = (Literal)item.FindControl("litETD");
                litETD.Text = objWeeklyProductionCapacity.WeekendDate.ToString("dd MMMM yyyy");

                item.Value = objWeeklyProductionCapacity.ID.ToString();
            }
        }
コード例 #4
0
        private void BuildStandards()
        {
            var selectedStandards = (List<int>)ViewState[StandardsFilterKey];
            if (_standardsDT == null) _standardsDT = Base.Classes.Standards.GetStandardsForInstructionalPlan(1, _classID, _term);
            if (_standardsDT == null || _standardsDT.Rows.Count == 0) return;

            resourceStandardsDropdown.Items.Clear();
            var resourceStandardsDropdownCheckedItemsTotal = 0;

            var resourceStandardsListItemAll = new RadComboBoxItem();
            resourceStandardsListItemAll.Text = "All Standards";
            resourceStandardsListItemAll.Value = "All Standards";
            resourceStandardsDropdown.Items.Add(resourceStandardsListItemAll);

            var allItemCheckbox = (CheckBox)resourceStandardsListItemAll.FindControl("resourceStandardsCheckBox");
            var allItemLabel = (Label)resourceStandardsListItemAll.FindControl("resourceStandardsLabel");
            allItemCheckbox.Attributes["onclick"] = "RadCombobox_CustomMultiSelectDropdown_evaluateCheckedItem(this, '" + resourceStandardsDropdown.ClientID + "', 'resourceStandards')";
            if (selectedStandards.Count == _standardsDT.Rows.Count || selectedStandards.Count == 0)
            {
                if (allItemCheckbox != null)
                {
                    allItemCheckbox.Checked = true;
                    resourceStandardsDropdown.Text = "All Standards";
                }
            }
            if (allItemLabel != null)
            {
                allItemLabel.Text = "All Standards";
            }

            foreach (DataRow row in _standardsDT.Rows)
            {
                var resourceStandardsListItem = new RadComboBoxItem();
                resourceStandardsListItem.Text = row["StandardName"].ToString();
                resourceStandardsListItem.Value = row["StandardID"].ToString();

                resourceStandardsDropdown.Items.Add(resourceStandardsListItem);

                var itemCheckbox = (CheckBox)resourceStandardsListItem.FindControl("resourceStandardsCheckbox");
                var itemLabel = (Label)resourceStandardsListItem.FindControl("resourceStandardsLabel");
                itemCheckbox.Attributes["onclick"] = "RadCombobox_CustomMultiSelectDropdown_evaluateCheckedItem(this, '" + resourceStandardsDropdown.ClientID + "', 'resourceStandards')";
                bool itemExistsInSession = selectedStandards.Contains(DataIntegrity.ConvertToInt(row["StandardID"]));

                if (itemCheckbox != null)
                {
                    if (selectedStandards.Count == _standardsDT.Rows.Count || selectedStandards.Count == 0)
                    {
                        itemCheckbox.Checked = true;
                        resourceStandardsDropdownCheckedItemsTotal++;
                    }
                    else if (itemExistsInSession)
                    {
                        itemCheckbox.Checked = true;
                        resourceStandardsDropdownCheckedItemsTotal++;
                        resourceStandardsDropdown.Text = row["StandardName"].ToString();
                    }
                }
                if (itemLabel != null)
                {
                    itemLabel.Text = row["StandardName"].ToString();
                }
            }

            if (resourceStandardsDropdownCheckedItemsTotal == _standardsDT.Rows.Count)
            {
                resourceStandardsDropdown.Items[0].Checked = true;
                var itemCheckbox = (CheckBox)resourceStandardsDropdown.Items[0].FindControl("resourceStandardsCheckbox");
                itemCheckbox.Checked = true;
                resourceStandardsDropdown.Items[0].Selected = true;
            }
            else if (resourceStandardsDropdownCheckedItemsTotal > 1)
            {
                resourceStandardsDropdown.Text = "Multiple";
            }

            var findButton = new RadComboBoxItem();
            resourceStandardsDropdown.Items.Add(findButton);

            var findButtonCheckbox = (CheckBox)findButton.FindControl("resourceStandardsCheckbox");
            var findButtonImg = (HtmlImage)findButton.FindControl("okImgBtn");
            findButtonImg.Src = ResolveUrl("~/Images/ok.png");
            findButtonCheckbox.Attributes["onclick"] = "RadCombobox_CustomMultiSelectDropdown_evaluateCheckedItem(this, '" + resourceStandardsDropdown.ClientID + "', 'resourceStandards')";
            if (findButtonCheckbox != null)
            {
                findButtonCheckbox.InputAttributes["style"] = "display:none;";
            }
        }
コード例 #5
0
        private void LoadUserTypeDropdown()
        {
            userTypeDropdown.Items.Clear();
            int maxHierarchyLevel = SessionObject.LoggedInUser.Roles.OrderByDescending(y => y.RoleHierarchyLevel).First().RoleHierarchyLevel;
            
            //Build role ListBox
            foreach (var role in _roles)
            {
                //PLH - 11/12/2012 - Temporary fix to not allow admins to add teachers or teach plus. Also eliminates district superintendent. Currently this causes duplicates to appear after roster loads and causes
                //more issues than it solves
                if (role.RoleName.ToLower() != "teacher" && role.RoleName.ToLower() != "teach plus" && role.RoleName.ToLower() != "district superintendent" && role.RoleName.ToLower() != "student" && role.RoleHierarchyLevel >= maxHierarchyLevel)
                {
                    var userTypeListItem = new RadComboBoxItem {Text = role.RoleName, Value = role.RoleId.ToString()};

                    userTypeDropdown.Items.Add(userTypeListItem);

                    var itemLabel = (Label)userTypeListItem.FindControl("userTypeLabel");

                    if (itemLabel != null)
                    {
                        itemLabel.Text = role.RoleName;
                    }
                }
            }

            var findButton = new RadComboBoxItem();
            userTypeDropdown.Items.Add(findButton);

            var findButtonCheckbox = (CheckBox)findButton.FindControl("userTypeCheckbox");
            if (findButtonCheckbox != null)
            {
                findButtonCheckbox.InputAttributes["style"] = "display:none;";
            }
        }
コード例 #6
0
        private void LoadUserTypeDropdown()
        {
            userTypeDropdown.Items.Clear();
            int userTypeDropdownCheckedItemsTotal = 0;

            RadComboBoxItem userTypeListItemAll = new RadComboBoxItem();
            //userTypeListItemAll.Text = "All";
            //userTypeListItemAll.Value = "Multiple";
            //userTypeDropdown.Items.Add(userTypeListItemAll);

            CheckBox allItemCheckbox = (CheckBox)userTypeListItemAll.FindControl("userTypeCheckBox");
            Label allItemLabel = (Label)userTypeListItemAll.FindControl("userTypeLabel");
            if (_selectedStaff.RoleList.Count > 1)
            {
                if (allItemCheckbox != null)
                {
                    allItemCheckbox.Checked = true;
                    userTypeDropdown.Text = "Multiple";
                }
            }
            if (allItemLabel != null)
            {
                allItemLabel.Text = "All";
            }

            int maxHierarchyLevel = SessionObject.LoggedInUser.Roles.OrderByDescending(y => y.RoleHierarchyLevel).First().RoleHierarchyLevel;

            //Build role ListBox
            foreach (var role in _roles)
            {
                //PLH - 11/12/2012 - Eliminates district superintendent from role dropdown. Temporary bandaid.
                if (role.RoleName.ToLower() != "district superintendent" && role.RoleName.ToLower() != "student")
                {
                    RadComboBoxItem userTypeListItem = new RadComboBoxItem();
                    Label userTypeLabel = (Label)userTypeListItem.FindControl("userTypeLabel");
                    
                    // 7715 - test coordinator is not allowed to change permission to district administrator
                    // rollbacked as requested
                    //SessionObject sessionObject = (SessionObject)Session["SessionObject"];
                    //if (sessionObject.LoggedInUser.Roles[0].RoleName.ToLower() == "test coordinator" && role.RoleName.ToLower() == "district administrator")
                    //{
                    //    continue;
                    //}

                    userTypeListItem.Text = role.RoleName;
                    userTypeListItem.Value = role.RoleId.ToString();

                    userTypeDropdown.Items.Add(userTypeListItem);

                    CheckBox itemCheckbox = (CheckBox)userTypeListItem.FindControl("userTypeCheckbox");
                    itemCheckbox.Enabled = role.RoleHierarchyLevel >= maxHierarchyLevel;
                    Label itemLabel = (Label)userTypeListItem.FindControl("userTypeLabel");
                    itemLabel.ForeColor = role.RoleHierarchyLevel >= maxHierarchyLevel ? System.Drawing.Color.Black : System.Drawing.Color.Gray;

                    if (itemCheckbox != null)
                    {
                        var isStaffRole = _selectedStaff.RoleList.Find(r => r.RoleId == role.RoleId);
                        if (isStaffRole != null)
                        {
                            itemCheckbox.Checked = true;
                            userTypeDropdownCheckedItemsTotal++;
                            userTypeListItem.Selected = true;
                            userTypeDropdown.Text = role.RoleName;
                        }
                    }
                    if (itemLabel != null)
                    {
                        itemLabel.Text = role.RoleName;
                    }
                    
                }
            }

            if (userTypeDropdownCheckedItemsTotal == _roles.Count)
            {
                userTypeDropdown.Items[0].Checked = true;
                userTypeDropdown.Items[0].Selected = true;
            }

            if (userTypeDropdownCheckedItemsTotal > 1)
            {
                userTypeDropdown.ClearSelection();
                userTypeDropdown.Text = "Multiple";
            }

            RadComboBoxItem findButton = new RadComboBoxItem();
            userTypeDropdown.Items.Add(findButton);

            CheckBox findButtonCheckbox = (CheckBox)findButton.FindControl("userTypeCheckbox");
            if (findButtonCheckbox != null)
            {
                findButtonCheckbox.InputAttributes["style"] = "display:none;";
            }
        }
コード例 #7
0
        private void LoadSchoolDropdown()
        {
            schoolDropdown.Items.Clear();
            int schoolDropdownCheckedItemsTotal = 0;

            RadComboBoxItem schoolListItemAll = new RadComboBoxItem();
            //schoolListItemAll.Text = "All";
            //schoolListItemAll.Value = "Multiple";
            //schoolDropdown.Items.Add(schoolListItemAll);

            CheckBox allItemCheckbox = (CheckBox)schoolListItemAll.FindControl("schoolCheckBox");
            //Label allItemLabel = (Label)schoolListItemAll.FindControl("schoolLabel");
            if (_selectedStaff.SchoolList.Count > 1)
            {
                if (allItemCheckbox != null)
                {
                    allItemCheckbox.Checked = true;
                    schoolDropdown.Text = "Multiple";
                }
            }
            //if (allItemLabel != null)
            //{
            //    allItemLabel.Text = "All";
            //}

            //Build school ListBox
            foreach (var school in _schools)
            {
                RadComboBoxItem schoolListItem = new RadComboBoxItem();
                Label schoolLabel = (Label)schoolListItem.FindControl("schoolLabel");
                schoolListItem.Text = school.Name;
                schoolListItem.Value = school.ID.ToString();

                schoolDropdown.Items.Add(schoolListItem);

                CheckBox itemCheckbox = (CheckBox)schoolListItem.FindControl("schoolCheckbox");
                Label itemLabel = (Label)schoolListItem.FindControl("schoolLabel");

                if (itemCheckbox != null)
                {
                    var isStaffSchool = _selectedStaff.SchoolList.Find(s => s.ID == school.ID);
                    if (isStaffSchool != null)
                    {
                        itemCheckbox.Checked = true;
                        schoolListItem.Selected = true;
                        schoolDropdownCheckedItemsTotal++;
                        schoolDropdown.Text = school.Name;
                    }
                }
                if (itemLabel != null)
                {
                    itemLabel.Text = school.Name;
                }
            }

            if (schoolDropdownCheckedItemsTotal == _schools.Count)
            {
                schoolDropdown.Items[0].Checked = true;
                schoolDropdown.Items[0].Selected = true;
            }
            
            if (schoolDropdownCheckedItemsTotal > 1)
            {
                schoolDropdown.ClearSelection();
                schoolDropdown.Text = "Multiple";
            }

            RadComboBoxItem findButton = new RadComboBoxItem();
            schoolDropdown.Items.Add(findButton);

            CheckBox findButtonCheckbox = (CheckBox)findButton.FindControl("schoolCheckbox");
            if (findButtonCheckbox != null)
            {
                findButtonCheckbox.InputAttributes["style"] = "display:none;";
            }
        }