Example #1
0
        private void Button1Click(object sender, System.EventArgs e)
        {
            var users = _service.GetUsers();

            //List<int> clientsId = _service.GetClients();
            //foreach (int clientId in clientsId)
            //{
            //    Client client = _service.GetClient(clientId);
            //}

            //List<int> productsId = _service.GetProducts();
            //foreach (int productId in productsId)
            //{
            //    Product product = _service.GetProduct(productId);
            //}

            //List<int> projectsId = _service.GetProjects();
            //foreach (int projectId in projectsId)
            //{
            //    var project = _service.GetProject(projectId);
            //}
        }
Example #2
0
        /// <summary>Получение списка пользователей</summary>
        public static LUsers GetUsers()
        {
            if (!CreateClient())
            {
                return(null);
            }

            try
            {
                var users = service.GetUsers();
                LogManager.LogInfo(unit, string.Format("Загружено пользователей: {0}", users.Count));

                return(users);
            }
            catch (Exception ex)
            {
                LogManager.LogError(unit, string.Format("Ошибка загрузки пользователей:"), ex);

                CloseClient();
            }

            return(null);
        }