public override int create(CPays obj) { OracleCommand req = new OracleCommand(); req.Connection = _connex; req.CommandText = "insert into pays (id, nom) values (:id, :nom)"; int id = (int)CSequence.getNextValue("PAYS", base._connex.ConnectionString); OracleParameter pId = new OracleParameter("id", id); OracleParameter pNom = new OracleParameter("nom", obj.Nom); req.Parameters.Add(pId); req.Parameters.Add(pNom); req.ExecuteNonQuery(); return(id); }
public override int create(CVille obj) { OracleCommand req = new OracleCommand(); req.Connection = _connex; req.CommandText = "insert into ville (code_postal, nom, numero_departement) values (:code_postal, :nom, :numero_departement)"; int code_postal = (int)CSequence.getNextValue("VILLE", base._connex.ConnectionString); OracleParameter pCode_Postal = new OracleParameter("code_postal", code_postal); OracleParameter pNom = new OracleParameter("nom", obj.Nom); OracleParameter pNumero_Departement = new OracleParameter("numero_departement", obj.Numero_Departement); req.Parameters.Add(pCode_Postal); req.Parameters.Add(pNom); req.Parameters.Add(pNumero_Departement); req.ExecuteNonQuery(); return(code_postal); }
public override int create(CDepartement obj) { OracleCommand req = new OracleCommand(); req.Connection = _connex; req.CommandText = "insert into departement (numero, nom, id_region) values (:numero, :nom, :id_region)"; int numero = (int)CSequence.getNextValue("DEPARTEMENT", base._connex.ConnectionString); OracleParameter pId = new OracleParameter("numero", numero); OracleParameter pNom = new OracleParameter("nom", obj.Nom); OracleParameter pId_Region = new OracleParameter("id_region", obj.Id_Region); req.Parameters.Add(pId); req.Parameters.Add(pNom); req.Parameters.Add(pId_Region); req.ExecuteNonQuery(); return(numero); }
public override int create(CRubrique obj) { OracleCommand req = new OracleCommand(); req.Connection = _connex; req.CommandText = "INSERT INTO RUBRIQUE (id, nom, description, id_parent) values (:id, :nom, :description, :id_parent)"; int id = (int)CSequence.getNextValue("RUBRIQUE", base._connex.ConnectionString); OracleParameter pId = new OracleParameter("id", id); OracleParameter pNom = new OracleParameter("nom", obj.Nom); OracleParameter pDesc = new OracleParameter("description", obj.Description); OracleParameter pIdParent = new OracleParameter("id_parent", obj.IDParent); req.Parameters.Add(pId); req.Parameters.Add(pNom); req.Parameters.Add(pDesc); req.Parameters.Add(pIdParent); req.ExecuteNonQuery(); return(id); }