public int CreerPortefeuilleProj(string resp_proj, string libelle) { portefeuille_projet portefeuille = new portefeuille_projet() { resp_projet = resp_proj, libelle = libelle, }; CprojBdd.portefeuille_projet.Add(portefeuille); CprojBdd.SaveChanges(); return(portefeuille.id_portefeuille); }
public void TestCreatePortefeuille(string resp_projet, string libelle, string niveau_habilitation, short Id_association) { resp_projet testResp = TestCreateResponsableP(resp_projet); if (testResp == null) { CreerRespProj(resp_projet, niveau_habilitation, Id_association); } portefeuille_projet portefeuilleTrouve = CprojBdd.portefeuille_projet.FirstOrDefault(portefeuille => portefeuille.libelle == libelle); if (portefeuilleTrouve == null) { CreerPortefeuilleProj(resp_projet, libelle); } /*if (portefeuilleTrouve != null) * * ComboxPortefeuille.SelectedIndex = ComboxPortefeuille.FindStringExact("Portefeuille Ecotourisme"); * return ComboxPortefeuille.SelectedIndex;*/ }
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); }