private void Button_Click(object sender, RoutedEventArgs e) { Context context = new Context(); try { bool check = Requests.MethodsOrder.CheckLabel(context, int.Parse(LabelTable.Text)); if (check == true) { try { Entities.Table t = Requests.MethodsOrder.GetTableByLabel(context, int.Parse(LabelTable.Text)); YourOrder yo = new YourOrder(t.TableID); yo.Show(); this.Close(); } catch (Exception ex) { MessageBox.Show("Проверьте правильность ввода номера."); } } else { MessageBox.Show("Стола с таким номером не существует."); } } catch (Exception ex) { MessageBox.Show("Введите данные."); } }
public UpdatingTables(int label) { InitializeComponent(); tablel = label; InitializeComponent(); table = Requests.MethodsOrder.GetTableByLabel(context, tablel); id.Text = (table.TableID).ToString(); location.Text = (table.TableLocation).ToString(); places.Text = (table.TablePlaces).ToString(); }
private void Call_Click(object sender, RoutedEventArgs e) { Context context = new Context(); bool check = Requests.MethodsOrder.CheckLabel(context, int.Parse(LabelTable.Text)); if (check == true) { Entities.Table t = Requests.MethodsOrder.GetTableByLabel(context, int.Parse(LabelTable.Text)); YourOrder yo = new YourOrder(t.TableID); yo.Show(); this.Close(); } else { MessageBox.Show("Стола с таким номером не существует."); } }
private void add_Click(object sender, RoutedEventArgs e) { Context context = new Context(); Entities.Table table = new Entities.Table(); try { table.TableLabel = int.Parse(id.Text); table.TableLocation = location.Text; table.TablePlaces = int.Parse(places.Text); Requests.MethodsAdmininstrator.InsertTable(context, table); id.Text = ""; location.Text = ""; places.Text = ""; } catch (Exception ex){ MessageBox.Show("Проверьте правильность ввода данных."); } }
private void add_Click(object sender, RoutedEventArgs e) { Context context = new Context(); Entities.Table table = new Entities.Table(); try { table.TableLabel = int.Parse(id.Text); table.TableLocation = location.Text; table.TablePlaces = int.Parse(places.Text); Requests.MethodsAdmininstrator.InsertTable(context, table); id.Text = ""; location.Text = ""; places.Text = ""; } catch (Exception ex) { MessageBox.Show("Проверьте правильность ввода данных."); } }
public List <Entities.Table> GetAllTables() { List <Entities.Table> listTables = new List <Entities.Table>(); using (TeamProjectEntities6 entities = new TeamProjectEntities6()) { var tables = from r in entities.Table select r; foreach (Table singleTable in tables) { Entities.Table t = new Entities.Table(); t.TableID = singleTable.id; t.TableLabel = int.Parse(singleTable.label_Table); t.TableLocation = singleTable.location_Table; t.TablePlaces = (int)singleTable.places_Table; listTables.Add(t); } } return(listTables); }
public List<Entities.Table> GetAllTables() { List<Entities.Table> listTables = new List<Entities.Table>(); using (TeamProjectEntities6 entities = new TeamProjectEntities6()) { var tables = from r in entities.Table select r; foreach (Table singleTable in tables) { Entities.Table t = new Entities.Table(); t.TableID = singleTable.id; t.TableLabel = int.Parse(singleTable.label_Table); t.TableLocation = singleTable.location_Table; t.TablePlaces = (int)singleTable.places_Table; listTables.Add(t); } } return listTables; }