public PositionObstacle SelectById(int idPositionObstacle) { DataRow UneDataRow = _DBAL.SelectById("PositionObstacle", idPositionObstacle); PositionObstacle unePositionObstacle = new PositionObstacle((int)UneDataRow["idPositionObstacle"], (Obstacle)UneDataRow["nomObstacle"], (Reservation)UneDataRow["idReservation"], (int)UneDataRow["PositionObstacle"]); return(unePositionObstacle); }
public List <PositionObstacle> SelectAll() { List <PositionObstacle> uneListePositionObstacle = new List <PositionObstacle>(); DataTable uneDataTable = _DBAL.SelectAll("PositionObstacle"); foreach (DataRow dtr in uneDataTable.Rows) { PositionObstacle unePositionObstacle = new PositionObstacle((int)dtr["idPositionObstacle"], (Obstacle)dtr["nomObstacle"], (Reservation)dtr["idReservation"], (int)dtr["positionObstacle"]); uneListePositionObstacle.Add(unePositionObstacle); } return(uneListePositionObstacle); }
public void InsertByFile(string chemin) { using (var reader = new StreamReader(chemin)) using (var csv = new CsvReader(reader, CultureInfo.InvariantCulture)) { csv.Configuration.Delimiter = ";"; csv.Configuration.PrepareHeaderForMatch = (string header, int index) => header.ToLower(); //var records = csv.GetRecords<Pays>(); var record = new PositionObstacle(); var records = csv.EnumerateRecords(record); foreach (var item in records) { this.Insert(item); } } }
public void Delete(PositionObstacle unePositionObstacle) { _DBAL.Delete(" PositionObstacle WHERE idPositionObstacle = '" + unePositionObstacle.IdPositionObstacle + "' ;"); }
public void Update(PositionObstacle unePositionObstacle) { _DBAL.Update(" PositionObstacle SET idPositionObstacle = " + unePositionObstacle.IdPositionObstacle + ",nomObstacle = '" + unePositionObstacle.NomObstacle + "', idReservation = " + unePositionObstacle.IdReservation + " , positionObstacle = " + unePositionObstacle.Position + " WHERE nomObstacle = '" + unePositionObstacle.NomObstacle + "';"); }
public void Insert(PositionObstacle unePositionObstacle) { _DBAL.Insert(" PositionObstacle values ('" + unePositionObstacle.IdPositionObstacle + "','" + unePositionObstacle.NomObstacle + "', " + unePositionObstacle.IdReservation + "," + unePositionObstacle.Position + ");"); }