Ejemplo n.º 1
0
        private void btnReserve_Click(object sender, RoutedEventArgs e)
        {
            Stand currentStand = (Stand)this.listBoxStaende.SelectedItem;

            currentStand.name = this.txtNameReserve.Text;
            this.db.updateStand(currentStand);
            this.refresh();
        }
Ejemplo n.º 2
0
        public void updateStand(Stand stand)
        {
            List <Stand>  staende = new List <Stand>();
            OracleCommand cmd     = new OracleCommand();

            cmd.CommandText = "UPDATE stand SET name = '" + stand.name + "' WHERE nr = " + stand.nr;
            cmd.Connection  = conn;
            cmd.ExecuteNonQuery();
        }
Ejemplo n.º 3
0
        public List <Stand> selectStaendeUmkreis(Stand stand, int radius)
        {
            List <Stand> listStaende = new List <Stand>();

            OracleCommand cmd = new OracleCommand();

            cmd.CommandText = "select nr, name from stand WHERE SDO_WITHIN_DISTANCE(stand.position,SDO_GEOMETRY(2001,NULL,SDO_POINT_TYPE(" + stand.position.X + ", " + stand.position.Y + ", NULL),NULL,NULL),'distance= " + radius + "') = 'TRUE'";

            cmd.Connection = conn;
            OracleDataReader dr = cmd.ExecuteReader();

            if (dr.HasRows)
            {
                while (dr.Read())
                {
                    listStaende.Add(new Stand(Convert.ToInt32(dr["nr"]), new Point(0, 0), Convert.ToString(dr["name"])));
                }
            }
            return(listStaende);
        }