Example #1
0
        public IHttpActionResult SearchFlight([FromBody] string search_params)
        {
            System.Diagnostics.Debug.WriteLine(search_params);
            string query_result = CustomerSQLHandler.FindFlight(JsonConvert.DeserializeObject <Flight>(search_params));

            return(Ok(query_result));
        }
Example #2
0
        public IHttpActionResult PayFlight([FromBody] string paym_det, [FromUri] string user)
        {
            CCard  card   = JsonConvert.DeserializeObject <CCard>(paym_det);
            string result = CustomerSQLHandler.PayFlight(card.card_number, card.security_code, user);

            return(Ok(result));
        }
Example #3
0
 public IHttpActionResult CheckStudent([FromUri] string username)
 {
     if (CustomerSQLHandler.IsStudent(username))
     {
         return(Ok(JSONHandler.BuildMsgJSON(1, "True")));
     }
     else
     {
         return(Ok(JSONHandler.BuildMsgJSON(1, "False")));
     }
 }
Example #4
0
        public IHttpActionResult AddPaymentMethod([FromBody] string card_details)
        {
            int query_result = CustomerSQLHandler.AddCreditCard(JsonConvert.DeserializeObject <CCard>(card_details));

            if (query_result == 1)
            {
                return(Ok(JSONHandler.BuildMsgJSON(1, "Success")));
            }
            else
            {
                return(CheckQueryResult(500, String.Empty));
            }
        }
Example #5
0
        public IHttpActionResult GetFlightDetails([FromUri] string flight)
        {
            string result = CustomerSQLHandler.GetFlightDetails(flight);

            return(Ok(result));
        }
Example #6
0
        public IHttpActionResult GetUserCards([FromUri] string username)
        {
            string cards_json = CustomerSQLHandler.GetCards(username);

            return(Ok(cards_json));
        }
Example #7
0
        public IHttpActionResult GetReservationCost([FromBody] string reservation)
        {
            Tuple <int, string> cost = CustomerSQLHandler.GetReservationCost(JsonConvert.DeserializeObject <Reservation>(reservation));

            return(Ok(cost.Item2));
        }
Example #8
0
        public IHttpActionResult BookFlight([FromBody] string book_det)
        {
            string query_result = CustomerSQLHandler.BookFlight(JsonConvert.DeserializeObject <Reservation>(book_det));

            return(Ok(query_result));
        }
Example #9
0
 public IHttpActionResult GetSales()
 {
     return(Ok(CustomerSQLHandler.GetFlightSales()));
 }
Example #10
0
        public IHttpActionResult PreCheckCustomer([FromUri] string user, [FromUri] string flight)
        {
            string query_result = CustomerSQLHandler.PreCheckCustomer(user, flight);

            return(Ok(query_result));
        }
Example #11
0
        public IHttpActionResult GetUniversities()
        {
            string result = CustomerSQLHandler.GetUniversities();

            return(Ok(result));
        }
Example #12
0
        public IHttpActionResult CustomerLogin([FromBody] string usr_credentials)
        {
            int query_result = CustomerSQLHandler.LoginCustomer(JsonConvert.DeserializeObject <Customer>(usr_credentials));

            return(CheckQueryResult(query_result, JSONHandler.BuildMsgJSON(1, "Login successful")));
        }
Example #13
0
        public IHttpActionResult GetUserFlights([FromUri] string user)
        {
            string result = CustomerSQLHandler.GetUserFlights(user);

            return(Ok(result));
        }