public bool responseWaiters(int tableID) { profileDataContext myContext = new profileDataContext(); restaurantTable rTable = new restaurantTable(); // Query the database for the row to be updated. var query = from tord in myContext.restaurantTables where tord.tableID == tableID select tord; // Execute the query, and change the column values // you want to change. foreach (restaurantTable tord in query) { tord.callWaiter = false; // 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); }
public bool setMenu(Int32 id, String name) { profileDataContext myContext = new profileDataContext(); menu m = new menu(); m.menuID = id; //float.Parse(latitude, System.Globalization.CultureInfo.InvariantCulture); m.menuName = name; //float.Parse(longitude, System.Globalization.CultureInfo.InvariantCulture); myContext.menus.InsertOnSubmit(m); myContext.SubmitChanges(); return(true); }
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); }