示例#1
0
        private void button1_Click(object sender, EventArgs e)
        {
            bool   requiredError = false;
            string err           = "";

            if (textBox1.Text == "")
            {
                err           = "Minden mező kitöltése kötelező";
                requiredError = true;
            }

            if (requiredError == false)
            {
                string insertQuery = "INSERT INTO mainmenus (`menuName`,`parentId`,`active`) VALUES ('" + textBox1.Text + "','" + menu.sMenuId + "',1)";
                Framework.db.RunQuery(insertQuery);

                int lastId = Framework.LastInsertId();
                Framework.insertLog(Framework.MyUserId, Framework.Operation("Sikeres menü feltöltés"), lastId);

                MessageBox.Show("Menü feltöltve!");

                Framework.mainForm.panel1.Controls.Clear();
                MenuList listForm = new MenuList();
                listForm.TopLevel   = false;
                listForm.AutoScroll = true;
                Framework.mainForm.panel1.Controls.Add(listForm);
                listForm.Show();
            }
            else
            {
                Framework.insertLog(Framework.MyUserId, Framework.Operation("Sikertelen menü feltöltés"), 0);
                MessageBox.Show(err);
            }
        }
示例#2
0
文件: Main.cs 项目: birmar2/NOC
        private void listToolStripMenuItem_Click(object sender, EventArgs e)
        {
            panel1.Controls.Clear();
            MenuList myForm = new MenuList();

            myForm.TopLevel   = false;
            myForm.AutoScroll = true;
            panel1.Controls.Add(myForm);
            myForm.Show();
        }