public static void UpdateFeuilleDeTemps(T_FeuilleDeTemps p_fdt) { CoEco_BDDataContext BD = new CoEco_BDDataContext(); T_FeuilleDeTemps newFdt = BD.T_FeuilleDeTemps.Single(p => p.idFeuilleDeTemps == p_fdt.idFeuilleDeTemps); newFdt.idFeuilleDeTemps = p_fdt.idFeuilleDeTemps; newFdt.idEmp = p_fdt.idEmp; newFdt.idCategorie = p_fdt.idCategorie; newFdt.dimanche = p_fdt.dimanche; newFdt.lundi = p_fdt.lundi; newFdt.mardi = p_fdt.mardi; newFdt.mercredi = p_fdt.mercredi; newFdt.jeudi = p_fdt.jeudi; newFdt.vendredi = p_fdt.vendredi; newFdt.samedi = p_fdt.samedi; newFdt.commentaireDimanche = p_fdt.commentaireDimanche; newFdt.commentaireLundi = p_fdt.commentaireLundi; newFdt.commentaireMardi = p_fdt.commentaireMardi; newFdt.commentaireMercredi = p_fdt.commentaireMercredi; newFdt.commentaireJeudi = p_fdt.commentaireJeudi; newFdt.commentaireVendredi = p_fdt.commentaireVendredi; newFdt.commentaireSamedi = p_fdt.commentaireSamedi; newFdt.approbation = p_fdt.approbation; BD.SubmitChanges(); BD.Dispose(); }
public static void AjouterDepKilometrage(T_Kilometrage km) { CoEco_BDDataContext bd = new CoEco_BDDataContext(); bd.T_Kilometrage.InsertOnSubmit(km); bd.SubmitChanges(); bd.Dispose(); }
public static void AddDepense(T_Depense p_newDep) { CoEco_BDDataContext bd = new CoEco_BDDataContext(); bd.T_Depense.InsertOnSubmit(p_newDep); bd.SubmitChanges(); bd.Dispose(); }
public static void ChangeStatusCategorie(int id, int etat) { CoEco_BDDataContext bd = new CoEco_BDDataContext(); T_CategoriePro cat = bd.T_CategoriePro.Single(f => f.idCategorie == id); cat.idStatusCat = etat; bd.SubmitChanges(); bd.Dispose(); }
public static void ApprouverKilometrageById(int id, bool etat) { CoEco_BDDataContext bd = new CoEco_BDDataContext(); T_Kilometrage kilo = bd.T_Kilometrage.Single(f => f.idKilo == id); kilo.approbation = etat; bd.SubmitChanges(); bd.Dispose(); }
public static void ApprouverDepenseByID(int id, bool etat) { CoEco_BDDataContext bd = new CoEco_BDDataContext(); T_Depense dep = bd.T_Depense.Single(f => f.idDepense == id); dep.aprobation = etat; bd.SubmitChanges(); bd.Dispose(); }
/// <summary> /// Ajoute un nouveau taux /// </summary> /// <param name="newTaux">nouveau taux</param> /// <param name="type">1 = Auto, 2 = Camion</param> public static void AddTauxKilo(float newTaux, int type) { T_TauxKilo tauxKilo = new T_TauxKilo(); tauxKilo.taux = newTaux; tauxKilo.ddate = DateTime.Today; tauxKilo.idTypeAuto = type; CoEco_BDDataContext bd = new CoEco_BDDataContext(); bd.T_TauxKilo.InsertOnSubmit(tauxKilo); bd.SubmitChanges(); bd.Dispose(); }
public static void UpdateDepense(T_Depense depense) { CoEco_BDDataContext bd = new CoEco_BDDataContext(); T_Depense depenseToMod = bd.T_Depense.Single(p => p.idDepense == depense.idDepense); depenseToMod.idProjet = depense.idProjet; //depenseToMod.idCategorie = depense.idCategorie; depenseToMod.idType = depense.idType; depenseToMod.descript = depense.descript; depenseToMod.montant = depense.montant; depenseToMod.ddate = depense.ddate; depenseToMod.idEmp = depenseToMod.idEmp; depenseToMod.aprobation = depense.aprobation; bd.SubmitChanges(); bd.Dispose(); }
public static void UpdateProjet(T_Projet p_projet) { CoEco_BDDataContext BD = new CoEco_BDDataContext(); T_Projet newProjet = BD.T_Projet.Single(p => p.idProjet == p_projet.idProjet); newProjet.nom = p_projet.nom; newProjet.idStatus = p_projet.idStatus; newProjet.heureAlloue = p_projet.heureAlloue; newProjet.responsable = p_projet.responsable; newProjet.descript = p_projet.descript; newProjet.dateDebut = p_projet.dateDebut; newProjet.dateFin = p_projet.dateFin; BD.SubmitChanges(); BD.Dispose(); }
public static void CreateNewProjet(T_Projet p_projet) { CoEco_BDDataContext BD = new CoEco_BDDataContext(); int?maxID = 0; BD.PS_GetMaxIdProjet(ref maxID); maxID++; if (maxID == null) { maxID = 1; } p_projet.idProjet = (int)maxID; BD.T_Projet.InsertOnSubmit(p_projet); BD.SubmitChanges(); BD.Dispose(); }
public static void UpdateKilometrage(T_Kilometrage newkilo) { CoEco_BDDataContext bd = new CoEco_BDDataContext(); T_Kilometrage oldkilo = bd.T_Kilometrage.Single(o => o.idKilo == newkilo.idKilo); //oldkilo.idKilo = newkilo.idTaux; oldkilo.nbKilo = newkilo.nbKilo; oldkilo.commentaire = newkilo.commentaire; oldkilo.ddate = newkilo.ddate; oldkilo.approbation = newkilo.approbation; oldkilo.idTaux = newkilo.idTaux; oldkilo.idEmp = newkilo.idEmp; oldkilo.idPro = newkilo.idPro; bd.SubmitChanges(); bd.Dispose(); }
public static void CreateNewEmploye(T_Employe p_employe) { CoEco_BDDataContext BD = new CoEco_BDDataContext(); int?maxID = 0; BD.PS_GetMaxIdEmpolye(ref maxID); maxID++; if (maxID == null) { maxID = 1; } p_employe.idEmploye = (int)maxID; BD.T_Employe.InsertOnSubmit(p_employe); BD.SubmitChanges(); BD.Dispose(); }
public static void CreateNewFeuilleDeTemps(T_FeuilleDeTemps p_feuilleDeTemps) { CoEco_BDDataContext BD = new CoEco_BDDataContext(); int?maxID = 0; BD.PS_GetMaxIdFeuilleTemps(ref maxID); maxID++; if (maxID == null) { maxID = 1; } p_feuilleDeTemps.idFeuilleDeTemps = (int)maxID; BD.T_FeuilleDeTemps.InsertOnSubmit(p_feuilleDeTemps); BD.SubmitChanges(); BD.Dispose(); }
public static void CreateNewCategorie(T_CategoriePro p_categorie) { CoEco_BDDataContext BD = new CoEco_BDDataContext(); int?maxID = 0; BD.PS_GetMaxIdCategorie(ref maxID); maxID++; if (maxID == null) { maxID = 1; } p_categorie.idCategorie = (int)maxID; BD.T_CategoriePro.InsertOnSubmit(p_categorie); BD.SubmitChanges(); BD.Dispose(); }
public static void CreateNewEmpAtProject(T_EmployeProjet p_emp) { CoEco_BDDataContext BD = new CoEco_BDDataContext(); int?maxID = 0; BD.PS_GetMaxIdEmpPro(ref maxID); maxID++; if (maxID == null) { maxID = 1; } p_emp.idEmpPro = (int)maxID; BD.T_EmployeProjet.InsertOnSubmit(p_emp); BD.SubmitChanges(); //Si ce bug survient, c'est qu'il n'y a pas pas de projet #3... a changer dans AjouterEmp.aspx.cs BD.Dispose(); }
public static void UpdateEmploye(T_Employe p_employe) { CoEco_BDDataContext BD = new CoEco_BDDataContext(); T_Employe newEmp = BD.T_Employe.Single(e => e.idEmploye == p_employe.idEmploye); newEmp.prenom = p_employe.prenom; newEmp.nom = p_employe.nom; newEmp.courriel = p_employe.courriel; newEmp.mdp = p_employe.mdp; newEmp.idFonction = p_employe.idFonction; newEmp.idStatus = p_employe.idStatus; newEmp.loginName = p_employe.loginName; newEmp.congesFeries = p_employe.congesFeries; newEmp.congesMaladie = p_employe.congesMaladie; newEmp.congesPersonnels = p_employe.congesPersonnels; newEmp.heuresAccumuleesOuSansSolde = p_employe.heuresAccumuleesOuSansSolde; newEmp.vacances = p_employe.vacances; BD.SubmitChanges(); BD.Dispose(); }