public void SaveMAJ(Facture facture) { Facture factureAModifier = DFacture.Find(facture.Id); try { factureAModifier.DatePaiement = facture.DatePaiement; factureAModifier.CodeModePaiement = facture.CodeModePaiement; SaveChanges(); } catch (Exception) { throw; } }
public static Guid AddFacture(Facture facture) { try { using (SqlConnection cnx = DALAccess.GetConnection()) { SqlCommand command = cnx.CreateCommand(); command.CommandType = System.Data.CommandType.Text; command.CommandText = "EXEC ajout_facture @DateFact, @nomVeto, @nomanimal, @dateConsultation, @etat"; command.Parameters.AddWithValue("@DateFact", facture.dateFacture); command.Parameters.AddWithValue("@nomVeto", facture.nomVeto); command.Parameters.AddWithValue("@nomanimal", facture.nomAnimal); command.Parameters.AddWithValue("@dateConsultation", facture.dateConsult); command.Parameters.AddWithValue("@etat", facture.etat); Guid dResult = (Guid)command.ExecuteScalar(); return(dResult); } } catch (Exception ex) { throw new ApplicationException("Erreur : " + ex.Message); } }
public static void EnregistrerMAJ(Facture facture) { DonneesClient.Instance.SaveMAJ(facture); }
public static void EnregistrerFacture(Facture nouvelleFacture) { DonneesClient.Instance.SaveFacture(nouvelleFacture); }