Пример #1
0
        private void button_OrderEdit_Click(object sender, RoutedEventArgs e) //кнопка подробно
        {
            try
            {
                if (dataGridOrder.SelectedItem != null)
                {
                    MyContext db      = new MyContext();
                    Order     delnote = dataGridOrder.SelectedItem as Order;

                    ////OrderInfo s = db.OrderInfos
                    //if (db.OrderInfos.ProductsId == null)
                    //{
                    //    MessageBox.Show("Заявка пустая! Товары удалены", "Ошибка");
                    //}
                    //else
                    //{
                    OrderEdit wind = new OrderEdit()
                    {
                        IdDelivery = delnote.Id
                    };
                    wind.EmployeeId = EmployeeId;
                    wind.Closing   += OrderEdit_closing;
                    wind.ShowDialog();
                }
                // }
                else
                {
                    MessageBox.Show("Выберите запись для просмотра", "Ошибка");
                }
            }
            catch
            {
                MessageBox.Show("error!!!", "Ошибка");
            }
        }
Пример #2
0
        private void button_OrderNew_Click(object sender, RoutedEventArgs e)
        {
            OrderEdit f = new OrderEdit()
            {
                IdDelivery = -1
            };

            f.EmployeeId = EmployeeId;
            f.Closing   += OrderEdit_closing;
            f.ShowDialog();
        }