Example #1
0
        public List <FifaModeles.TransfertsModele> ListAll()
        {
            try
            {
                List <FifaModeles.TransfertsModele> lTransferts = new List <FifaModeles.TransfertsModele>();

                using (FifaManagerEphecEntities ctx = new FifaManagerEphecEntities(_Connection))
                {
                    foreach (Transferts_GetAll_Result oTrans in ctx.Transferts_GetAll())
                    {
                        FifaModeles.TransfertsModele transfert = new FifaModeles.TransfertsModele();
                        transfert.joueurId   = oTrans.joueurId;
                        transfert.equipeId   = oTrans.equipeId;
                        transfert.dateDebut  = oTrans.dateDebut;
                        transfert.dateFin    = oTrans.dateFin;
                        transfert.lastUpdate = oTrans.lastUpdate;
                        lTransferts.Add(transfert);
                    }
                }
                return(lTransferts);
            }
            catch (Exception ex)
            {
                if (ex.InnerException != null && ex.InnerException is SqlException)
                {
                    TechnicalError oErreur = new TechnicalError((SqlException)ex.InnerException);
                    throw oErreur;
                }
                else
                {
                    throw ex;
                }
            }
        }