コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
                    }
                }
        }
コード例 #4
0
 public void Delete(PositionObstacle unePositionObstacle)
 {
     _DBAL.Delete(" PositionObstacle WHERE idPositionObstacle = '" + unePositionObstacle.IdPositionObstacle + "' ;");
 }
コード例 #5
0
 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 + "';");
 }
コード例 #6
0
 public void Insert(PositionObstacle unePositionObstacle)
 {
     _DBAL.Insert(" PositionObstacle values ('" + unePositionObstacle.IdPositionObstacle + "','" + unePositionObstacle.NomObstacle + "', " + unePositionObstacle.IdReservation + "," + unePositionObstacle.Position + ");");
 }