Exemplo n.º 1
0
 public IHttpActionResult Post(RoyalCancunAPI.Models.Request.Reservation r)
 {
     try
     {
         MySQLController my     = new MySQLController();
         string          cadena = my.geUserReservations(r.idUser);
         return(Ok(cadena));
     }
     catch (Exception e)
     {
         return(Ok(e));
     }
 }
Exemplo n.º 2
0
        public IHttpActionResult Post()
        {
            try
            {
                MySQLController my     = new MySQLController();
                string          cadena = my.testConnection();

                return(Ok(cadena));
            }
            catch (Exception e)
            {
                return(Ok(e));
            }
        }
Exemplo n.º 3
0
        public IHttpActionResult Post(RoyalCancunAPI.Models.Request.Reservation r)
        {
            try
            {
                MySQLController my     = new MySQLController();
                string          cadena = "";
                cadena = my.changeReservation(r.idRoom, r.idUser, r.idReservation, r.startDate, r.endDate);

                return(Ok(cadena));
            }
            catch (Exception e)
            {
                return(Ok(e));
            }
        }
Exemplo n.º 4
0
        public IHttpActionResult Post(RoyalCancunAPI.Models.Request.User u)
        {
            try
            {
                MySQLController my     = new MySQLController();
                string          cadena = "";
                cadena = my.createUser(u.userName, u.name, u.lastName, u.pw);

                return(Ok(cadena));
            }
            catch (Exception e)
            {
                return(Ok(e));
            }
        }
 public IHttpActionResult Post(RoyalCancunAPI.Models.Request.Reservation r)
 {
     try
     {
         MySQLController my     = new MySQLController();
         string          cadena = "";
         foreach (string date in my.getOcupiedDates(r.idReservation, r.startDate))
         {
             cadena += date + ",";
         }
         cadena = cadena.Remove(cadena.Length - 1, 1);
         return(Ok(cadena));
     }
     catch (Exception e)
     {
         return(Ok(e));
     }
 }