Пример #1
0
        private void BNaarOrder_Click(object sender, EventArgs e)
        {
            Restaurant r = new Restaurant();

            r = rc.GetRestaurantByID(Convert.ToInt32(LRestaurantIDOutputReserveringen.Text));
            LGerechtenRestaurantOutputNaam.Text    = LBReserveringen.Text;
            LGerechtenRestaurantOutputNaam.Visible = true;
            TCOrdirect.SelectTab(2);
            List <Gerecht> Gerechten = new List <Gerecht>();

            Gerechten = gc.GetAllGerechtenFromRestaurantID(Convert.ToInt32(LGerechtenRestaurantOutputNaam.Text.Split(' ')[0]));
            foreach (Gerecht gerecht in Gerechten)
            {
                LBGerechten.Items.Add(gerecht.GerechtID + " " + gerecht.Naam);
            }
            DateTime dt           = Convert.ToDateTime(LGerechtenRestaurantOutputNaam.Text.Split(' ').Last() + ".000");
            string   dtp          = Convert.ToString(dt.Year) + "-" + Convert.ToString(dt.Month) + "-" + Convert.ToString(dt.Day) + " " + dt.Hour + ":" + dt.Minute;
            int      RestaurantID = Convert.ToInt32(LGerechtenRestaurantOutputNaam.Text.Split(' ')[0]);
            int      AccountID    = Convert.ToInt32(ac.GetAccountByEmail(LNaamOutput.Text).AccountID);

            LReserveringNummerGerechten.Text = LReserveringNummerOutputReserveringen.Text;
        }
Пример #2
0
        private void BReserveer_Click(object sender, EventArgs e)
        {
            string     Email          = LNaamOutput.Text;
            string     RestaurantName = LBRestaurants.Text.ToString();
            string     Date           = DTPDate.Value.ToShortDateString();
            string     Time           = DTPTime.Value.ToShortTimeString();
            string     datetime       = Date + " " + Time + ":00";
            DateTime   dateTime       = Convert.ToDateTime(datetime);
            Restaurant r = rc.GetRestaurantByName(RestaurantName);
            Account    a = ac.GetAccountByEmail(Email);

            if (rvc.CreateReservering(dateTime, r.RestaurantID, a.AccountID) == true)
            {
                LVerificatie.Text    = "Reservering Aangemaakt";
                LVerificatie.Visible = true;
            }
            else
            {
                LVerificatie.Text    = "Reservering Mislukt :(";
                LVerificatie.Visible = true;
            }
            TCOrdirect.SelectTab(1);
            LoadReserveringenFromUser(LNaamOutput.Text);
        }