Example #1
0
        public void GetCustomer(int id)
        {
            Client client = _clientDataService.GetClient(id) ?? new Client {
                Nom = "Test", Prenom = "TestPre", Mail = "*****@*****.**", Birthday = DateTime.Now, Phone = "0785649752"
            };

            IdClient        = client.Id;
            _view.Nom       = client.Nom;
            _view.Prenom    = client.Prenom;
            _view.Mail      = client.Mail;
            _view.Telephone = client.Phone;
            _view.BirthDay  = client.Birthday.ToShortDateString();
        }
Example #2
0
        public void FillDGV()
        {
            List <DGVHistorique> Historiques       = new HistoriqueDataService(_cache, _serializer, _errorLogger).GetAllHistoriquesOfEmp(Constant.CurrentEmploye.Id) ?? new List <DGVHistorique>();
            ClientDataService    clientDataService = new ClientDataService(_cache, _serializer, _errorLogger);

            foreach (DGVHistorique his in Historiques)
            {
                Client cli = clientDataService.GetClient(his.ClientId);
                if (cli != null)
                {
                    his.Prenom = cli.Prenom;
                    his.Nom    = cli.Nom;
                }
            }
            var h = new BindingList <DGVHistorique>(Historiques);

            _control.DataGridViewHistorique.DataSource = new BindingSource(h, null);
            if (Historiques.Count > 0)
            {
                _control.DataGridViewHistorique.Columns["ClientId"].Visible = false;
            }
        }