private Frais GetAllFrais(IDataReader rd) { Frais fr = new Frais(); fr.Id = Convert.ToInt32(rd["Id"].ToString()); fr.Designation = rd["Designation"].ToString(); return(fr); }
public void Enregistrer(Frais fr) { if (ImplementeConnexion.Instance.Conn.State == ConnectionState.Closed) { ImplementeConnexion.Instance.Conn.Open(); } using (IDbCommand cmd = ImplementeConnexion.Instance.Conn.CreateCommand()) { cmd.CommandText = "INSERT_TYPE_FRAIS"; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@id", 4, DbType.Int32, Id)); cmd.Parameters.Add(Parametre.Instance.AjouterParametre(cmd, "@designation", 30, DbType.String, Designation)); cmd.ExecuteNonQuery(); MessageBox.Show("Enregistrement reussie", "Save", MessageBoxButtons.OK, MessageBoxIcon.Information); } }