示例#1
0
        public Rakt(string uname)
        {
            connectionManager cnt = new connectionManager();

            user = new us();
            InitializeComponent();
            dataGridView1.ReadOnly      = true;
            dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            this.uname = uname;
            dataGridView1.MultiSelect = false;
            placeHolderTextBox1.setPlaceHolder("keresés név alapján");

            string REGISTRY_KEY   = @"HKEY_CURRENT_USER\GastroKer";
            string REGISTRY_VALUE = cnt.keyValue;

            if (Convert.ToInt32(Microsoft.Win32.Registry.GetValue(REGISTRY_KEY, REGISTRY_VALUE, 0)) == 0)
            {
                aru = new addRktUser(true);
                cst = new connectionSetter();
                cst.ShowDialog();
                if (cst.DialogResult == DialogResult.OK)
                {
                    if (cst.setCons() == 1)
                    {
                        Microsoft.Win32.Registry.SetValue(REGISTRY_KEY, REGISTRY_VALUE,
                                                          1, Microsoft.Win32.RegistryValueKind.DWord);
                    }
                }
            }

            if (Convert.ToInt32(Microsoft.Win32.Registry.GetValue(REGISTRY_KEY, REGISTRY_VALUE, 0)) == 0)
            {
                this.Close();
            }
        }
示例#2
0
        private void felhasználóHozzáadásaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            addRktUser aru = new addRktUser();


            if (user.getRights(uname) == "admin")
            {
                aru.ShowDialog();
                if (aru.DialogResult == DialogResult.OK)
                {
                    aru.addNewUser();
                }
            }
            else
            {
                MessageBox.Show("nincs jozzá jogosultsága");
                return;
            }
        }