/// <summary> /// Recherche les clients et les ajoute à la liste /// </summary> private void FindClient(bool AddCoursTerminer, string ContainContractNumber) { listFindResult.Items.Clear(); var ListClientTous = from V in _clientList.Cast <Customer>() where V.ContratNumber.Contains(ContainContractNumber) select V; var ListClient = from V in _clientList.Cast <Customer>() where V.ContratNumber.Contains(ContainContractNumber) && V.TypeClient != ProfileType.CoursTerminer select V; //Recherche dans tous les clients if (AddCoursTerminer) { foreach (Customer client in ListClientTous) { AddClientToList(client); } } else { foreach (Customer client in ListClient) { AddClientToList(client); } } }
/// <summary> /// Recherche les clients et les ajoute à la liste /// </summary> private void FindClient(bool AddCoursTerminer) { listFindResult.Items.Clear(); var clientsAll = from client in _clientList.Cast <Customer>() where client.GetCustomerType() == _groupe.Type select client; var clients = from client in _clientList.Cast <Customer>() where (client.GetCustomerType() == _groupe.Type) && (client.TypeClient != ProfileType.CoursTerminer) select client; switch (AddCoursTerminer) { case true: foreach (Customer client in clientsAll) { AddClientToList(client); } break; case false: foreach (Customer client in clients) { AddClientToList(client); } break; } }
/// <summary> /// Cree la liste des numeros de groupe disponible /// </summary> private void LoadList() { var GroupList = from client in _ClientList.Cast <Customer>() group client by client.NumeroGroupe into d orderby d.Key ascending select d; txtGroupNumber.Items.Add(""); foreach (var count in GroupList) { txtGroupNumber.Items.Add(count.Key); } }
/// <summary> /// Retourne le nombre d'élève dans le groupe /// </summary> /// <param name="NumeroGroupe"></param> /// <returns></returns> private int GetNbEleve(int NumeroGroupe) { int total = (from v in _ClientList.Cast <Customer>() where v.NumeroGroupe == NumeroGroupe select v).Count(); return(total); }
private void MakeGraph() { DateTime date = new DateTime(dtpStartMonth.Value.Year, dtpStartMonth.Value.Month, 1); //Group By ... Donnee pour le graph var grouped = from p in _clientlist.Cast <Customer>() where p.DateInscription >= date group p by new { month = p.DateInscription.Month, year = p.DateInscription.Year } into d orderby d.Key.year, d.Key.month ascending select new { datetime = string.Format("{0}/{1}", d.Key.month, d.Key.year), count = d.Count() }; var groupedMoto = from p in _clientlist.Cast <Customer>() where (p.DateInscription >= date) && (p.TypeVehicule == VehiculeType.Moto) group p by new { month = p.DateInscription.Month, year = p.DateInscription.Year } into d orderby d.Key.year, d.Key.month ascending select new { datetime = string.Format("{0}/{1}", d.Key.month, d.Key.year), count = d.Count() }; var groupedCyclomoteur = from p in _clientlist.Cast <Customer>() where (p.DateInscription >= date) && (p.TypeVehicule == VehiculeType.Cyclomoteur) group p by new { month = p.DateInscription.Month, year = p.DateInscription.Year } into d orderby d.Key.year, d.Key.month ascending select new { datetime = string.Format("{0}/{1}", d.Key.month, d.Key.year), count = d.Count() }; var groupedAutomobile = from p in _clientlist.Cast <Customer>() where (p.DateInscription >= date) && (p.TypeVehicule == VehiculeType.Manuel || p.TypeVehicule == VehiculeType.Automatique) group p by new { month = p.DateInscription.Month, year = p.DateInscription.Year } into d orderby d.Key.year, d.Key.month ascending select new { datetime = string.Format("{0}/{1}", d.Key.month, d.Key.year), count = d.Count() }; //Cree un link au tableau chart1.Series["Inscriptions"].Points.DataBind(grouped, "datetime", "count", ""); chart1.Series["Motocyclette"].Points.DataBind(groupedMoto, "datetime", "count", ""); chart1.Series["Cyclomoteur"].Points.DataBind(groupedCyclomoteur, "datetime", "count", ""); chart1.Series["Automobile"].Points.DataBind(groupedAutomobile, "datetime", "count", ""); }