Exemple #1
0
        private void Back_Click(object sender, RoutedEventArgs e)
        {
            MasterMainWindow master = new MasterMainWindow();

            master.Show();
            this.Close();
        }
Exemple #2
0
        private void Authorization_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                UserModel OldUser = new UserModel()
                {
                    Login    = Login.Text,
                    Password = Password.Password
                };


                switch (UserLogic.Authorization(OldUser))
                {
                case 1:
                    ClientMainWindow client = new ClientMainWindow();
                    client.Show();
                    this.Close();
                    break;

                case 2:
                    MasterMainWindow master = new MasterMainWindow();
                    master.Show();
                    this.Close();
                    break;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemple #3
0
        private void OrderList_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            try
            {
                if (OrderList.SelectedCells.Count > 0)
                {
                    MessageBoxResult message = MessageBox.Show("Вы уверены, что хотите взять этот заказ?", "Подтверждение заказа", MessageBoxButton.YesNo);
                    if (message == MessageBoxResult.Yes)
                    {
                        OrderModel order = new OrderModel()
                        {
                            IdOrder = Convert.ToInt32(dt.Rows[OrderList.SelectedIndex].ItemArray[0])
                        };

                        OrderLogic.SelectOrder(order);
                        MessageBox.Show("Заказ успешно принят!");

                        MasterMainWindow master = new MasterMainWindow();
                        master.Show();
                        this.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }