private void Button_Click(object sender, RoutedEventArgs e)
        {
            Hide();
            Menejer menejer = new Menejer();

            menejer.ShowDialog();
            Close();
        }
示例#2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            //todo logginning
            bool found = false;

            foreach (var item in Helper.users)
            {
                if (item.Login == Login.Text && item.Password == Pass.Password)
                {
                    found = true;
                    if (item.IsBanned == false)
                    {
                        if (item.IsAccepted == true)
                        {
                            if (item.Range == "Deliver")
                            {
                                Hide();
                                DeliverMenu deliver = new DeliverMenu(item);
                                deliver.ShowDialog();
                                Show();
                            }
                            else if (item.Range == "Manager")
                            {
                                Hide();
                                Menejer menejer = new Menejer();
                                menejer.ShowDialog();
                                Show();
                            }

                            else if (item.Range == "Admin")
                            {
                                Hide();
                                AdminPanel menejer = new AdminPanel();
                                menejer.ShowDialog();
                                Show();
                            }
                            else if (item.Range == "Client")
                            {
                                Hide();
                                Client client = new Client(item);
                                client.ShowDialog();
                                Show();
                            }
                            item.LastLogin = DateTime.Now;
                            break;
                        }
                        else
                        {
                            MessageBox.Show("Your request in procces! Menejers will look it");
                            break;
                        }
                    }
                    else
                    {
                        MessageBox.Show("YOU ARE BANNED");
                        break;
                    }
                }
                else
                {
                    found = false;
                }
            }
            if (found == false)
            {
                MessageBox.Show("Account not found");
            }
            Login.Text    = null;
            Pass.Password = null;
        }