示例#1
0
        public projet get_Projet(int id)

        {
            projet monprojet = CprojBdd.projets.Find(id);

            return(monprojet);
        }
示例#2
0
        public bool ProjetExiste(string description)
        {
            projet myproj = CprojBdd.projets.FirstOrDefault(p => p.libelle == description);

            if (myproj == null)
            {
                return(false);
            }
            return(true);
        }
示例#3
0
        public void ModifierProjet(int id_projet, string libelle, string description, string type_du_projet, decimal montant_attendu, System.DateTime date_debut, System.DateTime date_butoir)
        {
            projet projetTrouve = CprojBdd.projets.FirstOrDefault(projet => projet.id_projet == id_projet);

            if (projetTrouve != null)
            {
                projetTrouve.libelle         = libelle;
                projetTrouve.description     = description;
                projetTrouve.type_du_projet  = type_du_projet;
                projetTrouve.montant_attendu = montant_attendu;
                projetTrouve.date_debut      = date_debut;
                projetTrouve.date_butoir     = date_butoir;
            }
        }
示例#4
0
        public int CreerProjet(string libelle, string description, string type_du_projet, decimal montant_attendu, System.DateTime date_debut, System.DateTime date_butoir, string resp_projet)
        {
            portefeuille_projet PortefeuilleP = CprojBdd.portefeuille_projet.FirstOrDefault
                                                    (P => P.resp_projet == resp_projet && P.libelle == "Defaut");

            projet myprojet = new projet()
            {
                libelle          = libelle,
                description      = description,
                type_du_projet   = type_du_projet,
                montant_attendu  = montant_attendu,
                montant_collecte = 0.0M,
                date_debut       = date_debut,
                etat_projet      = "C",
                id_portefeuille  = PortefeuilleP.id_portefeuille,
                date_butoir      = date_butoir
            };

            CprojBdd.projets.Add(myprojet);

            CprojBdd.SaveChanges();

            return(myprojet.id_projet);
        }