1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
| using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
public class RetrievDataClass
{
public RetrievDataClass()
{
}
public IQueryable<FactureData> GetFacture()
//IQueryable :Fournit les fonctionnalités permettant d'évaluer les requêtes
// appliquées à une source de données spécifique dont le type de données n'est pas défini.
{
var db = new DataClassesDataContext();
return db.DimFacture.Select( myData => new FactureData
{
fact_Comdee_Facturee = myData.fact_Comdee_Facturee,
factManNman = myData.factManNman,
echeanceFacture = myData.echeanceFacture
}) db.DimClient.Select(myData => new ClientData
{
nomClient=myData.nomClient,
numClient=myData.numClient,
dateNaissance=myData.dateNaissance,
typeClient=myData.typeClient
});
}
public class FactureData
{
public string fact_Comdee_Facturee { get; set; }
public string factManNman { get; set; }
public string echeanceFacture { get; set; }
}
public IQueryable<ClientData> GetClient()
{
var db = new DataClassesDataContext();
return db.DimClient.Select(myData => new ClientData
{
nomClient=myData.nomClient,
numClient=myData.numClient,
dateNaissance=myData.dateNaissance,
typeClient=myData.typeClient
});
}
public class ClientData
{
public string nomClient { get; set; }
public decimal numClient { get; set; }
public DateTime dateNaissance { get; set; }
public string typeClient { get; set; }
}
public IQueryable<TempsData> GetTemps()
{
var db = new DataClassesDataContext();
return db.DimTemps.Select(myData => new TempsData
{
NoMois = myData.NoMois,
NomMois=myData.NomMois,
Annee=myData.Annee
});
}
public class TempsData
{
public byte? NoMois { get; set; }
public string NomMois { get; set; }
public short? Annee { get; set; }
}
public IQueryable<ActiviteData> GetActivite()
{
var db = new DataClassesDataContext();
return db.DimActivite.Select(myData => new ActiviteData
{
libelleActivite=myData.libelleActivite
});
}
public class ActiviteData
{
public string libelleActivite { get; set; }
}
public IQueryable<ProlabCimacData> GetProlabCimac()
{
var db = new DataClassesDataContext();
return db.FactProlabCimac.Select(myData => new ProlabCimacData
{
chiffreDaffaire = myData.chiffreDaffaire
});
}
public class ProlabCimacData
{
public decimal chiffreDaffaire { get; set; }
}
} |
Partager