public ProjetForfait( string nomprojet, DateTime debut, DateTime fin, Client cli,
 string contact, string mailcontact, decimal mtc, Penalite cp, Collaborateur chef) : base( nomprojet, debut, fin, cli, contact, mailcontact)
 {
     this.MontantContrat = mtc;
     this.ChefDeProjet = chef;
     this.PenaliteOuiNon = cp;
 }
        // constructeurs

        public ProjetForfait(int code, string nomprojet, DateTime debut, DateTime fin, Client cli,
         string contact, string mailcontact, decimal mtc, Penalite cp, Collaborateur chef): base(code, nomprojet,  debut,  fin,  cli, contact,  mailcontact)
        {
            this.MontantContrat = mtc;
            this.ChefDeProjet = chef;
            this.PenaliteOuiNon = cp;
            this.previsions = new List<Prevision>();
        }
예제 #3
0
        public Projet(string nomprojet, DateTime debut, DateTime fin, Client cli,
        string contact, string mailcontact)
        {
            this.NomProjet = nomprojet;
            this.DDebut = debut;
            this.DFin = fin;
            this.LeClient = cli;
            this.Contact = contact;
            this.MailContact = mailcontact;

        }
 public ProjetRegie(string nomprojet, DateTime debut, DateTime fin, Client cli,
  string contact, string mailcontact, decimal tj, Qualification q) : base( nomprojet, debut, fin, cli, contact, mailcontact)
 {
     this.TarifJournalier = tj;
     this.Qualification = q;
 }
        public static List<Client> GetAllClients()
        {
            List<Client> Clients = new List<Client>();
            // création connection
            using (SqlConnection sqlConnect = GetConnection())
            {
                using (SqlCommand sqlCde = new SqlCommand())
                {
                    //initialiser la connection de la commande
                    sqlCde.Connection = sqlConnect;
                    // chargement des qualifications
                    String strSql = "Select idClient, raisonsociale , adresse1, adresse2,cp, ville, telephone,mail from dbo.Client";
                    sqlCde.CommandText = strSql;

                    // Exécution de la commande
                    try
                    {
                        SqlDataReader sqlRdr = sqlCde.ExecuteReader();
                        while (sqlRdr.Read())
                        {
                            // non utilisé : pour les string on preferera sqlRdr[3].ToString() qui évite de tester le null
                            //string adr = String.Empty;
                            //if (!sqlRdr.IsDBNull(3)) adr = sqlRdr.GetString(3);
                            // idem pour le mail
                            Client oClient = new Client(sqlRdr.GetInt32(0), sqlRdr.GetString(1), sqlRdr.GetString(2), sqlRdr[3].ToString(), sqlRdr.GetString(4), sqlRdr.GetString(5), sqlRdr.GetString(6), sqlRdr[7].ToString());
                            Clients.Add(oClient);
                        }
                        sqlRdr.Close();
                        return Clients;
                    }
                    catch (SqlException se)
                    {
                        throw new DaoExceptionFinAppli("Lecture des clients impossible, l'application va se fermer: \n" + se.Message, se);
                    }
                }
            }
        }