Exemplo n.º 1
0
 public void BindData(Guid ForParentEntityID, string prefix)
 {
     IList<Territory> territories = TerritoryManager.GetSubTerritories(ForParentEntityID);
     if (territories != null)
     {
         foreach (Territory territory in territories)
         {
             ComboBoxItem item = new ComboBoxItem(prefix + territory.Name, territory.TerritoryID);
             this.cbxTerritories.Items.Add(item);
             if (territory.TerritoryID == this.selectedTerritoryID)
                 cbxTerritories.SelectedItem = item;
             if (TerritoryManager.GetSubTerritories(territory.TerritoryID).Count > 0)
                 BindData(territory.TerritoryID, prefix + "--");
         }
     }
 }
Exemplo n.º 2
0
        public void BindData(IList<Employee> employees)
        {
            cbxEmployees.Items.Clear();
            if(this.emptyTextVisible)
                cbxEmployees.Items.Add(new ComboBoxItem(this.EmptyItemText, Guid.Empty));

            if (employees != null)
            {
                foreach (Employee emp in employees)
                {
                    ComboBoxItem item = new ComboBoxItem(emp.ToString(), emp.EmployeeID);
                    this.cbxEmployees.Items.Add(item);
                    if (emp.EmployeeID == this.selectedEmployeeID)
                        cbxEmployees.SelectedItem = item;
                }
            }
        }
Exemplo n.º 3
0
        public void BindData()
        {
            IList<Dictionary> taskStatuses = DictionaryManager.GetDictionariesByType("Status zadania");
            cbxTaskStatus.Items.Clear();
            if (this.emptyTextVisible)
                cbxTaskStatus.Items.Add(new ComboBoxItem(this.EmptyItemText, Guid.Empty));

            if (taskStatuses != null)
            {
                foreach (Dictionary dict in taskStatuses)
                {
                    ComboBoxItem item = new ComboBoxItem(dict.Value, dict.DictionaryID);
                    this.cbxTaskStatus.Items.Add(item);
                    if (dict.DictionaryID == this.selectedTaskStatusID)
                        cbxTaskStatus.SelectedItem = item;
                }
            }
        }
Exemplo n.º 4
0
 //Wypełnij danymi rekurencyjnie
 private void BindData(Guid ForParentEntityID, string prefix)
 {
     //pobierz liste podgrup dla danej grupy
     IList<ProductGroup> productGroupList = ProductManager.GetSubProductGroups(ForParentEntityID);
     if (productGroupList != null && productGroupList.Count > 0)
     {
         //kazda podgrupe oraz jej podgrupy dodaj do listy
         for(int i=0; i<productGroupList.Count; i++)
         {
             ProductGroup productGroup = productGroupList[i];
             ComboBoxItem item = new ComboBoxItem(prefix + productGroup.Name, productGroup.ProductGroupID);
             this.cbxPGroups.Items.Add(item);
             if (productGroup.ProductGroupID == this.selectedProductGroupID)
                 cbxPGroups.SelectedItem = item;
             //dodaj podgrupy grupy zwiekszajac jednoczesnie wciecie
             BindData(productGroup.ProductGroupID, prefix + "--");
         }
     }
 }