Esempio n. 1
0
        public IEnumerable <SocieteView> GetAll()
        {
            var societes = _service.SocieteGetAll().Select(ToView);

            if (Program.IsMultiSociete)
            {
                return(societes);
            }
            return(new List <SocieteView> {
                societes.First()
            });
        }
        // charger la liste des societe
        private void InitcbSociete()
        {
            try
            {
                var listSociete = _service.SocieteGetAll().ToList();

                cbSociete.Properties.View.Columns.Add(new GridColumn
                {
                    Caption   = "",
                    FieldName = "RaisonSocial",
                    Visible   = true,
                });
                cbSociete.Properties.DisplayMember  = "RaisonSocial";
                cbSociete.Properties.ValueMember    = "Id";
                cbSociete.Properties.DataSource     = listSociete;
                cbSociete.Properties.ImmediatePopup = true;
                cbSociete.Properties.View.OptionsView.ShowColumnHeaders = false;
                cbSociete.Properties.ShowFooter = false;
                cbSociete.Properties.View.OptionsView.ShowIndicator = false;
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message);
            }
        }