Exemplo n.º 1
0
 /// <summary>
 /// Добавляет подразделение в орг. структуру
 /// </summary>
 /// <param name="element">Подразделение</param>
 public string AddOrganizationStructureElement(OrganizationStructureElement element)
 {
     return CheckAutorizedInvoke(() => client.AddOrganizationStructureElement(Token, element));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Изменение данных о подразделении
 /// </summary>
 /// <param name="element">Подразделение</param>
 public void ModifyOrganizationStructureElement(OrganizationStructureElement element)
 {
     CheckAutorizedInvoke(() =>
     {
         client.ModifyOrganizationStructureElement(Token, element);
         return true;
     });
 }
Exemplo n.º 3
0
        /// <summary>
        /// возвращает дерево орг.структуры
        /// </summary>
        /// <param name="data"></param>
        /// <param name="elements"></param>
        /// <param name="count"></param>
        /// <returns></returns>
        private List<UserInput.Option> GetTreeOfOrganizationStructure(OrganizationStructureElement[] data,
                                                                      IEnumerable<OrganizationStructureElement> elements,
                                                                      int count)
        {
            foreach (var element in elements)
            {
                var label = GetSpace(count) + element.Name + " КПП: " + element.Kpp;
                _departmentsOptions.Add(new UserInput.Option((_index + 1).ToString(CultureInfo.InvariantCulture), label,
                    _index == 0, element));
                _index++;
                var childElements = data.Where(d => d.ParentId == element.Id);
                var organizationStructureElements = childElements as OrganizationStructureElement[] ??
                                                    childElements.ToArray();
                if (organizationStructureElements.Length != 0)
                    GetTreeOfOrganizationStructure(data, organizationStructureElements, count + 1);
            }

            return _departmentsOptions;
        }