コード例 #1
0
        private void BtStorager_Click(object sender, RoutedEventArgs e)
        {
            StoragerInterface Storager = new StoragerInterface();

            Storager.Owner = this;
            Storager.Show();
            this.Hide();
        }
コード例 #2
0
        private void Autorization()
        {
            Action action = () =>
            {
                DES    des = DES.Create();
                byte[] key = Convert.FromBase64String("WdbWuvWCHPc=");
                byte[] IV  = Convert.FromBase64String("RuBs2bQBW58=");
                des.Key = key;
                des.IV  = IV;
                byte[]    login  = Crypt_Class.SymmetricEncrypt(tbLogin.Text, des);
                byte[]    passwd = Crypt_Class.SymmetricEncrypt(tbPassword.Password, des);
                ArrayList array  = new ArrayList();
                array.Add(Convert.ToBase64String(login));
                array.Add(Convert.ToBase64String(passwd));
                tbLogin.Clear();
                tbPassword.Clear();
                Function_class autoriz = new Function_class("Autorization", Function_class.Function_Result.scalar, array);
                if (autoriz.Regtable.Rows[0][0].ToString() == "-1")
                {
                    MessageBox.Show("Учётная запись с такими параметрами не существует или является заблокированной!", "ParawosoffApp", MessageBoxButton.OK, MessageBoxImage.Error);
                }
                else
                {
                    App.intID = autoriz.Regtable.Rows[0][0].ToString();
                    Table_Class tablePos = new Table_Class(String.Format("select [Position_ID] from [dbo].[Staff] where [ID_Staff] = {0}", autoriz.Regtable.Rows[0][0].ToString()));
                    switch (tablePos.table.Rows[0][0].ToString())
                    {
                    case ("0"):
                        Selector selector = new Selector();
                        selector.Owner = this;
                        selector.Show();
                        this.Hide();
                        break;

                    case ("1"):
                        SaleInterface sale = new SaleInterface();
                        sale.Owner = this;
                        sale.Show();
                        this.Hide();
                        break;

                    case ("2"):
                        ManagerInterface manager = new ManagerInterface();
                        manager.Owner = this;
                        manager.Show();
                        this.Hide();
                        break;

                    case ("3"):
                        StoragerInterface storager = new StoragerInterface();
                        storager.Owner = this;
                        storager.Show();
                        this.Hide();
                        break;

                    case ("4"):
                        MarketerInterface marketer = new MarketerInterface();
                        marketer.Owner = this;
                        marketer.Show();
                        this.Hide();
                        break;
                    }
                }
            };

            action.Invoke();
        }