Ejemplo n.º 1
0
        private void PaymentForm_Load(object sender, EventArgs e)
        {
            var x      = _paiementRepository.GetPayments(true, true).Result;
            var mapped = _mapper.Map <PaymentDTO[]>(x);

            dataList = new List <DataDTO>();
            for (int i = 0; i < mapped.Length; i++)
            {
                var data = _mapper.Map <DataDTO>(mapped[i]);
                dataList.Add(data);
            }
            dt = new DataTable();
            using (var reader = ObjectReader.Create(dataList))
            {
                dt.Load(reader);
            }
            PaymentsGrid.DataSource             = dt;
            PaymentsGrid.Columns[0].Visible     = false;
            PaymentsGrid.Columns[5].Visible     = false;
            PaymentsGrid.Columns[10].Visible    = false;
            PaymentsGrid.Columns[2].HeaderText  = "Nom";
            PaymentsGrid.Columns[3].HeaderText  = "Téléphone";
            PaymentsGrid.Columns[4].HeaderText  = "Ville";
            PaymentsGrid.Columns[6].HeaderText  = "Nom traceur";
            PaymentsGrid.Columns[7].HeaderText  = "Date renouvellement";
            PaymentsGrid.Columns[9].HeaderText  = "Date paiement";
            PaymentsGrid.Columns[11].HeaderText = "Payé";
            PaymentsGrid.Columns[11].ReadOnly   = true;
            foreach (DataGridViewColumn col in PaymentsGrid.Columns)
            {
                col.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter;
                col.HeaderCell.Style.Font      = new Font("Arial", 16F, FontStyle.Bold, GraphicsUnit.Pixel);
            }
            LoadColumns();
        }
Ejemplo n.º 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            var x = _paiementRepository.GetPayments(true, true).Result;

            var mapped = _mapper.Map <PaymentDTO[]>(x);

            var            m        = _mapper.Map <DataDTO>(mapped[0]);
            var            length   = mapped.Length;
            List <DataDTO> dataList = new List <DataDTO>();

            for (int i = 0; i < mapped.Length; i++)
            {
                var data = _mapper.Map <DataDTO>(mapped[i]);
                dataList.Add(data);
            }
            var j = dataList;

            dgv.DataSource = dataList;

            var y = 0;
        }