public void BookingSeats(Seance seance, ArrayList numbers)
        {
            string myContent = JsonConvert.SerializeObject(new
            {
                seanceId      = (string)seance.GetId().ToString(),
                reservedSeats = numbers,
            });

            DialogMessage.ShowInfo("Post: " + myContent);
            var content = new StringContent(myContent, Encoding.UTF8, "application/json");

            HttpClient client = AdressList.GetHttpClient();

            AdminAuthorization.SetAuthorization(client);
            HttpResponseMessage response = client.PostAsync(AdressList.Booking, content).Result;

            if (response.StatusCode == HttpStatusCode.Created)
            {
                NotifitactionForm.ShowMessage("Wysłany element: " + "Rezerwacja");
            }
            else
            {
                DialogMessage.ShowInfo("Błąd wysyłania elementu: " + "Rezerwacja");
            }
        }
Пример #2
0
        public void UpdateSeance(Seance val)
        {
            string sql = string.Format(
                "UPDATE cinema_admin.seance_schedule SET film_id=\"{0}\",room_id=\"{1}\",seance_date=\"{2}\" WHERE id=\"{3}\";",
                val.Film.Id,
                val.Room.Id,
                val.SeanceDate.ToString(CultureInfo.InvariantCulture.DateTimeFormat.SortableDateTimePattern),
                val.GetId()
                );

            ExSql(sql);
        }
Пример #3
0
 public static void Delete(Seance seance)
 {
     DeleteMethod(AdressList.SeancesAdmin, seance.GetId(), "Seans");
 }
Пример #4
0
        public void RemoveSeance(Seance val)
        {
            string sql = string.Format("DELETE FROM seance_schedule WHERE id = \"{0}\" LIMIT 3;", val.GetId());

            ExSql(sql);
        }