Пример #1
0
        public Form1()
        {
            InitializeComponent();
            rbacCombo1.SelectedIndex = 2;
            string        conStr = "DRIVER={MySQL ODBC 5.1 Driver};SERVER=192.168.10.3;PORT=3306;DATABASE=RBAC;USER=LT_DB;PASSWORD=She!byGT;OPTION=3";
            IDbConnection con    = (IDbConnection) new OdbcConnection(conStr);

            con.Open();

            try
            {
                //rbacButton1.GroupUniqueID = rbacButton1.GroupUniqueID;

                dbl = new DataLayer(con, DataLayer.DatabaseType.MySql);
                bool d = SecurityPrincipal.InitSecuritySystem(dbl, "Admin", "Admin");


                rbacButton1.oError            += new nKnight.RBACControl.OnRBACButtonError(rbacButton1_oError);
                rbacTextBox1.oError           += new nKnight.RBACControl.OnTextBoxError(rbacTextBox1_oError);
                rbacCheckBox1.oError          += new nKnight.RBACControl.OnRBACCheckBoxError(rbacCheckBox1_oError);
                rbacMaskedTextBox1.oError     += new nKnight.RBACControl.OnRBACMaskedTextBoxError(rbacMaskedTextBox1_oError);
                rbacRadioButton1.oError       += new nKnight.RBACControl.OnRBACRadioButtonError(rbacRadioButton1_oError);
                rbacCombo1.oError             += new nKnight.RBACControl.OnRBACCComboError(rbacCombo1_oError);
                rbacCheckListBox1.oError      += new nKnight.RBACControl.OnRBACCheckListBoxError(rbacCheckListBox1_oError);
                rbacLinkLabel1.oError         += new nKnight.RBACControl.OnRBACLinkLabelError(rbacLinkLabel1_oError);
                nKnightDateTimePicker1.oError += new nKnight.RBACControl.OnRBACDtPickerError(nKnightDateTimePicker1_oError);
                nKnightGridView1.oError       += new nKnight.RBACControl.OnRBACGridError(nKnightGridView1_oError);
                nKnightButton1.oError         += new nKnight.RBACControl.OnRBACButtonError(nKnightButton1_oError);
                nKnightRadioButton2.oError    += new nKnight.RBACControl.OnRBACRadioButtonError(nKnightRadioButton2_oError);
                //rbacButton1.Click += new EventHandler(rbacButton1_Click);
            }
            catch (Exception ex) { MessageBox.Show(ex.Message); }
        }
Пример #2
0
        public userManagement()
        {
            InitializeComponent();
            IDbConnection con = (IDbConnection) new OdbcConnection(conStr);

            con.Open();

            dbl = new DataLayer(con, DataLayer.DatabaseType.MySql);
            bool d = SecurityPrincipal.InitSecuritySystem(dbl, "Admin", "Admin");
        }