Ejemplo n.º 1
0
        private void Order_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'restorantDataSet.items' table. You can move, or remove it, as needed.
            this.itemsTableAdapter.Fill(this.restorantDataSet.items);
            // TODO: This line of code loads data into the 'restorantDataSet.sources' table. You can move, or remove it, as needed.
            this.sourcesTableAdapter.Fill(this.restorantDataSet.sources);
            // TODO: This line of code loads data into the 'restorantDataSet.abonent' table. You can move, or remove it, as needed.
            this.abonentTableAdapter.Fill(this.restorantDataSet.abonent);
            // TODO: This line of code loads data into the 'restorantDataSet.waiters' table. You can move, or remove it, as needed.
            this.waitersTableAdapter.Fill(this.restorantDataSet.waiters);
            // TODO: This line of code loads data into the 'restorantDataSet.details' table. You can move, or remove it, as needed.
            this.detailsTableAdapter.Fill(this.restorantDataSet.details);


            this.orderTableAdapter.Fill(this.restorantDataSet.order);
            if (order == null)
            {
                order            = restorantDataSet.order.NeworderRow();
                order.abonent_id = 1;
                order.waiter_id  = 1;
                order.source_id  = 1;
                order.time_order = DateTime.Now;
                order.end_order  = DateTime.Now;
                this.restorantDataSet.order.AddorderRow(order);
            }

            abonent.SelectedItem     = order.abonent_id;
            waiter.SelectedItem      = order.waiter_id;
            item_source.SelectedItem = order.source_id;
            time_order.Value         = order.time_order;
            end_order.Value          = order.end_order;

            this.detailsBindingSource.Filter      = $"order_id={order.id}";
            restorantDataSet.details.TableNewRow += newRow;
        }
Ejemplo n.º 2
0
        public Order(object order)
        {
            InitializeComponent();
            var d = order as DataRowView;

            this.order = (RestorantDataSet.orderRow)d.Row;
        }