Exemple #1
0
        public bool takeReceipt(int tableID)
        {
            profileDataContext myContext = new profileDataContext();

            tableOrder tOrder = new tableOrder();

            if (getTableOrder(tableID) != null)
            {
                // Query the database for the row to be updated.
                var query =
                    from tord in myContext.tableOrders
                    where tord.tableID == tableID
                    select tord;

                // Execute the query, and change the column values
                // you want to change.
                foreach (tableOrder tord in query)
                {
                    tord.isPaid = true;
                    // Insert any additional changes to column values.
                }

                // Submit the changes to the database.
                try
                {
                    myContext.SubmitChanges();
                    return(true);
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                    // Provide for exceptions.
                    return(false);
                }
            }
            return(false);
        }
Exemple #2
0
 private void detach_tableOrders(tableOrder entity)
 {
     this.SendPropertyChanging();
     entity.restaurantTable = null;
 }
Exemple #3
0
 partial void DeletetableOrder(tableOrder instance);
Exemple #4
0
 partial void UpdatetableOrder(tableOrder instance);
Exemple #5
0
 partial void InserttableOrder(tableOrder instance);