示例#1
0
        public CommandeUC()
        {
            InitializeComponent();

            HideOrShowElements();

            comboBoxClient.DropDownStyle = ComboBoxStyle.DropDownList;

            comboBoxClient.DisplayMember = "Nom";

            CommandeDto[] commandes = _commandesService.GetCommandes().ToArray();
            var           clients   = _clientsService.GetClients();

            comboBoxClient.DataSource = clients;
            if (commandes.Length > 0)
            {
                UpdateDataGrid();

                gridCommandes.Columns[0].Width    = 30;
                gridCommandes.Columns[0].ReadOnly = true;
                gridCommandes.Columns[1].ReadOnly = true;
                gridCommandes.Columns[2].Width    = 75;
                gridCommandes.Columns[3].Width    = 125;
                gridCommandes.Columns[3].ReadOnly = true;
                gridCommandes.Columns[4].Width    = 125;
                gridCommandes.Columns[4].ReadOnly = true;
            }
        }
示例#2
0
        private void UpdateDataGrid()
        {
            ClientDto[]       clients  = _clientsService.GetClients().ToArray();
            List <AdresseDto> adresses = _adressesService.GetAdresses();


            string[] excludedValues = new string[] { "Adresse", "Commande" };

            if (clients.Length > 0)
            {
                gridClients.Rows.Clear();
                gridClients = _tools.GenerateGrid(gridClients, clients, excludedValues);
                gridClients.Columns[0].Width    = 30;
                gridClients.Columns[0].ReadOnly = true;
                gridClients.Columns[3].ReadOnly = true;
                gridClients.Columns[4].ReadOnly = true;
                gridClients.Columns[5].ReadOnly = true;
                gridClients.Columns[5].Width    = 75;
            }
            gridClients.AllowUserToAddRows = false;

            comboBoxAdresses.DataSource = adresses;
        }
示例#3
0
        public IEnumerable <ClientModel> GetAllClients([FromUri] GetAllRequest filter)
        {
            if (filter == null)
            {
                filter = new GetAllRequest();
            }

            var clients = _clientsService.GetClients(new SearchingGetAllFilter()
            {
                Limit  = filter.Limit ?? 5,
                Offset = filter.Offset ?? 0
            });

            return(clients.Select(_ => _?.ToModel()));
        }
示例#4
0
 public async Task <IActionResult> GetClients()
 {
     return(await Task.Run(() => CallApi(() => _clientsService.GetClients())));
 }
示例#5
0
 public IQueryable <ClientModel> GetClients()
 {
     return(_clientsService.GetClients());
 }